[cfe-dev] building Code from clangAST

Gábor Kozár kozargabor at gmail.com
Tue May 21 09:52:56 PDT 2013


Hi,

I'm not really clear on why would you need to obfuscate C++ code, but check
out clang-format (http://clang.llvm.org/docs/ClangFormat.html), might help
you with what you need.

As far as I know there is no direct way to write the AST back to C++ code,
and so I think you'll need to make do with the Rewriter and/or
tooling::Replacement classes. See the doxygen documentation for details.

Gabor


2013/5/21 saman parser <esmi.saman at gmail.com>

> Hello All
> I'm new in clang and llvm please help me.
> I'm writing a c++ code obfuscator. I'm applying some data and control
> obfuscations.
> So I know how to parse code and build AST tree.. but I don't know how to
> convert my modified AST tree to code again. can anyone write a sample code?
> clang is a jungle of code and it's hard to find a way by just reading
> codes.
> thanks in advanced..
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/building-Code-from-clangAST-tp4032234.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> 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/20130521/59b05693/attachment.html>


More information about the cfe-dev mailing list