<div>Hi:</div><div>Frontend noob here. I was attempting to play around with libclang and build another IR Module at transform stage.</div><div>Currently the solution I could think of is like this:</div><div>- Use __attribute__((constructor)) to obtain raw arguments passed to CFE</div><div>- Somehow use the arguments to build a CompilerInstance object</div><div>- Run the frontend action EmitLLVMOnly and extract the build module</div><div><br></div><div>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.</div><div><br></div><div>Zhang</div><div><includetail><!--<![endif]--></includetail></div>