[cfe-dev] how can I insert something into another "include" file

Rambo hunanlwm at sina.cn
Thu Nov 21 23:59:18 PST 2013


Hi,
I want to insert something into original files for transformation.Now I can
do it in a single file with Rewriter class,but have some problems in
multiple files.for example,I want to insert some codes in the bold area as
follows:
test.c
//#include<stdio.h>
int main()
{
  char ss[]="ASSD";
  printf("%c\n",*ss[1]*);
  #include"add.t"
  return 0;
} 
add.t
printf("%c\n",*ss[1]*);

I can insert my codes into test.c with the help of Rewriter class,but add.t
is missing.As long as i insert in test.c, the add.t is also inserted,that is
my finally target.I can get both the location of the first ss[1] and the
second ss[1],and i also know the first one is in test.c and the second is in
add.t by some codes. but they don't have some help in achieving my goal.
Anybody have ideas in dealing with it by Rewriter class.I was curious about
how rewriter class can work in single file,but don't in multiple
files.Thanks for your help!

Rambo




--
View this message in context: http://clang-developers.42468.n3.nabble.com/how-can-I-insert-something-into-another-include-file-tp4036243.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list