Commit Graph

668 Commits

Author SHA1 Message Date
Daniel Dunbar f2cf329ccd Lex: Add #pragma clang __debug {llvm_fatal_error, llvm_unreachable}, for testing
those crash paths.

llvm-svn: 111311
2010-08-17 22:32:48 +00:00
Chris Lattner c0a585d63c Implement #pragma push_macro, patch by Francois Pichet!
llvm-svn: 111234
2010-08-17 15:55:45 +00:00
Douglas Gregor 02690ba643 Don't emit end-of-file diagnostics like "unterminated conditional" or
"unterminated string" when we're performing code completion.

llvm-svn: 110933
2010-08-12 17:04:55 +00:00
Benjamin Kramer e8394df11b Random temporary string cleanup.
llvm-svn: 110807
2010-08-11 14:47:12 +00:00
Douglas Gregor 028d3e4d0f Use precompiled preambles for in-process code completion.
llvm-svn: 110596
2010-08-09 20:45:32 +00:00
Douglas Gregor 618e64a23b Revert r110440, the fix for PR4897. Chris claims to have a better way.
llvm-svn: 110544
2010-08-08 07:49:23 +00:00
Benjamin Kramer d05f31d059 Push location through the MacroUndefined PPCallback and use it to print #undefs in -dD mode. (PR7818)
llvm-svn: 110523
2010-08-07 22:27:00 +00:00
Douglas Gregor d26129a98a Fix the #include search path when reading from stdin, from Jon Simons!
Fixes PR4897.

llvm-svn: 110440
2010-08-06 12:06:13 +00:00
Ted Kremenek d21139a34f After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking. Patch by Andrew McGregor!
llvm-svn: 109939
2010-07-31 01:52:11 +00:00
Daniel Dunbar 51738ba43e Transcribe clattner email to SVN.
llvm-svn: 109727
2010-07-29 02:46:02 +00:00
Daniel Dunbar e11281077d Change #pragma crash to segv, instead of abort.
llvm-svn: 109725
2010-07-29 02:25:07 +00:00
Daniel Dunbar b8068c33e2 Preprocessor: Add support for '#pragma clang __debug crash' and '#pragma clang
__debug overflow_stack'.
 - For testing crash reporting stuff... you'd think I could just use some C++
   code but Doug keeps fixing stuff!

llvm-svn: 109587
2010-07-28 15:40:33 +00:00
Sebastian Redl 9891212476 Record macros in dependent PCHs. Also add various info tables to dependent PCHs; tests for this to follow.
llvm-svn: 109554
2010-07-27 23:01:28 +00:00
Ted Kremenek 2bd41d1e30 Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those by Lexer::LexEndOfFile().
llvm-svn: 109486
2010-07-27 02:59:02 +00:00
Douglas Gregor 3f4bea0646 Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.

llvm-svn: 109445
2010-07-26 21:36:20 +00:00
Dan Gohman 28ade550f4 Fix namespace polution.
llvm-svn: 109440
2010-07-26 21:25:24 +00:00
Douglas Gregor cd8bdd025f Improve performance during cursor traversal when a region of interest
is present. 

Rather than using clang_getCursorExtent(), which requires
us to lex the token at the ending position to determine its
length. Then, we'd be comparing [a, b) source ranges that cover the
characters in the range rather than the normal behavior for Clang's
source ranges, which covers the tokens in the range. However, relexing
causes us to read the source file (which may come from a precompiled
header), which is rather unfortunate and affects performance.

In the new scheme, we only use Clang-style source ranges that cover
the tokens in the range. At the entry points where this matters
(clang_annotateTokens, clang_getCursor), we make sure to move source
locations to the start of the token.

Addresses most of <rdar://problem/8049381>.

llvm-svn: 109134
2010-07-22 20:22:31 +00:00
Douglas Gregor af82e3510b Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.

llvm-svn: 108913
2010-07-20 20:18:03 +00:00
Douglas Gregor b37b46e488 Complain when string literals are too long for the active language
standard's minimum requirements.

llvm-svn: 108837
2010-07-20 14:33:20 +00:00
Chris Lattner ad4f38b1a9 BUILD_ARCHIVE is the default for libraries, no need to set it.
llvm-svn: 108633
2010-07-18 00:14:47 +00:00
Chris Lattner 52c00bdd5b Add another terrible VC++ compatibility hack: allow users to
allow invalid token pastes (when in -fms-extensions mode)
with -Wno-invalid-token-paste

