summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPExpressions.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix typo, improve comment.Chris Lattner2008-05-051-5/+6
| | | | llvm-svn: 50666
* Fix a few more bugs in preprocessor expressions w.r.t. ?:. Now I Chris Lattner2008-05-051-12/+24
| | | | | | think it is really right. :) This fixes PR2284. llvm-svn: 50665
* Neil pointed out that clang doesn't generate ranges from diagnosticsChris Lattner2008-05-051-120/+172
| | | | | | | | | | | | | | | | | | | | | | | | related to pp-expressions. Doing so is pretty simple and this patch implements it, yielding nice diagnostics like: t.c:2:7: error: division by zero in preprocessor expression #if 1 / (0 + 0) ~ ^ ~~~~~~~ t.c:5:14: error: expected ')' in preprocessor expression #if (412 + 42 ~~~~~~~~^ t.c:5:5: error: to match this '(' #if (412 + 42 ^ t.c:10:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574 #if (-42 + 0U) / -2 ~~~ ^ ~~ t.c:10:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614 #if (-42 + 0U) / -2 ~~~~~~~~~~ ^ ~~ 5 diagnostics generated. llvm-svn: 50638
* fix a bug handling right associative operators that Neil noticed, hopefullyChris Lattner2008-05-051-14/+4
| | | | | | the final part of PR2279 llvm-svn: 50635
* ||/&& do not do UAC's either. This silences a bogus warning on #if -1 || 4U.Chris Lattner2008-05-041-4/+10
| | | | llvm-svn: 50632
* Neil points out that commas don't do UACs either.Chris Lattner2008-05-041-1/+1
| | | | llvm-svn: 50631
* Fix the rest of PR2279:Chris Lattner2008-05-041-4/+7
| | | | | | | | | a) correct rejection of ',' in pp expressions. b) the precedence of ',' was wrong w.r.t. ?:. Thanks again to Neil for finding these and providing testcases. llvm-svn: 50625
* Fix PR2279 part C: shifts don't perform the UACs, thanks to Neil Chris Lattner2008-05-041-2/+4
| | | | | | for pointing this out. llvm-svn: 50624
* fix a nasty bug that Neil identifier in pp-expr parsing (this is PR2279 part D).Chris Lattner2008-05-041-5/+13
| | | | llvm-svn: 50617
* Fix PR2220, making diagnostics for unexpected tokens in pp expressions Chris Lattner2008-04-131-3/+3
| | | | | | more nice. llvm-svn: 49619
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+639
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud