<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 11 June 2017 at 23:03, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@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">Try value->dump() assuming you're using a debug build.</div><div class="gmail_extra"><br clear="all"></div></blockquote><div><br></div><div>The information displayed is non-uniform. There are two different cases based on my sample program:</div><div><br></div><div>         (1) dump() shows the Type and *some* value which I don't understand what it is</div><div>         (2) dump() shows the instruction that creates the Value*</div><div><br></div><div>But, it doesn't display the concrete sub-class.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div><div class="m_-2199725099328053581gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Sun, Jun 11, 2017 at 10:54 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"><span class="m_-2199725099328053581HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-2199725099328053581m_1123025501363884479gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</font></span></font></span></div></div><span class="HOEnZb"><font color="#888888">
<br>______________________________<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>
<br></font></span></blockquote></div><br></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>