Commit Graph

57 Commits

Author SHA1 Message Date
Chris Lattner c673f905d8 Implement the __TIME__ and __DATE__ builtin macros.
llvm-svn: 38597
2006-06-30 06:10:41 +00:00
Chris Lattner 67b07cb6fe Implement Preprocessor/macro_expandloc.c by giving the optimized macro
expansion case a correct source location.

llvm-svn: 38580
2006-06-26 02:03:42 +00:00
Chris Lattner 30709b038d Implement a new type of FileID: FileIDInfo::MacroExpansion. For tokens that
came from a macro expansion, this allows us to keep track of both where the
character data came from and where the logical position of the token is (at
the expansion site).  This implements Preprocessor/indent_macro.c, and
reduces the number of cpp iostream -E diffs vs GCC from 2589 to 2297.

llvm-svn: 38557
2006-06-21 03:01:55 +00:00
Chris Lattner 50b497e072 Rename LexerToken::getSourceLocation -> getLocation
llvm-svn: 38553
2006-06-18 16:32:35 +00:00
Chris Lattner d01e291332 Make a fundamental change to the way we represent the location of LexerToken's.
Now, instead of keeping a pointer to the start of the token in memory, we keep the
start of the token as a SourceLocation node.  This means that each LexerToken knows
the full include stack it was created with, and means that the LexerToken isn't
reliant on a "CurLexer" member to be around (lexer tokens would previously go out of
scope when their lexers were deallocated).

This simplifies several things, and forces good cleanup elsewhere.  Now the
Preprocessor is the one that knows how to dump tokens/macros and is the one that
knows how to get the spelling of a token (it has all the context).

llvm-svn: 38551
2006-06-18 16:22:51 +00:00
Chris Lattner cb28334ea4 Remove manual conditional error handling code.
llvm-svn: 38540
2006-06-18 06:48:37 +00:00
Chris Lattner 22eb972f38 Initial checkin of c-language parser
llvm-svn: 38539
2006-06-18 05:43:12 +00:00