Pei Wang
2013-Jan-19 21:34 UTC
[LLVMdev] How to get the debug information for an LLVM IR type?
Hi, I am now trying to do some code analysis and need to get the debug information of the LLVM IR type encountered in the bitcode. In detail, given a LLVM Type object, is it possible for me to retrieve the corresponding DIType (or MDNode) object? I feel LLVM should be able to know everything about a type, if the source file is compiled with the -g option by clang. I tried various methods but none of them allows me to connect a specific Type with its debug information. Any one knows how to achieve this? Thank you in advance. Pei Wang
Duncan Sands
2013-Jan-21 04:51 UTC
[LLVMdev] How to get the debug information for an LLVM IR type?
Hi Pei Wang, On 19/01/13 22:34, Pei Wang wrote:> Hi, > > I am now trying to do some code analysis and need to get the debug information > 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.> > In detail, given a LLVM Type object, is it possible for me to retrieve the > corresponding DIType (or MDNode) object? I feel LLVM should be able to know > everything about a type, if the source file is compiled with the -g option by > clang. I tried various methods but none of them allows me to connect a specific > Type with its debug information. > > Any one knows how to achieve this? Thank you in advance. > > Pei Wang > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] How to get the debug information for an LLVM IR type?
- [LLVMdev] Type inconsistency in LLVM 3.1: CGDebugInfo.cpp
- [LLVMdev] Type inconsistency in LLVM 3.1: CGDebugInfo.cpp
- [LLVMdev] LTO type uniquing: ODR assertion failure
- [LLVMdev] Questions about debug info in LLVM 2.8