llvm-svn: 108624
2010-07-17 16:24:30 +00:00
Argyrios Kyrtzidis 36745fda34 Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos.
When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded).
We can avoid this if we just use StringRefs for the pragmas.

As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified.

llvm-svn: 108237
2010-07-13 09:07:17 +00:00
Argyrios Kyrtzidis d1d239f35c Remove the check for repeated tok::eofs, we are not supposed to go past eof so this code is
totally unnecessary.

llvm-svn: 108199
2010-07-12 21:41:41 +00:00
Argyrios Kyrtzidis c2924de667 If we are past tok::eof and in caching lex mode, avoid caching repeated tok::eofs.
llvm-svn: 108175
2010-07-12 18:49:30 +00:00
Chris Lattner 5a503e9f70 we do in fact have to cache the EOF token returned by the preprocessor.
In the case of backtracking, the cached token lexer will be the only 
lexer on the stack, without this the token stack will be empty and EOF
won't be returned.

This fixes PR7072.

llvm-svn: 108124
2010-07-12 04:25:32 +00:00
Chris Lattner 86851b8a7a fix PR4499, patch by Kyle Dean!
llvm-svn: 107836
2010-07-07 23:24:27 +00:00
Chris Lattner 30c924b3e8 Implement support for #pragma message, patch by Michael Spencer!
llvm-svn: 106950
2010-06-26 17:11:39 +00:00
Eric Christopher 03256c32ff More clang support for darwin tls. Add a __has_feature macro and
target specific preprocessor define as well.

llvm-svn: 106715
2010-06-24 02:02:00 +00:00
Chris Lattner c548be9ab3 Remove a dead argument to ProcessUCNEscape.
Fix string concatenation to treat escapes in concatenated strings that
are wide because of other string chunks to process the escapes as wide
themselves.  Before we would warn about and miscompile the attached testcase.

This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range

llvm-svn: 106012
2010-06-15 18:06:43 +00:00
Daniel Dunbar d839e77b12 Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.
llvm-svn: 105830
2010-06-11 20:10:12 +00:00
Ted Kremenek dea66e3e4c Fix memory leak in Preprocessor where MacroInfo objects in the MICache wouldn't have their
associated SmallVectors get deallocated.

llvm-svn: 105658
2010-06-08 23:00:53 +00:00
Daniel Dunbar ee6b692551 Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.
llvm-svn: 105638
2010-06-08 20:44:43 +00:00
Daniel Dunbar e6c1daa8fd Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

llvm-svn: 105637
2010-06-08 20:34:18 +00:00
Chris Lattner 52d96ac930 simpler fix for rdar://8044135 - escaped newlines have already
been processed, so they don't have to be tip-toed around.

llvm-svn: 105182
2010-05-30 23:27:38 +00:00
Douglas Gregor fe4a4107d8 Improve our handling of NULL after an escaping '\' in a string
literal. Fixes <rdar://problem/8044135>.

llvm-svn: 105181
2010-05-30 22:59:50 +00:00
Fariborz Jahanian 93bef10131 Fix a miscompile of wchar pascal strings.
(radar 8020384)

llvm-svn: 104996
2010-05-28 19:40:48 +00:00
Douglas Gregor 9af03022ff Tell the string literal parser when it's not permitted to emit
diagnostics. That would be while we're parsing string literals for the
sole purpose of producing a diagnostic about them. Fixes
<rdar://problem/8026030>.

llvm-svn: 104684
2010-05-26 05:35:51 +00:00
Douglas Gregor 6da3db4af3 Improve code completion in failure cases in two ways:
1) Suppress diagnostics as soon as we form the code-completion
  token, so we don't get any error/warning spew from the early
  end-of-file.
  2) If we consume a code-completion token when we weren't expecting
  one, go into a code-completion recovery path that produces the best
  results it can based on the context that the parser is in.

llvm-svn: 104585
2010-05-25 05:58:43 +00:00
Chris Lattner 467f6bcfe5 robustify the conflict marker stuff. Don't add 7 twice, which would
make it miss (invalid) things like:
<<<<<<<
>>>>>>>

and crash if 

<<<<<<< 

was at the end of the line.  When we find a >>>>>>> that is not at the
end of the line, make sure to reset Pos so we don't crash on something
like:
<<<<<<< >>>>>>>

This isn't worth making testcases for, since each would require a new file.

