Using libclang to build an LLVM Module from a Transform Pass?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using libclang to build an LLVM Module from a Transform Pass?

Yaron Keren via cfe-dev
Hi:
Frontend noob here. I was attempting to play around with libclang and build another IR Module at transform stage.
Currently the solution I could think of is like this:
- Use __attribute__((constructor)) to obtain raw arguments passed to CFE
- Somehow use the arguments to build a CompilerInstance object
- Run the frontend action EmitLLVMOnly and extract the build module

I'm not sure if this is the correct/easiest way to go or I screwed up something fundamentally. And if is the way to go, I failed to find any method to clean up the all the frontend input files and leave everything else intact. Any feedback is welcome.

Zhang

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev