[LLVMdev] [un]wrapping llvm:DITypeRef

Rodney M. Bates
Sat, 25 Jul 2015 22:44:07 -0000

In trying to write a C binding for DIBuilder of llvm 3.6.1, I can't see a
way to unwrap
llvm::DITypeRef, declared in include/llvm/IR/DebugInfo.h.  This is a class with
one
data member, a pointer to Metadata.

If I try to make my C type a struct with one pointer, I can't cast it to
DITypeRef.
If I try to go inside the classes and use the pointer, I can cast, but can't
construct
a DITypeRef when unwrapping, as both its pointer field 'Val' and the
constructor are
private.