Commit Graph

8 Commits

Author SHA1 Message Date
Ted Kremenek e4d923383a Fix typo.
llvm-svn: 54774
2008-08-14 03:45:07 +00:00
Chris Lattner f08932928c comment out #pragma mark and #warning directives.
llvm-svn: 54020
2008-07-25 16:37:06 +00:00
Chris Lattner b9c34de5c4 rewrite handling of the raw token stream in -rewrite-macros to lex
everything up front into a vector.  This makes it easier to scan around
the stream when needed.

llvm-svn: 54019
2008-07-25 16:29:12 +00:00
Chris Lattner f4fee9e1e5 make rewrite macros insert a space when commenting out macros where the token didn't
lead with a space.

llvm-svn: 51896
2008-06-03 06:10:17 +00:00
Chris Lattner d3f3231a07 Two identifiers are not the same unless they have the same identifier info.
llvm-svn: 51827
2008-05-31 22:01:01 +00:00
Chris Lattner 14196c099f Implement -rewrite-macros, which is a crazy macro expander that expands
macros but doesn't expand #includes, remove comments, remove #defines
etc.

For example:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x

bbaa  bbaa

#if 1 
funclike("gar")
foo /*blah*/  bar
bar
#endif

#if 0
funclike()
#endif
----


rewrites to:

----
#include <stdio.h>

#define bbaa
#define funclike(x) x "a" x "b" x 

/*bbaa  bbaa*/

#if 1
 "gar" "a" "gar" "b" "gar"/*funclike*//*("gar")*/
foo /*blah*/  bar
bar
#endif

#if 0
/*funclike()*/
#endif
----

llvm-svn: 50925
2008-05-10 00:02:33 +00:00
Chris Lattner 664ef65981 make #if 0 code compile, even though it still isn't very useful.
llvm-svn: 50920
2008-05-09 22:43:24 +00:00
Chris Lattner 3c04ff00c2 start implementation of a macro rewriter, this is currently just stubbed out.
llvm-svn: 50845
2008-05-08 06:52:13 +00:00