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:<div>
<br></div><div>- 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:</div><div><div><a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110926/046899.html">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110926/046899.html</a></div>
</div><div>Is this being worked on?</div><div><br></div><div>- 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:</div>
<div><br></div><div>---</div><div><div>typedef int (*noproto_t)();</div><div>typedef int (*proto_t)(int x);</div><div>typedef int (*variadic_t)(int x, ...);</div><div><br></div><div>struct bar {</div><div> int (*noproto)();</div>
<div> int (*proto)(int x);</div><div> int (*variadic)(int x, ...);</div><div>};</div></div><div>---</div><div><br></div><div>The noproto_t, proto_t, and variadic_t typedef types show up as pointers to FunctionNoProto and FunctionProto types as you'd expect, but the types of the noproto, proto, and variadic fields of the bar struct show up as pointers to Unexposed (although the underlying function type information appears to still be accessible). Is this a bug or intended behavior?</div>
<div><br></div><div>- To be able to accurately bind to some APIs I need to be able to know the __asm__("symbolname"), if any. It looks like this currently appears as an UnexposedAttr cursor kind during traversal. Is there any way to access the asm name through that cursor? I also couldn't find any immediately obvious way to visit calling convention attributes (__attribute__((stdcall)), __attribute__((naked)) etc.) Am I missing something there?</div>
<div><br></div><div>That's all for now. Thanks for the help!</div><div><br></div><div>-Joe</div>