[cfe-dev] Statement replacement

John Stratton john at multicorewareinc.com
Tue Jan 22 06:55:02 PST 2013


I work with clang as a source-to-source translator myself, and typically
use its Rewriter class to modify statements in the clang buffer
representing the original code.  At the end of the translation unit I
just print out the “rewritten text” as reported by the Rewriter.

--John

=======================
John Stratton, Ph.D.
Senior Architect
MulticoreWare

 *From:* Miguel Aguilar <miguel.aguilar at ice.rwth-aachen.de>
*Sent:* January 22, 2013 3:45 AM
*To:* cfe-dev at cs.uiuc.edu
*Subject:* [cfe-dev] Statement replacement

Hi,

I would like to know the approaches that clang offers in order to replace
one statement to another within the body of a C++ method.

I don't want to change the original code but just the body of the method in
the memory and then from that emit a new source file.

Thanks,

Miguel
______________________________**_________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu
http://lists.cs.uiuc.edu/**mailman/listinfo/cfe-dev<http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130122/e949f775/attachment.html>


More information about the cfe-dev mailing list