Hi James,<br><br>Names of the values may be missing so you shouldn't use them to keep track of values or map between them. If you need to keep the map the best thing would be to use std::map of the pointers referencing to the Value itself. <br>

<br>Names are mostly used for the debugging information.<br><br>Milos.<br><br><div class="gmail_quote">2009/4/15 James Stanier <span dir="ltr"><<a href="mailto:j.stanier@sussex.ac.uk">j.stanier@sussex.ac.uk</a>></span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hello everyone,<br>
<br>
I'm currently constructing a graph from LLVM bitcode, and I have a question<br>
about accessing the names of the variables shown in the .ll assembly file,<br>
assuming it's possible...<br>
<br>
For example, with<br>
<br>
%2 = load i32* %x_addr, align 4         ; <i32> [#uses=1]<br>
<br>
I can retrieve the opcodeName() from the Instruction object, which is<br>
"load". I can also access the operand and use getName() to retrieve<br>
"x_addr". However, this instruction is storing into %2 - how do I access the<br>
name of that?<br>
<br>
Also, when an operand is a numbered temporary such as<br>
<br>
%3 = add i32 %2, %1             ; <i32> [#uses=1]<br>
<br>
I'm also unable to access the name of it. Are these numberings no longer<br>
present in the bitcode? If not, is there any way to find out the name of<br>
which local variable it is referencing?<br>
<br>
Thanks in advance - I've been stuck on this for a while.<br>
<br>
Best,<br>
<br>
James<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Accessing-instruction-operand-names-tp23058683p23058683.html" target="_blank">http://www.nabble.com/Accessing-instruction-operand-names-tp23058683p23058683.html</a><br>


Sent from the LLVM - Dev mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</font></blockquote></div><br>