summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* my refactoring of builtins changed target-specific builtins to only beChris Lattner2009-06-161-1/+1
| | | | | | | | | registered when PCH wasn't being used. We should always install (in BuiltinInfo) information about target-specific builtins, but we shouldn't register any builtin identifier infos. This fixes the build of apps that use PCH and target specific builtins together. llvm-svn: 73492
* PR4395: Don't detect token concatenation in C mode for Eli Friedman2009-06-151-3/+5
| | | | | | C++-specific tokens. llvm-svn: 73408
* Fix #pragma GCC system_header by making it insert a virtual linemarker intoChris Lattner2009-06-151-2/+16
| | | | | | | the file at the point of the pragma. This allows clang to know that all sourcelocations after the pragma are in a system header. llvm-svn: 73376
* use the new Path::isAbsolute function, fixing a fixme. Patch by Gregory ↵Chris Lattner2009-06-151-3/+1
| | | | | | Curfman! llvm-svn: 73370
* implement and document a new __has_feature and __has_builtin magic Chris Lattner2009-06-131-13/+82
| | | | | | | | | builtin preprocessor macro. This appears to work with two caveats: 1) builtins are registered in -E mode, and 2) target-specific builtins are unconditionally registered even if they aren't supported by the target (e.g. SSE4 builtin when only SSE1 is enabled). llvm-svn: 73289
* PR4353: Add support for \E as a character escape.Eli Friedman2009-06-101-1/+4
| | | | llvm-svn: 73153
* Move CharIsSigned from TargetInfo to LangOptions.Eli Friedman2009-06-052-2/+2
| | | | llvm-svn: 72928
* PR4283: Don't truncate multibyte character constants in the Eli Friedman2009-06-012-2/+7
| | | | | | preprocessor. llvm-svn: 72686
* fix the "pasting formed 'a]', an invalid preprocessing token"Chris Lattner2009-05-281-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic to include the full instantiation location for the invalid paste. For: #define foo(a, b) a ## b #define bar(x) foo(x, ]) bar(a) bar(zdy) Instead of: t.c:3:22: error: pasting formed 'a]', an invalid preprocessing token #define foo(a, b) a ## b ^ t.c:3:22: error: pasting formed 'zdy]', an invalid preprocessing token we now produce: t.c:7:1: error: pasting formed 'a]', an invalid preprocessing token bar(a) ^ t.c:4:16: note: instantiated from: #define bar(x) foo(x, ]) ^ t.c:3:22: note: instantiated from: #define foo(a, b) a ## b ^ t.c:8:1: error: pasting formed 'zdy]', an invalid preprocessing token bar(zdy) ^ t.c:4:16: note: instantiated from: #define bar(x) foo(x, ]) ^ t.c:3:22: note: instantiated from: #define foo(a, b) a ## b ^ llvm-svn: 72519
* Don't vary token concatenation based on the language options; this Eli Friedman2009-05-271-6/+3
| | | | | | behavior is more likely to be confusing than useful. llvm-svn: 72499
* Make the bad paste diagnostic print the entire pasted token.Eli Friedman2009-05-271-1/+1
| | | | llvm-svn: 72497
* Fix a couple of bugs:Chris Lattner2009-05-251-18/+27
| | | | | | | | | | | | 1. When we accept "#garbage" in asm-with-cpp mode, change the token kind of the # to unknown so that the preprocessor won't try to process it as a real #. This fixes a crash on the attached example 2. Fix macro definition extents processing to handle #foo at the end of a macro to say the definition ends with the foo, not the #. This is a follow-on fix to r72283, and rdar://6916026 llvm-svn: 72388
* improve comment, no functionality change.Chris Lattner2009-05-251-10/+15
| | | | llvm-svn: 72386
* Make sure an invalid concatentaion doesn't insert whitespace before Eli Friedman2009-05-241-1/+5
| | | | | | the RHS. Fixes assembler-with-cpp issue reported on cfe-dev. llvm-svn: 72370
* In assembler-with-cpp mode, don't error on '#' (stringize) operator applied toDaniel Dunbar2009-05-221-3/+5
| | | | | | non-argument names, pass the tokens through. llvm-svn: 72283
* The TokenLexer may encounter annotations if the parser enters them using ↵Argyrios Kyrtzidis2009-05-221-1/+2
| | | | | | | | Preprocessor::EnterTokenStream. So check for annotation before using the Token's IdentifierInfo. llvm-svn: 72278
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-212-3/+4
| | | | llvm-svn: 72210
* PR3942: Don't warn on unsigned overflow in preprocessor expressions.Eli Friedman2009-05-161-4/+4
| | | | llvm-svn: 71960
* Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.Chris Lattner2009-05-131-2/+2
| | | | llvm-svn: 71643
* When we expect two arguments but have zero, make sure to addChris Lattner2009-05-132-0/+6
| | | | | | | | | two empty arguments. Also, add an assert so that this bug manifests as an assertion failure, not a valgrind problem. This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion llvm-svn: 71616
* accept "#pragma clang foo" where we accept "#pragma GCC foo".Chris Lattner2009-05-121-1/+12
| | | | llvm-svn: 71572
* Fix for PR4132: make sure to insert whitespace consistently before a Eli Friedman2009-05-031-1/+1
| | | | | | pasted token. llvm-svn: 70793
* Implement -Wfour-char-constants, which is an extension, not an extwarn,Chris Lattner2009-04-281-23/+23
| | | | | | and apparently not part of -Wall llvm-svn: 70329
* implement -WmulticharChris Lattner2009-04-281-1/+2
| | | | llvm-svn: 70315
* Emit keyword extension warning in all modes, not just C99 mode.Eli Friedman2009-04-281-1/+3
| | | | llvm-svn: 70283
* Get rid of some useless uses of NoExtensions. The philosophy here is Eli Friedman2009-04-282-7/+4
| | | | | | | | | | | | that if we're going to print an extension warning anyway, there's no point to changing behavior based on NoExtensions: it will only make error recovery worse. Note that this doesn't cause any behavior change because NoExtensions isn't used by the current front-end. I'm still considering what to do about the remaining use of NoExtensions in IdentifierTable.cpp. llvm-svn: 70273
* Lazily load the controlling macros for all of the headers known in theDouglas Gregor2009-04-251-6/+20
| | | | | | | | PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes us from reading 503 identifiers down to 37 and from 470 macros down to 4. It also results in an 8% performance improvement. llvm-svn: 70094
* Silence gcc warnings.Eli Friedman2009-04-251-2/+2
| | | | llvm-svn: 70086
* Add PCH support for #import.Steve Naroff2009-04-242-4/+10
| | | | llvm-svn: 69987
* fix rdar://6816766 - Crash with function-like macro test at end of directive.Chris Lattner2009-04-241-0/+2
| | | | llvm-svn: 69964
* simplification and speedupChris Lattner2009-04-241-1/+1
| | | | llvm-svn: 69963
* apply Eli's patch to fix PR4008, with a testcase. Thanks Eli!Chris Lattner2009-04-211-0/+8
| | | | llvm-svn: 69750
* improve MacroInfo to track the source range of the macro definition,Chris Lattner2009-04-211-1/+10
| | | | | | patch by Alexei Svitkine! llvm-svn: 69659
* add a preprocessor callback function for #undef, patch byChris Lattner2009-04-211-1/+5
| | | | | | Alexei Svitkine! llvm-svn: 69656
* Use an APInt of target int size to detect overflow while parsing multichars.Sanjiv Gupta2009-04-211-13/+18
| | | | | | So 'abc' on i16 platforms will warn but not on i32 platforms. llvm-svn: 69653
* fix the second half of PR4006 and rdar://6807000 by treatingChris Lattner2009-04-201-7/+11
| | | | | | | () as being either zero arguments or one empty argument depending on situation. llvm-svn: 69627
* Move the on-disk hash table code into its own header. No functionality change.Douglas Gregor2009-04-201-171/+2
| | | | llvm-svn: 69580
* implement "#pragma GCC diagnostic". Besides being a nice feature, thisChris Lattner2009-04-191-2/+79
| | | | | | | | | will let us test for multiple different warning modes in the same file in regression tests. This implements rdar://2362963, a 10-year old feature request :) llvm-svn: 69560
* Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't Chris Lattner2009-04-191-1/+2
| | | | | | | | | | support it. I don't know what evaluation method we use for complex arithmetic, so I don't know whether/if we should warn about use of CX_LIMITED_RANGE. This concludes my planned hacking on STDC pragmas, flame away :) llvm-svn: 69556
* diagnose invalid syntax of STDC pragmas.Chris Lattner2009-04-191-3/+40
| | | | llvm-svn: 69554
* reject invalid stuff in the STDC namespace.Chris Lattner2009-04-191-8/+8
| | | | llvm-svn: 69551
* stub out STDC #pragmas.Chris Lattner2009-04-191-0/+44
| | | | llvm-svn: 69550
* basic support for -Wunknown-pragmas, more coming.Chris Lattner2009-04-191-1/+4
| | | | llvm-svn: 69547
* move token paste poisoning diagnostics to after the instantiation locChris Lattner2009-04-191-11/+16
| | | | | | | for a token is set, this makes the diagnostic "expanded from stack" work for this diagnostic. Add a testcase for PR3918. llvm-svn: 69544
* Fix PR3918: Invalid use of __VA_ARGS__ not diagnosed,Chris Lattner2009-04-191-2/+13
| | | | | | | by rejecting invalid poisoned tokens in the token pasting path. llvm-svn: 69536
* Fix PR4006, incorrect handling of __VA_ARGS__ when it was the first tokenChris Lattner2009-04-191-9/+9
| | | | | | | in a function-like macro body. This has the added bonus of moving some function-like macro specific code out of the object-like macro codepath. llvm-svn: 69530
* Fix PR3917: the location of a #line directive is the location of the first _.Chris Lattner2009-04-181-0/+4
| | | | llvm-svn: 69485
* Change Preprocessor::AdvanceToTokenCharacter to stop atChris Lattner2009-04-181-12/+21
| | | | | | | | | | the first real character of a token. For example, advancing to byte 3 of foo\ bar should stop at the b, not the \. llvm-svn: 69484
* add a new Lexer::SkipEscapedNewLines method.Chris Lattner2009-04-181-0/+23
| | | | llvm-svn: 69483
* factor escape newline measuring out into its own helper function.Chris Lattner2009-04-181-40/+45
| | | | llvm-svn: 69482
OpenPOWER on IntegriCloud