<div dir="ltr"><div class="gmail_default"><font face="arial, helvetica, sans-serif">This [1] might worth reading, Malhar.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">[1] <a href="http://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html">http://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html</a></font><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-10 4:12 GMT+08:00 Tim Northover via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 9 June 2017 at 12:03, Jajoo, Malhar via llvm-dev<br>
<span class=""><<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Is there some way around this ( without suggesting a change to my entire AST ) ?<br>
<br>
</span>LLVM has its own lightweight dynamic casting infrastructure which the<br>
Type hierarchy already makes use of.<br>
<br>
You have to implement a "classof" function in your DummyType<br>
definition. That means you'll need a new type ID. Appropriating an<br>
unused one is slightly dodgy, but probably OK in practice if you're<br>
careful.<br>
<br>
After that you'd write "dyn_cast" instead of "dynamic_cast", since<br>
that's what the LLVM version is called.<br>
<br>
Cheers.<br>
<br>
Tim.<br>
<div class="HOEnZb"><div class="h5">______________________________<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div>