I would like to do transformations on AST of a c program but I need to have access to all ASTs created for the program to do right changes. LLVM processes one translation unit at a time and because of it, I do not have access to AST of all the translation units at the same time. Do you have any suggestion how I can access all the ASTs created for a program, do analysis on the ASTs and do modifications on the ASTs?
As a summary:
- I need to have access to ASTs of the program at the same time.
- Do analysis on ASTs.
- Modify ASTs based on my analysis and create llvm IR from modified ASTs.