Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Rename MacroExpander.cpp/h -> TokenLexer.cpp/h | Chris Lattner | 2008-03-09 | 1 | -695/+0 |
| | | | | llvm-svn: 48072 | ||||
* | rename the MacroExpander class to TokenLexer. It handles both | Chris Lattner | 2008-03-09 | 1 | -18/+19 |
| | | | | | | token streams and macro lexing, so a more generic name is useful. llvm-svn: 48071 | ||||
* | rename MacroTokens -> Tokens. When this is a token stream, there is no macro | Chris Lattner | 2008-03-09 | 1 | -30/+30 |
| | | | | | | involved. llvm-svn: 48070 | ||||
* | Implement support for the extremely atrocious MS /##/ extension, | Chris Lattner | 2008-02-07 | 1 | -6/+38 |
| | | | | | | | which pastes together a comment. This is only enabled with -fms-extensions of course. llvm-svn: 46845 | ||||
* | Fix a bug where we would incorrectly emit a "cannot paste" error | Chris Lattner | 2008-01-29 | 1 | -1/+16 |
| | | | | | | | message when handling the GNU ", ## __VA_ARGS__" extension. While I'm at it, flag uses of this as extensions. llvm-svn: 46503 | ||||
* | Don't attribute in file headers anymore. See llvmdev for the | Chris Lattner | 2007-12-29 | 1 | -2/+2 |
| | | | | | | discussion of this change. llvm-svn: 45410 | ||||
* | Switch lexer/pp over to new Token::is/isNot api | Chris Lattner | 2007-10-09 | 1 | -25/+24 |
| | | | | llvm-svn: 42799 | ||||
* | improve layering: | Chris Lattner | 2007-10-07 | 1 | -4/+5 |
| | | | | | | | | | Now instead of IdentifierInfo knowing anything about MacroInfo, only the preprocessor knows. This makes MacroInfo truly private to the Lex library (and its direct clients) instead of being accessed in the Basic library. llvm-svn: 42727 | ||||
* | Fix a really subtle bug in the macro expander caching code, where | Chris Lattner | 2007-07-22 | 1 | -1/+6 |
| | | | | | | | redefinition of a macro could cause invalid memory to be deleted. Found preprocessing 253.perlbmk. llvm-svn: 40380 | ||||
* | At one point there were going to be lexer and parser tokens. | Chris Lattner | 2007-07-20 | 1 | -40/+40 |
| | | | | | | | Since that point is now long gone, we should rename LexerToken to Token, as it is the only kind of token we have. llvm-svn: 40105 | ||||
* | simplify the lexer ctor to take a SLoc instead of a sloc and a redundant ↵ | Chris Lattner | 2007-07-20 | 1 | -6/+1 |
| | | | | | | buffer*. llvm-svn: 40104 | ||||
* | Reimplement SourceLocation. Instead of having a | Chris Lattner | 2007-07-20 | 1 | -1/+2 |
| | | | | | | | | | | | | | | | | | fileid/offset pair, it now contains a bit discriminating between mapped locations and file locations. This separates the tables for macros and files in SourceManager, and allows better separation of concepts in the rest of the compiler. This allows us to have *many* macro instantiations before running out of 'addressing space'. This is also more efficient, because testing whether something is a macro expansion is now a bit test instead of a table lookup (which also used to require having a srcmgr around, now it doesn't). This is fully functional, but there are several refinements and optimizations left. llvm-svn: 40103 | ||||
* | Fix a stringizing bug that Neil noticed. We should preprocess this: | Chris Lattner | 2007-07-19 | 1 | -1/+1 |
| | | | | | | | | | | #define t(x) #x t(a c) to "a c", not "ac". llvm-svn: 40060 | ||||
* | remove obsolete comment. | Chris Lattner | 2007-07-15 | 1 | -3/+0 |
| | | | | llvm-svn: 39868 | ||||
* | Change SourceManager::getInstantiationLoc to take virtual locations, doing its | Chris Lattner | 2007-07-15 | 1 | -2/+2 |
| | | | | | | virtual->physical mapping explicitly. llvm-svn: 39867 | ||||
* | Cache macro expander objects to avoid thrashing malloc in heavy expansion ↵ | Chris Lattner | 2007-07-15 | 1 | -14/+27 |
| | | | | | | | | | situations. This doesn't significantly improve carbon.h, but it does speed up INPUTS/macro_pounder_obj.c by 48% llvm-svn: 39864 | ||||
* | expose an iterator interface to getReplacementTokens instead of the ↵ | Chris Lattner | 2007-07-14 | 1 | -3/+3 |
| | | | | | | datastructure itself. llvm-svn: 39860 | ||||
* | Finally bite the bullet and make the major change: split the clang namespace | Chris Lattner | 2007-06-15 | 1 | -3/+2 |
| | | | | | | | | | | | | | out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659 | ||||
* | implement FIXME: replace use of alloca with use of SmallVector. | Chris Lattner | 2006-11-03 | 1 | -11/+13 |
| | | | | llvm-svn: 39102 | ||||
* | Export the ASTBuilder class from the AST module. | Chris Lattner | 2006-11-03 | 1 | -0/+1 |
| | | | | llvm-svn: 39095 | ||||
* | Rename LexerToken methods to be more consistent. | Chris Lattner | 2006-10-14 | 1 | -19/+19 |
| | | | | llvm-svn: 38969 | ||||
* | Initial support for semantic analysis and AST building for StringExpr nodes. | Chris Lattner | 2006-10-06 | 1 | -2/+3 |
| | | | | llvm-svn: 38960 | ||||
* | Simplify implementation of varargs macros by adding the __VA_ARGS__ token | Chris Lattner | 2006-07-30 | 1 | -24/+11 |
| | | | | | | to the formal argument list of a C99 varargs macro. llvm-svn: 38800 | ||||
* | Fix precedence bug | Chris Lattner | 2006-07-29 | 1 | -1/+1 |
| | | | | llvm-svn: 38793 | ||||
* | Implement support for #__VA_ARGS__ | Chris Lattner | 2006-07-29 | 1 | -1/+7 |
| | | | | llvm-svn: 38791 | ||||
* | Fix a crash on Preprocessor/macro_paste_none.c | Chris Lattner | 2006-07-29 | 1 | -1/+2 |
| | | | | llvm-svn: 38787 | ||||
* | Implement the GNU comma swallowing extension. This implements | Chris Lattner | 2006-07-29 | 1 | -4/+13 |
| | | | | | | test/Preprocessor/macro_fn_comma_swallow.c llvm-svn: 38780 | ||||
* | Improve placemarker handling, implementing Preprocessor/macro_fn_placemarker.c | Chris Lattner | 2006-07-29 | 1 | -2/+30 |
| | | | | llvm-svn: 38778 | ||||
* | Implement support for __VA_ARGS__, allowing ↵ | Chris Lattner | 2006-07-29 | 1 | -3/+11 |
| | | | | | | | | test/Preprocessor/macro_fn_varargs_iso.c to pass. llvm-svn: 38776 | ||||
* | Use a continue to avoid indentation of a bunch of code | Chris Lattner | 2006-07-28 | 1 | -72/+72 |
| | | | | llvm-svn: 38762 | ||||
* | Implement pasting of arguments that expand to no tokens. This handles the | Chris Lattner | 2006-07-28 | 1 | -3/+17 |
| | | | | | | C99 "placemarker" concept. llvm-svn: 38761 | ||||
* | Switch ExpandFunctionArguments to use a smallvector instead of a vector, | Chris Lattner | 2006-07-27 | 1 | -4/+4 |
| | | | | | | speeding up my macro expansion torture test from .75s to .5s (33%!) llvm-svn: 38758 | ||||
* | Change Preprocessor::ReadFunctionLikeMacroArgs to use a SmallVector to lex | Chris Lattner | 2006-07-26 | 1 | -3/+3 |
| | | | | | | | | 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 after | Chris Lattner | 2006-07-26 | 1 | -9/+36 |
| | | | | | | | the MacroArgs object itself. This is a bit more efficient and will be even more so shortly. llvm-svn: 38756 | ||||
* | Add a new getArgLength method and refactor some code to use it | Chris Lattner | 2006-07-26 | 1 | -13/+23 |
| | | | | llvm-svn: 38755 | ||||
* | Implement a FIXME: don't copy token array into a token vector, instead, ↵ | Chris Lattner | 2006-07-26 | 1 | -29/+28 |
| | | | | | | 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 Lattner | 2006-07-21 | 1 | -55/+60 |
| | | | | | | | by turning vectors of vectors into a single vector, reducing pressure on malloc. This can still be improved. llvm-svn: 38753 | ||||
* | fix obvious bug that caused Preprocessor/macro_paste_bad.c to fail. | Chris Lattner | 2006-07-20 | 1 | -1/+1 |
| | | | | llvm-svn: 38748 | ||||
* | Add optimization for identifier##identifier -> identifier, the most common ↵ | Chris Lattner | 2006-07-20 | 1 | -2/+11 |
| | | | | | | case of token pasting. llvm-svn: 38747 | ||||
* | Simplify identifier lookup in raw mode, implementing ↵ | Chris Lattner | 2006-07-20 | 1 | -0/+9 |
| | | | | | | Preprocessor/macro_fn_lparen_scan2.c. llvm-svn: 38744 | ||||
* | Avoid testing / ## * in the lexer. This will cause an unhelpful error message | Chris Lattner | 2006-07-19 | 1 | -30/+35 |
| | | | | | | to be emitted from the lexer. This fixes macro_paste_c_block_comment.c llvm-svn: 38737 | ||||
* | Fix test/Preprocessor/macro_paste_spacing.c | Chris Lattner | 2006-07-19 | 1 | -1/+5 |
| | | | | llvm-svn: 38734 | ||||
* | Implement basic token pasting (## operator). This implements | Chris Lattner | 2006-07-19 | 1 | -0/+99 |
| | | | | | | | test/Preprocessor/macro_paste_simple.c and macro_paste_bad.c. There are several known bugs still. llvm-svn: 38733 | ||||
* | Handle really simple expansion of ## formals. Do not handle the empty case | Chris Lattner | 2006-07-19 | 1 | -5/+14 |
| | | | | | | yet though. llvm-svn: 38729 | ||||
* | Make end-of-file handling much less recursive. This reduces the worst case | Chris Lattner | 2006-07-18 | 1 | -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 Lattner | 2006-07-16 | 1 | -19/+91 |
| | | | | | | | | Use this support to implement function-like macro argument preexpansion. This implements test/Preprocessor/macro_fn_preexpand.c llvm-svn: 38724 | ||||
* | Implement basic argument substitution. This implements | Chris Lattner | 2006-07-15 | 1 | -0/+67 |
| | | | | | | test/Preprocessor/macro_fn_disable_expand.c llvm-svn: 38720 | ||||
* | Clarify assertion | Chris Lattner | 2006-07-15 | 1 | -2/+2 |
| | | | | llvm-svn: 38718 | ||||
* | More changes from formals -> actuals. | Chris Lattner | 2006-07-15 | 1 | -7/+5 |
| | | | | llvm-svn: 38717 | ||||
* | Rename macroformalargs -> MacroArgs, as it represents the actual arguments, | Chris Lattner | 2006-07-15 | 1 | -15/+37 |
| | | | | | | not the formal arguments, to a macro. llvm-svn: 38716 |