rdar://7987078 - signal 11 compiling "<<<<<<<<<<"

llvm-svn: 103968
2010-05-17 20:27:25 +00:00
Chris Lattner 561aabd943 when code completing inside a C-style block comment, don't emit errors about
a missing */ since we truncated the file.

This fixes rdar://7948776

llvm-svn: 103913
2010-05-16 19:54:05 +00:00
Ted Kremenek e506ddc71e Add '__has_feature' support for weak ObjC classes.
llvm-svn: 102588
2010-04-29 02:06:46 +00:00
Ted Kremenek 6459939112 Sort '__has_feature' cases. No functionality change.
llvm-svn: 102587
2010-04-29 02:06:42 +00:00
Chris Lattner fb24a3a4ec push some source location information down through the compiler,
into ContentCache::getBuffer.  This allows it to produce 
diagnostics on the broken #include line instead of without a 
location.

llvm-svn: 101939
2010-04-20 20:35:58 +00:00
Chris Lattner 72286d6129 add a PPCallback handler for a skipped #include, patch by
Zhanyong Wan!

llvm-svn: 101813
2010-04-19 20:44:31 +00:00
Chris Lattner 1cf5bdd03d emit warn_char_constant_too_large at most once per literal, fixing PR6852
llvm-svn: 101580
2010-04-16 23:44:05 +00:00
Chris Lattner c745cec17c Improve line marker directive locations, patch by Jordy Rose
llvm-svn: 101226
2010-04-14 04:28:50 +00:00
Chris Lattner 0384e63501 make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."
when avoiding paste.  Patch by David Peixotto!

llvm-svn: 101218
2010-04-14 03:57:19 +00:00
Chris Lattner 1a9e873bf9 fix a minor bug I noticed while work with Jordy's patch for PR6101,
in an input file like this:

# 42
int x;

we were emitting:

# <something>
 int x;

(with a space before the int) because we weren't clearing the leading 
whitespace flag properly after the \n from the directive was handled.

llvm-svn: 101084
2010-04-12 23:04:41 +00:00
Chris Lattner 58c79341ab Match MemoryBuffer API changes.
llvm-svn: 100484
2010-04-05 22:42:27 +00:00
Douglas Gregor a771f46c82 Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".

llvm-svn: 100022
2010-03-31 17:46:05 +00:00
Douglas Gregor 30e631862f Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
llvm-svn: 100018
2010-03-31 17:25:35 +00:00
Douglas Gregor 3baad0d4f7 Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.

llvm-svn: 100008
2010-03-31 15:31:50 +00:00
Chris Lattner 8c5d05a299 fix a case where macro expansion should be disabled, patch by
Abramo Bagnara!

llvm-svn: 99626
2010-03-26 17:49:16 +00:00
Chris Lattner 80dbccd1bf fix a bug in paste avoidance which would cause us to accidentally
form a >>=.  Patch by Abramo Bagnara, testcase by me.

llvm-svn: 99624
2010-03-26 17:10:02 +00:00
Daniel Dunbar cb9eaf59fb PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.
llvm-svn: 99257
2010-03-23 05:09:10 +00:00
Douglas Gregor 8aaca67b0a Robustify PreprocessingRecord slightly, by only creating macro
instantiations when we have the corresponding macro definition and by
removing macro definition information from our table when the macro is
undefined. 

llvm-svn: 99004
2010-03-19 21:58:23 +00:00
Douglas Gregor aae9224e49 Implement serialization and lazy deserialization of the preprocessing
record (which includes all macro instantiations and definitions). As
with all lay deserialization, this introduces a new external source
(here, an external preprocessing record source) that loads all of the
preprocessed entities prior to iterating over the entities.

The preprocessing record is an optional part of the precompiled header
that is disabled by default (enabled with
-detailed-preprocessing-record). When the preprocessor given to the
PCH writer has a preprocessing record, that record is written into the
PCH file. When the PCH reader is given a PCH file that contains a
preprocessing record, it will be lazily loaded (which, effectively,
implicitly adds -detailed-preprocessing-record). This is the first
case where we have sections of the precompiled header that are
added/removed based on a compilation flag, which is
unfortunate. However, this data consumes ~550k in the PCH file for
Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering
this detailed preprocessing information, so it's too expensive to turn
on by default. In the future, we should investigate a better encoding
of this information.

