aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/PPExpressions.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-01-31Micro-change: moved a brace for better readabilityAlexander Kornienko1-2/+2
llvm-svn: 174075
2013-01-02s/CPlusPlus0x/CPlusPlus11/gRichard Smith1-1/+1
llvm-svn: 171367
2012-12-08[Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also passArgyrios Kyrtzidis1-3/+9
a MacroInfo object if the identifier was a macro name. llvm-svn: 169665
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-3/+3
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-09-24Change the wording of the extension warning fromDmitri Gribenko1-4/+9
> 'long long' is an extension when C99 mode is not enabled to > 'long long' is a C++11 extension while compiling in C++98 mode. llvm-svn: 164545
2012-09-24Small cleanup of literal semantic analysis: hiding 'char *' pointers behindDmitri Gribenko1-2/+1
StringRef makes code cleaner. Also, make the temporary buffer smaller: 512 characters is unreasonably large for integer literals. llvm-svn: 164484
2012-09-20The keywords "true" and "false" shouldn't warn under -Wundef.Eli Friedman1-1/+3
llvm-svn: 164279
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-4/+4
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-03-08Add support for cooked forms of user-defined-integer-literal andRichard Smith1-1/+5
user-defined-floating-literal. Support for raw forms of these literals to follow. llvm-svn: 152302
2012-03-06User-defined literals: reject string and character UDLs in all places where theRichard Smith1-0/+4
grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
2012-02-05Basic: import SmallString<> into clang namespaceDylan Noblesmith1-2/+2
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
2012-01-17Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie1-2/+0
appropriate or when GCC requires it) llvm-svn: 148292
2011-10-15-Wc++98-compat warnings for the lexer.Richard Smith1-4/+3
This also adds a -Wc++98-compat-pedantic for warning on constructs which would be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features which we enable by default, with no warning, in C++98 mode). llvm-svn: 142034
2011-10-14Add a preprocessor callback that is invoked every time the 'defined'Douglas Gregor1-0/+4
operator is seen, from Jason Haslam! llvm-svn: 141926
2011-09-23Fix missing includes for llvm_unreachableDavid Blaikie1-0/+1
llvm-svn: 140368
2011-09-23Switch assert(0/false) llvm_unreachable.David Blaikie1-1/+1
llvm-svn: 140367
2011-09-04Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis1-0/+2
Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
2011-08-03A couple fixes for preprocessor expressions:Eli Friedman1-9/+13
1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases. 2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also r97253, which addressed the case of "#if defined(FOO FOO".) Fixes PR10286. llvm-svn: 136748
2011-07-27Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor1-4/+12
llvm-svn: 136210
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-2/+2
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-02-28Rename tok::eom to tok::eod.Peter Collingbourne1-9/+9
The previous name was inaccurate as this token in fact appears at the end of every preprocessing directive, not just macro definitions. No functionality change, except for a diagnostic tweak. llvm-svn: 126631
2010-12-15Fix diagnostic pragmas.Argyrios Kyrtzidis1-1/+1
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
2010-10-13move logic for computing signed integer overflow when constant foldingChris Lattner1-27/+22
into APInt. llvm-svn: 116453
2010-08-24Implement code completion for preprocessor expressions and in macroDouglas Gregor1-0/+6
arguments. llvm-svn: 111976
2010-08-24Implement preprocessor code completion where a macro name is expected,Douglas Gregor1-1/+8
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
2010-07-26Fix namespace polution.Dan Gohman1-0/+4
llvm-svn: 109440
2010-03-16Introduce optional "Invalid" parameters to routines that invoke theDouglas Gregor1-2/+10
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-02-27Another trivial getSpelling simplification.Benjamin Kramer1-4/+2
llvm-svn: 97327
2010-02-27Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer1-4/+3
returns a StringRef. Use it to simplify some repetitive code. llvm-svn: 97322
2010-02-26fix rdar://7683173, rejecting an invalid conditionalChris Lattner1-1/+1
llvm-svn: 97253
2009-12-14fix rdar://7466570 - Be more bug compatible with GCC when it comes to Chris Lattner1-2/+21
expanding directives withing macro expansions. This is undefined behavior according to 6.10.3p11, so we might as well be undefined in ways similar to GCC. llvm-svn: 91266
2009-12-14reduce indentation.Chris Lattner1-15/+14
llvm-svn: 91262
2009-11-13Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.Daniel Dunbar1-1/+1
llvm-svn: 87087
2009-10-30Re-arranged some internal functions for coming __has_include changes.John Thompson1-55/+63
llvm-svn: 85589
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump1-48/+48
llvm-svn: 81346
2009-07-14Basic support for C++0x unicode types. Support for literals will follow in ↵Alisdair Meredith1-1/+3
an incremental patch llvm-svn: 75622
2009-06-05Move CharIsSigned from TargetInfo to LangOptions.Eli Friedman1-1/+1
llvm-svn: 72928
2009-06-01PR4283: Don't truncate multibyte character constants in the Eli Friedman1-2/+6
preprocessor. llvm-svn: 72686
2009-05-16PR3942: Don't warn on unsigned overflow in preprocessor expressions.Eli Friedman1-4/+4
llvm-svn: 71960
2009-04-24simplification and speedupChris Lattner1-1/+1
llvm-svn: 69963
2009-01-29move library-specific diagnostic headers into library private dirs. ReduceChris Lattner1-1/+1
redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
2009-01-27Split the single monolithic DiagnosticKinds.def file into oneChris Lattner1-1/+1
.def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
2009-01-18fix rdar://6505352 - Bogus warning with -WUndef, a caseChris Lattner1-1/+2
Anders noticed. llvm-svn: 62472
2008-11-23make the 'to match this' diagnostic a note.Chris Lattner1-3/+3
llvm-svn: 59921
2008-11-19don't turn identifierinfo's into strings in diagnostics.Chris Lattner1-1/+1
llvm-svn: 59602
2008-11-18Remove the last of the old-style Preprocessor::Diag methods.Chris Lattner1-29/+30
llvm-svn: 59554
2008-11-18remove one more Preprocessor::Diag method.Chris Lattner1-1/+1
llvm-svn: 59512
2008-08-17various updates to match r54873 on mainline.Chris Lattner1-2/+4
llvm-svn: 54874
2008-08-11More #include cleaningDaniel Dunbar1-2/+0
- Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
2008-07-03Fix PR2252: don't warn on negating an unsigned value ever, and don't emitChris Lattner1-6/+4
'integer constant is so large that it is unsigned' warning for hex literals. llvm-svn: 53070