summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* remove unneeded scopes.Chris Lattner2009-04-181-45/+41
| | | | llvm-svn: 69481
* fix typoChris Lattner2009-04-181-1/+1
| | | | llvm-svn: 69479
* more fun with line markers: the digit string is required to be interpretedChris Lattner2009-04-181-23/+23
| | | | | | | as decimal, even if it starts with 0. Also, since things like 0x1 are completely illegal, don't even bother using numericliteralparser for them. llvm-svn: 69454
* fix PR3927 by being more careful about the pp test for identifier.Chris Lattner2009-04-181-1/+1
| | | | llvm-svn: 69423
* second half of PR3940: #line requires simple digit sequence.Chris Lattner2009-04-181-1/+2
| | | | llvm-svn: 69422
* enforce requirements imposed by C90 6.8 TC1, fixing PR3919.Chris Lattner2009-04-181-11/+26
| | | | llvm-svn: 69415
* Fix PR3938 by taking into account C99 6.10p4.Chris Lattner2009-04-181-1/+1
| | | | llvm-svn: 69413
* Substantially restructure function-like macro argument parsing.Chris Lattner2009-04-181-36/+56
| | | | | | | | | Highlights: PP::isNextPPTokenLParen() no longer eats the ( when present. We now simplify slightly the logic parsing macro arguments. We now handle PR3937 and other related cases correctly. llvm-svn: 69411
* Fix two problems from PR3916, and one problem I noticed while hackingChris Lattner2009-04-172-7/+10
| | | | | | on the code. llvm-svn: 69404
* implement PR3940: #line numbers not fully checkedChris Lattner2009-04-171-0/+5
| | | | llvm-svn: 69403
* #line is allowed to have macros that expand to nothing after them.Chris Lattner2009-04-171-7/+13
| | | | llvm-svn: 69401
* Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner2009-04-142-7/+3
| | | | | | | | | | | | | | | | | | This allows it to accurately measure tokens, so that we get: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~~^ instead of the woefully inferior: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ Most of this is just plumbing to push the reference around. llvm-svn: 69099
* temporarily revert r69046Chris Lattner2009-04-141-4/+4
| | | | llvm-svn: 69054
* Literal value calculation isn't likely to overflow on targets having int as ↵Sanjiv Gupta2009-04-141-4/+4
| | | | | | 32 or less. Fixing the assert as it otherwise triggers for PIC16 which as i16 as int. llvm-svn: 69046
* Offer a fixit hint for our warning about tokens at the end of a directive:Chris Lattner2009-04-141-1/+7
| | | | | | | | | | | | | t.c:3:8: warning: extra tokens at end of #endif directive #endif foo ^ // Don't do this in strict-C89 mode because bcpl comments aren't valid there, and it is too much trouble to analyze whether C block comments are safe. llvm-svn: 69024
* Fix the #import / #include_next "extra tokens at end of #foo directive" Chris Lattner2009-04-142-11/+11
| | | | | | | Warning to properly report that it is an import/include_next instead of claiming it is a #include. llvm-svn: 69023
* Fix assertion failure in PTH when tokens followed a closing #endif.Daniel Dunbar2009-04-131-3/+2
| | | | | | | | | - Ted, please check. - Missing test case because PTH won't reliably cache the tokens in a test case. *cough* llvm-svn: 68966
* implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310Chris Lattner2009-04-132-1/+10
| | | | llvm-svn: 68933
* add a ppcallback hook for macro definitions.Chris Lattner2009-04-121-0/+4
| | | | llvm-svn: 68883
* Compare the predefines buffer in the PCH file with the predefinesDouglas Gregor2009-04-101-4/+0
| | | | | | | | | | | | | | | buffer generated for the current translation unit. If they are different, complain and then ignore the PCH file. This effectively checks for all compilation options that somehow would affect preprocessor state (-D, -U, -include, the dreaded -imacros, etc.). When we do accept the PCH file, throw away the contents of the predefines buffer rather than parsing them, since all of the results of that parsing are already stored in the PCH file. This eliminates the ugliness with the redefinition of __builtin_va_list, among other things. llvm-svn: 68838
* do a dance with predefines, and finally enable reading of macros fromChris Lattner2009-04-101-1/+1
| | | | | | | PCH. This works now, except for limitations not being able to do things with identifiers. The basic example in the testcase works though. llvm-svn: 68832
* move a bunch of code for initializing the predefines buffer out of ↵Chris Lattner2009-04-101-335/+1
| | | | | | | | | | Preprocessor.cpp into clang-cc.cpp. This makes it so clang-cc constructs the *entire* predefines buffer, not just half of it. A bonus of this is that we get to kill a copy of DefineBuiltinMacro. llvm-svn: 68830
* simplify code.Chris Lattner2009-04-101-6/+4
| | | | llvm-svn: 68825
* PCH serialization/deserialization of the source manager. With thisDouglas Gregor2009-04-101-0/+4
| | | | | | | | | | | | improvement, source locations read from the PCH file will properly resolve to the source files that were used to build the PCH file itself. Once we have the preprocessor state stored in the PCH file, source locations that refer to macro instantiations that occur in the PCH file should have the appropriate instantiation information. llvm-svn: 68758
* finish the implementation of -imacros. The driver still needs to be hooked up.Chris Lattner2009-04-081-4/+10
| | | | llvm-svn: 68640
* reject the #__include_macros directive unless it comes from the Chris Lattner2009-04-081-1/+20
| | | | | | predefines buffer. llvm-svn: 68627
OpenPOWER on IntegriCloud