[LLVMdev] View variable-register map

Frits van Bommel fvbommel at gmail.com
Fri Jan 21 06:03:51 PST 2011


On Fri, Jan 21, 2011 at 2:48 PM, Vijayaraghavan Murali
<m.vijay at nus.edu.sg> wrote:
> I just wish to know if other than manually comparing the llc generated
> code with the source program, is there any other way of knowing which
> variables in the program are mapped to which registers? I was not able
> to find any suitable option for the same, so I'm wondering if there is a
> workaround.

Isn't this exactly one of the things debug information is for?
You'd need to compile with -g and somehow read the DWARF information
generated. As a bonus, this should work with gcc output too.

You'd still be comparing llc output with the source code[1], but you
no longer need to do it manually :).


[1]: Or the clang AST, I suppose.



More information about the llvm-dev mailing list