Missing features in libclang: complex element type, "unexposed" function pointer types in structs, __asm__ and calling convention attributes

Hi everyone. I’m trying to write an FFI bindings generator using the cursor visitor functionality in libclang. Overall the API is nice and clean, but it looks like it’s missing a few pieces. I wanted to ask whether these were on anyone’s to-do list before looking into adding them myself, and check that I’m not just doing it wrong. In particular, I’m missing the following functionality:

  • There’s no way to get the element type from a Complex-kind CXType. There was a thread about incorporating this functionality by generalizing the clang_getArrayElementType function:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110926/046899.html

Is this being worked on?

  • Function pointer fields in structs or unions show up as pointers to “Unexposed”-kind CXTypes, although you can still visit their parameter child nodes and access the return type from clang_getResultType. Given this C snippet: