Xiaolong Tang
2010-Jul-29 16:42 UTC
[LLVMdev] How does the debug info correspond to the normal info?
Hey, LLVM allows to export source level debug information via meta data, I am wondering if there is any mappings between the information in the normal LLVM code and that in the meta data associated with the normal LLVM code. Consider one usage. Given an function parameter (argument) "x", via "getType()" we retrieve the type of "x". The type might be, to some extent, different from the declared type for "x" in the source code. So, generally, is it possible to infer the declared type of a variable (e.g. an argument) from the type of the variable in LLVM code or any other basis? Best, Xiaolong
Devang Patel
2010-Jul-29 23:43 UTC
[LLVMdev] How does the debug info correspond to the normal info?
On Thu, Jul 29, 2010 at 9:42 AM, Xiaolong Tang <xiaolong.snake at gmail.com> wrote:> > Hey, > > LLVM allows to export source level debug information via meta data, I > am wondering if there is any mappings between the information in the > normal LLVM code and that in the meta data associated with the normal > LLVM code.Debugging information encodes structural information about the type using metadata. It does not associate llvm::Type*. Try following little example and see llvm IR generated by the compiler. typedef struct Point { int x; int y; } Point; typedef struct Pair { int a; int b; } Pair; int foo(Point *p1, Pair *p2) { return p1->x + p2->b; } - Devang> Consider one usage. > > Given an function parameter (argument) "x", via "getType()" we > retrieve the type of "x". The type might be, to some extent, different > from the declared type for "x" in the source code. So, generally, is > it possible to infer the declared type of a variable (e.g. an > argument) from the type of the variable in LLVM code or any other > basis? > > Best, > Xiaolong > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- - Devang
Maybe Matching Threads
- [LLVMdev] For clarifying the "<Result>" in Instructions
- [LLVMdev] Question on Load and GetElementPtr instructions
- [LLVMdev] For clarifying the "<Result>" in Instructions
- [LLVMdev] Question on Load and GetElementPtr instructions
- [LLVMdev] For clarifying the "<Result>" in Instructions