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.