llvm-svn: 99002
2010-03-19 21:51:54 +00:00
Douglas Gregor 7dc8722bd3 Make the preprocessing record a PPCallbacks subclass itself,
eliminating the extra PopulatePreprocessingRecord object. This will
become useful once we start writing the preprocessing record to
precompiled headers.

llvm-svn: 98966
2010-03-19 17:12:43 +00:00
Douglas Gregor 7f6d60dcc2 Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.

llvm-svn: 98963
2010-03-19 16:15:56 +00:00
Douglas Gregor 78ae2481b6 Explicitly link macro instantiations to macro definitions in the
preprocessing record. Use that link with clang_getCursorReferenced()
and clang_getCursorDefinition() to match instantiations of a macro to
the definition of the macro.

llvm-svn: 98842
2010-03-18 18:23:03 +00:00
Douglas Gregor 065f8d11ca Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.

llvm-svn: 98836
2010-03-18 17:52:52 +00:00
Douglas Gregor 4ad3da2843 Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.

llvm-svn: 98727
2010-03-17 15:44:30 +00:00
Douglas Gregor 1668355e06 Remove unused variable
llvm-svn: 98691
2010-03-16 22:54:32 +00:00
Douglas Gregor dc970f0866 Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.

llvm-svn: 98689
2010-03-16 22:30:13 +00:00
Douglas Gregor 42fe858cd6 Audit all callers of SourceManager::getCharacterData(); update some of
them to recover more gracefully on failure.

llvm-svn: 98672
2010-03-16 20:46:42 +00:00
Douglas Gregor 4fb7fbef3b Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.

llvm-svn: 98665
2010-03-16 20:01:30 +00:00
Douglas Gregor 26266da3c3 Teach the one caller of SourceManager::getMemoryBufferForFile() to cope with errors
llvm-svn: 98664
2010-03-16 19:49:24 +00:00
Benjamin Kramer eb92dc0b09 Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
llvm-svn: 98630
2010-03-16 14:14:31 +00:00
Douglas Gregor 7bda4b8310 Introduce optional "Invalid" parameters to routines that invoke the
SourceManager's getBuffer() and, therefore, could fail, along with
Preprocessor::getSpelling(). Use the Invalid parameters in the literal
parsers (string, floating point, integral, character) to make them
robust against errors that stem from, e.g., PCH files that are not
consistent with the underlying file system.

I still need to audit every use caller to all of these routines, to
determine which ones need specific handling of error conditions.

llvm-svn: 98608
2010-03-16 05:20:39 +00:00
Douglas Gregor 874cc62876 Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.

llvm-svn: 98598
2010-03-16 00:35:39 +00:00
Douglas Gregor e0fbb83b8b Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.

llvm-svn: 98594
2010-03-16 00:06:06 +00:00
Douglas Gregor 802b77601e Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).

llvm-svn: 98585
2010-03-15 22:54:52 +00:00
Kovarththanan Rajaratnam ba2c65277a Use SmallString instead of SmallVector
llvm-svn: 98436
2010-03-13 10:17:05 +00:00
Kovarththanan Rajaratnam e5f1c197af No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do
llvm-svn: 98435
2010-03-13 08:53:33 +00:00
Jeffrey Yasskin f6442f80cb Allow users to set CPPFLAGS and CXXFLAGS on the make command line.
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399
2010-03-12 22:55:16 +00:00
Kovarththanan Rajaratnam 661a309933 Switch over IdentifierInfoLookup to StringRef
llvm-svn: 98337
2010-03-12 08:23:34 +00:00
Ted Kremenek a00c5db1a8 Augment __has_feature to report that Clang supports adding attribute 'unused'
to an Objective-C instance variable.

llvm-svn: 97850
2010-03-05 22:43:32 +00:00
Benjamin Kramer a197fb6731 Move method out-of-line. I thought this would be a candidate for inlining but I was wrong.
llvm-svn: 97330
2010-02-27 17:05:45 +00:00
Benjamin Kramer 53fa347ee6 Another trivial getSpelling simplification.
llvm-svn: 97327
2010-02-27 16:29:36 +00:00
Benjamin Kramer 0a1abd4088 Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.

llvm-svn: 97322
2010-02-27 13:44:12 +00:00
Chris Lattner 9c56ec86b2 fix rdar://7683173, rejecting an invalid conditional
llvm-svn: 97253
2010-02-26 19:42:53 +00:00
Ted Kremenek f2b64ba858 Add __has_feature support for attributes ns_returns_not_retained
and cf_returns_not_retained.

