[LLVMdev] How to access Debug Type Information (from Cbackend)

Alexander Herz alexander.herz at mytum.de
Fri Aug 6 03:59:59 PDT 2010


I'm trying to recover the inheritance relations for a class type (so a 
list of base classes) from a llvm ir file generated via compiling some 
cpp file using clang.

I have access to the TypeSymbolTable and have found the class type I 
want to know the base classes for in the table.
How do I go about extracting this (debug) information?

I'm stuck here:

     if(StructType* pST=dyn_cast<StructType*>(I)) //check it's a struct 
(or class)
         LLVMContext c;
         pST->getMetadataTy(c); //get the context

         //how do I get the debug info
         //how do I enumerate the base classes??
         //MDNode *N=c.getMDKindID("dbg");

I spend some time looking at the doxygen docu etc but didn't find a 
useful hint.


More information about the llvm-dev mailing list