[cfe-dev] "Run 3.3 based source to source rewriter with 3.1 based Clang"

Welson Sun welson.sun at gmail.com
Fri Jan 3 17:26:01 PST 2014


Basically I need a source to source rewriter. Since LibTooling is available
since v3.3, so the program has to be compiled and linked with v3.3
clang/llvm.

For some reason, I have to use the v3.1 Clang as the frontend of the
rewriter tool.

The intended flow is that: The v3.1 based Clang is used to compile the
source code, annotating the FunctionDecl node based on some in-house pragma
handling, the rewriter checks the annotation and do the rewrite accordingly.

The current problem is that the VisitDecl(Decl* d) function cannot find
that FunctionDecl's annotation, although if I run the Clang itself, I have
added code in codegen to verify that the FunctionDecl has been properly
annotated.

I am wondering if this kind of mixing of Clang frontend version (3.1) with
source rewriter version (3.3) is supposed to work. Well, my another source
to source rewriter tool uses the same version mix and works fine, but that
one doesn't rely on extra annotation of the FunctionDecl node.


Thanks,
Welson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140103/3b4ce45f/attachment.html>


More information about the cfe-dev mailing list