Transforming the Clang AST into an AST in other languages

98 Views Asked by At

I want to build a tool that can automatically transform the Clang AST into an equivalent AST in other languages (MLIR). I have some experiences with LLVM passes, but never directly played with Clang.

I wonder what is the best way to do that. One thing I can think of is to dump the Clang AST into a file and read back in a pass to construct another AST.

Can this be done within Clang itself and output an AST in the transformed language? If so, is there any tutorial I can start with?

Thank you very much.

0

There are 0 best solutions below