Adding the some static buffer content to the beginning and end of C file .

Hi All,

I'm new to Lex/Parser code of Clang , we are trying to append some
static buffer to the beginning and end of every C file we open for
compilation and investigating the same, how we do?

Any reference or hints from experts ,how we can do , will be
appreciated and save our time a lot .

Thank you

Do you mean something like:

cat before.c > temp.c

cat sourcefile.c >> temp.c

cat after.c >> temp.c

clang temp.c …

or something that does that also to header files included by the sourcefile.c ?

I’m not sure I know the answer, but I think the distinction is important to be able to answer this.

(I’m reasonably sure it’s not really Lex/Parser that is the parts you want to look at, SourceFileManager or something around there is more likely to be your area of interest - I could be heading in the wrong direction tho’ - I only know scattered parts of how clang works)