<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 11 June 2017 at 07:53, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sounds like you're looking for reinterpret_cast: <a href="http://en.cppreference.com/w/cpp/language/reinterpret_cast" target="_blank">http://en.<wbr>cppreference.com/w/cpp/<wbr>language/reinterpret_cast</a></div></blockquote><div><br></div><div>I tried cast<ConstInt>(vo), but that failed at run-time.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 11, 2017 at 3:06 AM Dipanjan Das via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>I am trying to cast a Value* irrespective of its underlying subclass to uint64 and pass it on to a method as an argument.</div><div><br></div><div><div>if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {</div><div> Value* vo = store_inst->getValueOperand();</div><div> uint64 value = /* cast vo to unsigned int 64 bit */</div><div> func(value);</div><div> }</div></div><div><br></div><div>How can I force cast 'vo' to unsigned int?</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-8648058305725094548m_1966427762172874726gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</font></span></div><span class="HOEnZb"><font color="#888888">
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div></div>