How to get the debug information for an LLVM IR type?

Thank you, Duncan. Then how about the composite types, especially struct and class types? I think they are more distinguishable from each other.

Pei Wang

> Hi Pei Wang,

>><i>  Hi,
</i>>>  ><i>>  I am now trying to do some code analysis and need to get the debug information
</i>><i>>  of the LLVM IR type encountered in the bitcode.
> I don't think this is going to work, because many different types in the
> original language map to the same LLVM IR type.  For example the C types "int"
> and "unsigned" both become "i32" in LLVM.  Yet "int" and "unsigned" have
> different debug info AFAIK, so which debug info should "i32"  be mapped too?

> Ciao, Duncan.

>>  ><i>>  In detail, given a LLVM Type object, is it possible for me to retrieve the
</i>><i>>  corresponding DIType (or MDNode) object? I feel LLVM should be able to know
</i>><i>>  everything about a type, if the source file is compiled with the -g option by
</i>><i>>  clang. I tried various methods but none of them allows me to connect a specific
</i>><i>>  Type with its debug information.
</i>>>  ><i>>  Any one knows how to achieve this? Thank you in advance.
</i>>>  >*>  Pei Wang*