<div dir="ltr"><a href="http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates">http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 3:24 PM, Dipanjan Das via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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"><div><br></div><div>As a concrete question, I understand 'Value' class is the parent of many concrete sub-classes. Let's say I retrieve a Value* value = store_inst->getValueOperand(). Unless I know what the sub-type is, how can I further use this object? I tried something like this:</div><div><br></div><div>==============================<wbr>===================</div><div><br></div><div> Value* value = store_inst->getValueOperand()</div><div> errs() << value->getValueID; // Which ID corresponds to which sub-class?</div><div> errs() << value->getValueName(); // Prints numeric memory addresses</div><div> errs() << *value->getValueName(); // Doesn't compile </div><div> </div><div>==============================<wbr>===================<br clear="all"><div><br></div><div>I have mentioned the issues in each of the cases above. I am not sure if the approach is correct or not. Please help me out.</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-663785564093095553gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">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>
<br></blockquote></div><br></div>