importing clang ast

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

importing clang ast

Fangrui Song via cfe-dev
Hello!

I am importing the Clang AST into Cppcheck. I assume this is something
you want. That other tools reuse Clang.

What approach would you recommend?

For information, I started with libclang. That does not provide all
AST information, for instance you run into UnexposedExpr whenever
there are implicit casts. Would anybody be interested to improve
libclang so that could be used?

I am now trying to import "clang -cc1 -ast-dump" output. That is
basically not too difficult to parse and the ast has much more
information. But well it does not feel like the ideal solution.

I have the feeling that the ast-dump could be tweaked somewhat to be
more import-friendly. If the tweaks are minor maybe it would be ok to
reuse the same code for "debug" output and a "app" output. With reuse
I feel that it would be well-maintained.

Best regards,
Daniel Marjamäki
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev