<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:10pt">Thank you for the help :D<br><div><span></span></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Cristianno Martins <cristiannomartins@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Alexandru Ionut Diaconescu <cyrusthevirus001x@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "llvmdev@cs.uiuc.edu" <llvmdev@cs.uiuc.edu> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, June 25, 2013 2:11 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [LLVMdev] get value<br> </font> </div> <div
 class="y_msg_container"><br>
<div id="yiv2071394421"><div dir="ltr">Oops, that's true: I forgot about that XD sorry =)<div><br></div><div style="">Glad I could help,</div></div><div class="yiv2071394421gmail_extra"><br clear="all"><div><br>--<br>Cristianno Martins<br>PhD Student of Computer Science<br>

University of Campinas<br><a rel="nofollow" ymailto="mailto:cmartins@ic.unicamp.br" target="_blank" href="mailto:cmartins@ic.unicamp.br">cmartins@ic.unicamp.br</a><br><a rel="nofollow" ymailto="mailto:cristiannomartins@hotmail.com" target="_blank" href="mailto:cristiannomartins@hotmail.com"></a></div>
<br><br><div class="yiv2071394421gmail_quote">On Tue, Jun 25, 2013 at 4:38 AM, Alexandru Ionut Diaconescu <span dir="ltr"><<a rel="nofollow" ymailto="mailto:cyrusthevirus001x@yahoo.com" target="_blank" href="mailto:cyrusthevirus001x@yahoo.com">cyrusthevirus001x@yahoo.com</a>></span> wrote:<br>

<blockquote class="yiv2071394421gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:10pt;font-family:times new roman, new york, times, serif;">Hi Cristianno,<br><br>Thank you, it works :) <br>

<br>with an extra cast:<br>                                    Value *v ......<br>                                    ConstantInt* RR = (ConstantInt *)v;<br>                                    uint64_t VV = (RR->getValue()).getLimitedValue();<br>

                           
         errs()<<"\nRR  "<<VV<<"\n";<br><div class="yiv2071394421hm yiv2071394421HOEnZb"><div><span><br></span></div><div><br></div>  </div><div style="font-family:times new roman, new york, times, serif;font-size:10pt;">

<div class="yiv2071394421hm yiv2071394421HOEnZb"> </div><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><div class="yiv2071394421hm yiv2071394421HOEnZb"> <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Cristianno Martins <<a rel="nofollow" ymailto="mailto:cristiannomartins@gmail.com" target="_blank" href="mailto:cristiannomartins@gmail.com">cristiannomartins@gmail.com</a>><br>

 <b><span style="font-weight:bold;">To:</span></b> Alexandru Ionut Diaconescu <<a rel="nofollow" ymailto="mailto:cyrusthevirus001x@yahoo.com" target="_blank" href="mailto:cyrusthevirus001x@yahoo.com">cyrusthevirus001x@yahoo.com</a>> <br><b><span style="font-weight:bold;">Cc:</span></b> "<a rel="nofollow" ymailto="mailto:llvmdev@cs.uiuc.edu" target="_blank" href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>" <<a rel="nofollow" ymailto="mailto:llvmdev@cs.uiuc.edu" target="_blank" href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>> <br>

 <b><span style="font-weight:bold;">Sent:</span></b> Tuesday, June 25, 2013 12:27 PM<br> <b><span style="font-weight:bold;">Subject:</span></b> Re: [LLVMdev] get value<br> </font> </div></div><div><div class="yiv2071394421h5"> <div><br>

<div><div dir="ltr">Hi
 Alexandru,<div><br></div><div>if you have a Value pointer named v, you could use the method v->getValue<span>().</span>getLimitedValue<span>(), which returns </span><span>uint64_t, that can be casted as int.</span></div>



<div><span><br></span></div><div><span>Hope I could help,</span></div>















</div><div><br clear="all"><div><br>--<br>Cristianno Martins<br>PhD Student of Computer Science<br>University of Campinas<br><a rel="nofollow" ymailto="mailto:cmartins@ic.unicamp.br" target="_blank" href="mailto:cmartins@ic.unicamp.br">cmartins@ic.unicamp.br</a><br>



<a rel="nofollow" ymailto="mailto:cristiannomartins@hotmail.com" target="_blank" href="mailto:cristiannomartins@hotmail.com"></a></div>
<br><br><div>On Tue, Jun 25, 2013 at 4:05 AM, Alexandru Ionut Diaconescu <span dir="ltr"><<a rel="nofollow" ymailto="mailto:cyrusthevirus001x@yahoo.com" target="_blank" href="mailto:cyrusthevirus001x@yahoo.com">cyrusthevirus001x@yahoo.com</a>></span> wrote:<br>



<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:10pt;font-family:times new roman, new york, times, serif;"><div>Hello !</div><div><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;">



This may be a trivial question, but I cannot get fields from a Value type.</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;">



If my Value is <span style="font-style:italic;"><span style="font-weight:bold;">i32 1</span></span>, how can I store <span style="font-style:italic;"><span style="font-weight:bold;">1</span></span> in a different structure (an integer) ?
 For the type, I have getType(). For the value, I see no method in Value.h. <span><br></span></div><div style="font-style:italic;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;">



<span><br></span></div><div style="font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;"><span>I tried to cast to <span style="font-style:italic;">ConstantExpr</span> and then to get operands, or cast to <span style="font-style:italic;">ConstantDataArray</span> and then use <span style="font-style:italic;">getAsString</span>(), but is not working. How should I get the value?</span></div>



<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;"><span><br></span></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;">



<span>Thank you !<br></span></div><div style="font-style:italic;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;"><br></div><div style="font-style:italic;font-size:13.3333px;background-color:transparent;font-family:times new roman, new york, times, serif;">



</div></div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a rel="nofollow" ymailto="mailto:LLVMdev@cs.uiuc.edu" target="_blank" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         http://llvm.cs.uiuc.edu/<br>
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev<br>
<br></blockquote></div><br></div></div><br><br></div> </div></div></div> </div>  </div></div></blockquote></div><br></div>
</div><br><br></div> </div> </div>  </div></body></html>