summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPExpressions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Micro-change: moved a brace for better readabilityAlexander Kornienko2013-01-311-2/+2
| | | | llvm-svn: 174075
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-1/+1
| | | | llvm-svn: 171367
* [Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also passArgyrios Kyrtzidis2012-12-081-3/+9
| | | | | | a MacroInfo object if the identifier was a macro name. llvm-svn: 169665
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-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
* Change the wording of the extension warning fromDmitri Gribenko2012-09-241-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
* Small cleanup of literal semantic analysis: hiding 'char *' pointers behindDmitri Gribenko2012-09-241-2/+1
| | | | | | | StringRef makes code cleaner. Also, make the temporary buffer smaller: 512 characters is unreasonably large for integer literals. llvm-svn: 164484
* The keywords "true" and "false" shouldn't warn under -Wundef.Eli Friedman2012-09-201-1/+3
| | | | llvm-svn: 164279
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-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
* Add support for cooked forms of user-defined-integer-literal andRichard Smith2012-03-081-1/+5
| | | | | | | user-defined-floating-literal. Support for raw forms of these literals to follow. llvm-svn: 152302
* User-defined literals: reject string and character UDLs in all places where theRichard Smith2012-03-061-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
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-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
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-2/+0
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* -Wc++98-compat warnings for the lexer.Richard Smith2011-10-151-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
* Add a preprocessor callback that is invoked every time the 'defined'Douglas Gregor2011-10-141-0/+4
| | | | | | operator is seen, from Jason Haslam! llvm-svn: 141926
* Fix missing includes for llvm_unreachableDavid Blaikie2011-09-231-0/+1
| | | | llvm-svn: 140368
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis2011-09-041-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
* A couple fixes for preprocessor expressions:Eli Friedman2011-08-031-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
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-4/+12
| | | | llvm-svn: 136210
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-281-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
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-151-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
* move logic for computing signed integer overflow when constant foldingChris Lattner2010-10-131-27/+22
| | | | | | into APInt. llvm-svn: 116453
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-241-0/+6
| | | | | | arguments. llvm-svn: 111976
* Implement preprocessor code completion where a macro name is expected,Douglas Gregor2010-08-241-1/+8
| | | | | | | e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
* Fix namespace polution.Dan Gohman2010-07-261-0/+4
| | | | llvm-svn: 109440
* Introduce optional "Invalid" parameters to routines that invoke theDouglas Gregor2010-03-161-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
* Another trivial getSpelling simplification.Benjamin Kramer2010-02-271-4/+2
| | | | llvm-svn: 97327
* Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer2010-02-271-4/+3
| | | | | | returns a StringRef. Use it to simplify some repetitive code. llvm-svn: 97322
* fix rdar://7683173, rejecting an invalid conditionalChris Lattner2010-02-261-1/+1
| | | | llvm-svn: 97253
* fix rdar://7466570 - Be more bug compatible with GCC when it comes to Chris Lattner2009-12-141-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
* reduce indentation.Chris Lattner2009-12-141-15/+14
| | | | llvm-svn: 91262
* Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.Daniel Dunbar2009-11-131-1/+1
| | | | llvm-svn: 87087
* Re-arranged some internal functions for coming __has_include changes.John Thompson2009-10-301-55/+63
| | | | llvm-svn: 85589
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-48/+48
| | | | llvm-svn: 81346
* Basic support for C++0x unicode types. Support for literals will follow in ↵Alisdair Meredith2009-07-141-1/+3
| | | | | | an incremental patch llvm-svn: 75622
* Move CharIsSigned from TargetInfo to LangOptions.Eli Friedman2009-06-051-1/+1
| | | | llvm-svn: 72928
* PR4283: Don't truncate multibyte character constants in the Eli Friedman2009-06-011-2/+6
| | | | | | preprocessor. llvm-svn: 72686
* PR3942: Don't warn on unsigned overflow in preprocessor expressions.Eli Friedman2009-05-161-4/+4
| | | | llvm-svn: 71960
* simplification and speedupChris Lattner2009-04-241-1/+1
| | | | llvm-svn: 69963
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-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
* fix rdar://6505352 - Bogus warning with -WUndef, a caseChris Lattner2009-01-181-1/+2
| | | | | | Anders noticed. llvm-svn: 62472
* make the 'to match this' diagnostic a note.Chris Lattner2008-11-231-3/+3
| | | | llvm-svn: 59921
* don't turn identifierinfo's into strings in diagnostics.Chris Lattner2008-11-191-1/+1
| | | | llvm-svn: 59602
* Remove the last of the old-style Preprocessor::Diag methods.Chris Lattner2008-11-181-29/+30
| | | | llvm-svn: 59554
* remove one more Preprocessor::Diag method.Chris Lattner2008-11-181-1/+1
| | | | llvm-svn: 59512
* various updates to match r54873 on mainline.Chris Lattner2008-08-171-2/+4
| | | | llvm-svn: 54874
* More #include cleaningDaniel Dunbar2008-08-111-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
* Fix PR2252: don't warn on negating an unsigned value ever, and don't emitChris Lattner2008-07-031-6/+4
| | | | | | 'integer constant is so large that it is unsigned' warning for hex literals. llvm-svn: 53070
OpenPOWER on IntegriCloud