contributing a Python class representation for C++ code to LLVM

I’ve been working on some python classes to simply represent C++ code. It’s build using the AST and libclang’s Python bindings:

https://github.com/jbcoe/clang_cpp_code_model

I’m using it to drive a very rudimentary code generator (It can build test mocks and basic C/C++/Python bindings):

https://github.com/jbcoe/C_API_generation

Are either of these projects of interest to the broader LLVM development community? I appreciate that a lot of work would be required, but I would be interested in contributing the code model (and potentially the generator) to the LLVM project.

regards,

Jonathan

Hi Jonathan,

This looks pretty useful.

I'd like to see parts of cppmodel.py adapted and added as tests to clang/bindings/python/tests/cindex. I only took a cursory look, but it seems that there may be a few things your code covers that our tests don't. E.g cindex.CursorKind.NAMESPACE.

I don't think pulling the interface-generator itself into clang is feasible due to the maintenance overhead. Have you thought about integrating it with swig?

thanks
vedant