<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p>Hi Tim,</p>
<p><br>
</p>
<p>Thanks for that , I have read the documentation on this , but I would like to know <br>
if it would be the right thing to do , ie , changing the enum within llvm::Type<br>
<br>
and <b>I'm slightly unclear on how I can update the C binding ? </b></p>
<p>Can someone kindly clarify that ?</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Malhar</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> $BDDpjG$(B <chenwj.cs97g@g2.nctu.edu.tw><br>
<b>Sent:</b> Friday, June 9, 2017 11:29:26 PM<br>
<b>To:</b> Tim Northover<br>
<b>Cc:</b> Jajoo, Malhar; llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] Subclassing LLVM Type</font>
<div> </div>
</div>
<div>
<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" id="LPlnk164753" previewremoved="true">
http://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html</a></font>
<div id="LPBorder_GT_14970465151050.4103329640716722" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14970465151010.3225780018943425" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14970465151030.7423630324499308" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14970465151030.1153408043895765"></div>
<div id="LPTitle_14970465151030.00263976593234716" style="top: 0px; color: rgb(2, 44, 90); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14970465151040.661201351227642" href="http://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html" target="_blank" style="text-decoration: none;">How to set up LLVM-style RTTI for your class hierarchy ...</a></div>
<div id="LPMetadata_14970465151040.5742360273491371" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
llvm.org</div>
<div id="LPDescription_14970465151050.6408827649415287" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Background $B"y(B LLVM avoids using C++$B!G(Bs built in RTTI. Instead, it pervasively uses its own hand-rolled form of RTTI which is much more efficient and flexible ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<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 ($BDDpjG$(B)<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>
</div>
</div>
</body>
</html>