[LLVMdev] How does the debug info correspond to the normal info?

Devang Patel devang.patel at gmail.com
Thu Jul 29 16:43:57 PDT 2010


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




More information about the llvm-dev mailing list