<div dir="ltr">Hello,<br><br>I'd like to find the best method of adding a transformation pass that uses the AST and the CFG. Is there a template or a how-to on this? <br><br>My goal in summary is to:<br><br>1. Determine declarations of certain new statements (beginD and endD) in the C source (without changing the front-end; they are simple macros). <br>
2. Replace the statements with certain macros with additional labels. <br>4. Output the changed C file. <br><br>I've successfully tried the following:<br><br>- Added an Analysis consumer, but I noticed that this Analysis consumer method is invoked twice; once for each function in the C source. I'd like to have access to the full Analysis and then walk it using walker methods.<br>
- Added an ASTConsumer, but again, this is invoked twice. Once per function. <br><br>Your suggestions would be much appreciated.<br><br>~ Hiren<br><br><br></div>