]> granicus.if.org Git - clang/commit
Implement -rewrite-macros, which is a crazy macro expander that expands
authorChris Lattner <sabre@nondot.org>
Sat, 10 May 2008 00:02:33 +0000 (00:02 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 May 2008 00:02:33 +0000 (00:02 +0000)
commitec9215604073ccd79f26bbd2650dd691d8e7df8d
tree1c5ac0ac1b021dac804bc2ee3eafb934906647ab
parent0e470a5326ccf2f6a7c3d12b2aa54a7af2292837
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
----

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50925 91177308-0d34-0410-b5e6-96231b3b80d8
Driver/RewriteMacros.cpp