[LLVMdev] Recover variable name after mem2reg

Julien Henry julienhenry23 at gmail.com
Fri Jun 15 08:06:41 PDT 2012


Hi everybody,

I have some issues trying to recover the name of the variables from the
metadata.
Let me explain : I have a LLVM IR file, compiled with -g, on which I apply
the -mem2reg optimization pass. This pass has the effect of removing the
dbg.declare function calls from the bitcode, and replaces them by calls to
the intrinsic function dbg.value. However, these function calls do not
allow to easily associate each of the llvm instructions to its
corresponding variable name in my C code.
For instance, I don't figure out how to recover the name in the C program
of a Phi value "%x.1", which is clearly my "x" variable in C.

Do I miss something ?

Thanks for your help.
-- 
Julien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120615/3cd47e7c/attachment.html>


More information about the llvm-dev mailing list