<div dir="ltr">How will this interact with this trick <a href="http://llvm.org/docs/ProgrammersManual.html#tagging-considerations" target="_blank">http://llvm.org/docs/<wbr>ProgrammersManual.html#<wbr>tagging-considerations</a> where we make an assumption that the vtable ptr lives at the start of the User object. Is the assumption now on the Type* that will now be at the start of Value?</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Wed, Mar 22, 2017 at 3:21 PM, George Burgess IV via Phabricator via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@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">george.burgess.iv added a comment.<br>
<br>
Thanks for working on this!<br>
<span class=""><br>
> I think we need some way of checking this at compile time, because developers are going to trip over this<br>
<br>
<br>
<br>
</span>  #define NO_VIRTUALS_ALLOWED(cls) static_assert(!std::is_<wbr>polymorphic<cls>::value, #cls " is not allowed to have virtual methods");<br>
<br>
  class Value /* ... */ { /* ... */ };<br>
  NO_VIRTUALS_ALLOWED(Value);<br>
<br>
  class BasicBlock : public Value, /* ... */ { /* ... */ };<br>
  NO_VIRTUALS_ALLOWED(<wbr>BasicBlock);<br>
<br>
might be a good starting point. Can't think of a way to make it automagically apply to subclasses, though.<br>
<br>
<br>
<br>
================<br>
Comment at: include/llvm/IR/DerivedUser.h:<wbr>28<br>
+/// Extension point for the Value hierarchy. All classes outside of lib/IR<br>
+/// that wish to inherit from User should instead inherit from DerivedUser<br>
+/// instead.<br>
----------------<br>
"instead inherit from DerivedUser instead"?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D31261" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D31261</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>