llvm-svn: 96538
2010-02-18 00:06:04 +00:00
Chris Lattner aa1cccbbef Fix PR6282: the include guard optimization cannot happen if the
guard macro is already defined for the first occurrence of the
header.  If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.

llvm-svn: 95972
2010-02-12 08:03:27 +00:00
Sebastian Redl b0e3e1bf67 When placing an annotation token over an existing annotation token, make sure that the new token's range extends to the end of the old token. Assert that in AnnotateCachedTokens. Fixes PR6248.
llvm-svn: 95555
2010-02-08 19:35:18 +00:00
Chris Lattner 93ddf80eb7 don't inform comment handlers about comments in #if 0 blocks,
doing so invalidates the file guard optimization and is not
in the spirit of "#if 0" because it is supposed to completely
skip everything, even if it isn't lexically valid. Patch by
Abramo Bagnara!

llvm-svn: 95253
2010-02-03 21:06:21 +00:00
Ted Kremenek db4b7710f7 Fix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead of '='.
llvm-svn: 94830
2010-01-29 19:38:24 +00:00
Benjamin Kramer b925f7707e Use raw_ostreams in Preprocessor::ExpandBuiltinMacro. Still not nice but less fragile than the old code.
llvm-svn: 94679
2010-01-27 16:38:22 +00:00
Douglas Gregor 64213261b4 Fix typo in comment
llvm-svn: 94576
2010-01-26 19:43:43 +00:00
Chris Lattner 0bcc858a2b -fno-rtti is now the default.
llvm-svn: 94379
2010-01-24 20:43:31 +00:00
Fariborz Jahanian 8c6c0b6a1f ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

llvm-svn: 94224
2010-01-22 21:36:53 +00:00
Douglas Gregor 562c1f9365 Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

Minor other tweaks needed to make this work:
  - Extend Preprocessor::getLocForEndOfToken() to accept an offset
  from the end, making it easy to move to the last character in the
  token (rather than just past the end of the token).
  - In Lexer::MeasureTokenLength(), the length of whitespace is zero.

llvm-svn: 94200
2010-01-22 19:49:59 +00:00
Chris Lattner fde85356c6 revert my patch for rdar://7520940 that warns when a published header
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.

llvm-svn: 94120
2010-01-22 00:14:44 +00:00
Chris Lattner 87d0208c41 allow the HandlerComment callback to push tokens into the
preprocessor.  This could be used by an OpenMP implementation
or something.  Patch by Abramo Bagnara!

llvm-svn: 93795
2010-01-18 22:35:47 +00:00
Chris Lattner f406b2402d simplify the code for skipping in a #if 0 block. The CurLexer
pointer is always non-null because the PTH case exits earlier
in the method.

llvm-svn: 93794
2010-01-18 22:33:01 +00:00
Alexis Hunt af4e28d897 Add a bunch more feature-checking macros for C++0x features. Some of these are
disabled with the intent that users can start with them now and not have to change
a thing to have them work when we implement the features.

llvm-svn: 93312
2010-01-13 08:31:49 +00:00
Chris Lattner 21d9b9a948 add a TODO for a perf improvement in LexIdentifier.
llvm-svn: 93141
2010-01-11 02:38:50 +00:00
Alexis Hunt 91b78382b5 Do not parse hexadecimal floating point literals in C++0x mode because they are
incompatible with user-defined literals, specifically with the following form:

  0x1p+1

The preprocessing-number token extends only as far as the 'p'; the '+' is not
included. Previously we could get away with this extension as p was an invalid
suffix, but now with user-defined literals, 'p' might well be a valid suffix
and we are forced to consider it as such.

This patch also adds a warning in non-0x C++ modes telling the user that
this extension is incompatible with C++0x that is enabled by default
(previously and with other languages, we warn only with a compliance
option such as -pedantic).

llvm-svn: 93135
2010-01-10 23:37:56 +00:00
Benjamin Kramer 307c2c7ebc Simplify code. No functionality change.
llvm-svn: 93114
2010-01-10 09:51:00 +00:00
Chris Lattner d081f8c851 stringref'ize a bunch of filename handling logic. Much
nicer than passing around two const char*'s.

llvm-svn: 93094
2010-01-10 01:35:12 +00:00
Chris Lattner abcbb7c05b clarify comment.
llvm-svn: 93084
2010-01-10 00:35:27 +00:00