summaryrefslogtreecommitdiffstats
path: root/clang/Lex/Preprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Initial support for semantic analysis and AST building for StringExpr nodes.Chris Lattner2006-10-061-2/+2
| | | | llvm-svn: 38960
* Fix precedence problemChris Lattner2006-08-041-3/+3
| | | | llvm-svn: 38809
* Simplify implementation of varargs macros by adding the __VA_ARGS__ tokenChris Lattner2006-07-301-18/+4
| | | | | | to the formal argument list of a C99 varargs macro. llvm-svn: 38800
* The optimized case has to treat __VA_ARGS__ as an argument. This fixesChris Lattner2006-07-291-0/+5
| | | | | | test/Preprocessor/macro_rescan_varargs.c llvm-svn: 38795
* Implement support for #__VA_ARGS__Chris Lattner2006-07-291-1/+2
| | | | llvm-svn: 38791
* Implement comment saving mode: the -C and -CC options.Chris Lattner2006-07-291-0/+18
| | | | llvm-svn: 38783
* Implement the GNU comma swallowing extension. This implementsChris Lattner2006-07-291-1/+8
| | | | | | test/Preprocessor/macro_fn_comma_swallow.c llvm-svn: 38780
* Fix a bug in previous commitChris Lattner2006-07-291-1/+1
| | | | llvm-svn: 38774
* No need for explicit underscore anymore.Chris Lattner2006-07-291-1/+1
| | | | llvm-svn: 38773
* Poison and unpoison __VA_ARGS__ when appropriateChris Lattner2006-07-291-2/+15
| | | | llvm-svn: 38770
* If the varargs token is missing, add an empty argument to represent it. ThisChris Lattner2006-07-291-10/+9
| | | | | | fixes Preprocessor/macro_fn_varargs_named.c llvm-svn: 38769
* Implement C99 6.10.3.4p2, testcase here: Preprocessor/macro_disable3.c.Chris Lattner2006-07-271-3/+18
| | | | llvm-svn: 38760
* Change Preprocessor::ReadFunctionLikeMacroArgs to use a SmallVector to lexChris Lattner2006-07-261-3/+5
| | | | | | | | argument tokens into instead of a real vector. This avoids some malloc traffic in common cases. In an "abusive macro expansion" testcase, this reduced -Eonly time by 25%. llvm-svn: 38757
* Change MacroArgs to allocate space for the unexpanded tokens immediately afterChris Lattner2006-07-261-2/+2
| | | | | | | the MacroArgs object itself. This is a bit more efficient and will be even more so shortly. llvm-svn: 38756
* Implement a FIXME: don't copy token array into a token vector, instead, ↵Chris Lattner2006-07-261-2/+2
| | | | | | macroexpander should expand from an array directly. llvm-svn: 38754
* speed up a brutal macro-expansion torture test by about 30% (1.5 -> 1.0s)Chris Lattner2006-07-211-14/+25
| | | | | | | by turning vectors of vectors into a single vector, reducing pressure on malloc. This can still be improved. llvm-svn: 38753
* Add optimization for identifier##identifier -> identifier, the most common ↵Chris Lattner2006-07-201-1/+4
| | | | | | case of token pasting. llvm-svn: 38747
* Simplify "raw lexing mode" even further. Now the preprocessor is only calledChris Lattner2006-07-201-6/+1
| | | | | | | into when a hard error is found. This simplifies logic and eliminates the need for the preprocessor to know about raw mode. llvm-svn: 38746
* Simplify identifier lookup in raw mode, implementing ↵Chris Lattner2006-07-201-6/+3
| | | | | | Preprocessor/macro_fn_lparen_scan2.c. llvm-svn: 38744
* Move LexingRawMode handling of file EOF out of the preprocessor into theChris Lattner2006-07-191-13/+0
| | | | | | | | lexer. This makes more logical sense and also unbreaks the case when the lexer hasn't been pushed onto the PP include stack. This is the case when pasting identifiers. This patch implements macro_paste_bcpl_comment.c. llvm-svn: 38736
* Make end-of-file handling much less recursive. This reduces the worst caseChris Lattner2006-07-181-5/+8
| | | | | | stack depth sampled by shark from ~34 to ~17 frames when preprocessing <iostream>. llvm-svn: 38726
* Implement support for lexing from a pre-constructed token stream.Chris Lattner2006-07-161-11/+31
| | | | | | | | Use this support to implement function-like macro argument preexpansion. This implements test/Preprocessor/macro_fn_preexpand.c llvm-svn: 38724
* More changes from formals -> actuals.Chris Lattner2006-07-151-9/+9
| | | | llvm-svn: 38717
* Rename macroformalargs -> MacroArgs, as it represents the actual arguments,Chris Lattner2006-07-151-19/+19
| | | | | | not the formal arguments, to a macro. llvm-svn: 38716
* Eliminate the IdentifierInfo::IsMacroArg flag.Chris Lattner2006-07-151-11/+3
| | | | llvm-svn: 38715
* Change Lexer::Stringify to not add ""'s around the string.Chris Lattner2006-07-151-1/+1
| | | | llvm-svn: 38708
* Add an API so that external clients can create strings in the scratch buffer.Chris Lattner2006-07-141-9/+21
| | | | llvm-svn: 38706
* Move Preprocessor::isNextPPTokenLParen to Lexer::isNextPPTokenLParen, whereChris Lattner2006-07-111-33/+2
| | | | | | it more rightly belongs. llvm-svn: 38702
* Change Preprocessor::SkippingContents into Lexer::LexingRawMode. Raw modeChris Lattner2006-07-111-19/+12
| | | | | | | | | | is an intra-lexer property, not a inter-lexer property, so it makes sense for it to be define here. It also makes no sense for macros, and allows us to define it more carefully in the header. While I'm at it, improve comments and structuring in Lexer.h llvm-svn: 38701
* Fix a regression on Preprocessor/hash_space.cChris Lattner2006-07-111-2/+2
| | | | llvm-svn: 38700
* Implement "lparen scanning" for lexer buffers, by making "skipping lexing"Chris Lattner2006-07-111-41/+71
| | | | | | | completely reversible. This implements tests 3/4 of test/Preprocessor/macro_fn_lparen_scan.c llvm-svn: 38699
* ext-warn on empty macro arguments if in pre-c99 modeChris Lattner2006-07-111-2/+9
| | | | llvm-svn: 38697
* Implement scanning-for-( more correctly. This implementsChris Lattner2006-07-111-11/+53
| | | | | | | | | test/Preprocessor/macro_fn_lparen_scan.c, but is not yet complete. Add some FIXME's about missing diagnostics on empty macro args. Improve some comments. llvm-svn: 38694
* Only do an expensive walk over the entire identifier table if the diagnosticChris Lattner2006-07-101-2/+5
| | | | | | that needs it is enabled. llvm-svn: 38690
* Trivially expand macros like:Chris Lattner2006-07-091-4/+7
| | | | | | #define ENOMEMORYFORYOU ENOMEMORYFORYOU llvm-svn: 38687
* Make trivial expansion detection more aggressive. Trivially expand macrosChris Lattner2006-07-091-9/+30
| | | | | | like: #define IS_BLAH() 1 llvm-svn: 38686
* Read, remember, and validate the arguments provided the a function-styleChris Lattner2006-07-091-38/+185
| | | | | | macro invocation. llvm-svn: 38685
* Diagnose C99 6.10.3.2p1Chris Lattner2006-07-081-7/+28
| | | | llvm-svn: 38683
* Add identifiers for macro arguments to MacroInfo, check for duplicates,Chris Lattner2006-07-081-9/+28
| | | | | | enhance macro equality testing to verify argument lists match. llvm-svn: 38682
* Start reading/validating the argument list for a function-like macro.Chris Lattner2006-07-081-4/+103
| | | | llvm-svn: 38681
* Implement checking for macro equality, C99 6.10.3.2Chris Lattner2006-07-081-2/+2
| | | | llvm-svn: 38680
* add infrastructure for warning if redef'd macro bodies differ, but don'tChris Lattner2006-07-081-7/+14
| | | | | | | | fully implement it. Fix warning on #define __LINE__ to warn about redefinition, not #undef. llvm-svn: 38679
* Warn about __VA_ARGS__ when used outside of a macro expansionChris Lattner2006-07-061-2/+10
| | | | llvm-svn: 38678
* Diagnose erroneous macro definitions where a ## operator is at the start/end ↵Chris Lattner2006-07-061-2/+22
| | | | | | of the macro llvm-svn: 38677
* Add a fast-path in getSpelling for identifiers.Chris Lattner2006-07-041-2/+8
| | | | llvm-svn: 38672
* Change the Preprocessor::getSpelling interface to let it be zero-copy inChris Lattner2006-07-041-9/+12
| | | | | | the common case. llvm-svn: 38671
* Rename IdentifierTokenInfo -> IdentifierInfo.Chris Lattner2006-07-041-31/+31
| | | | llvm-svn: 38650
* Eliminate MultipleIncludeOpt::ReadDirective and all calls to it. Any directivesChris Lattner2006-07-041-21/+14
| | | | | | | | | that are lexed are made up of tokens, so the calls are just ugly and redundant. Hook up the MIOpt for the #if case. PPCExpressions doesn't currently implement the hook though, so we still don't handle #if !defined(X) with the MIOpt. llvm-svn: 38649
* Implement the multiple-include file optimization.Chris Lattner2006-07-041-3/+16
| | | | llvm-svn: 38647
* Implement the automaton for recognizing files with controlling macros.Chris Lattner2006-07-041-12/+70
| | | | llvm-svn: 38646
OpenPOWER on IntegriCloud