<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 17, 2015 at 4:45 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Jul 16, 2015 at 8:42 PM, Bob Wilson <<a href="mailto:bob.wilson@apple.com">bob.wilson@apple.com</a>> wrote:<br>
> Clang used to silently ignore __declspec(novtable) for all platforms, but it is now implemented for Windows. However, we don’t check if the target is Windows. This does not work when using the Itanium ABI, where the class layout for complex class hierarchies is stored in the vtable. Leaving the vtable uninitialized on non-Windows platforms does not work in that case. It might be possible to honor the novtable attribute in some simple cases and either report an error or ignore it in more complex situations, but it’s not clear if that would be worthwhile. There is also value in having a simple and predictable behavior, so I am proposed the attached patch which simply ignores novtable on non-Windows platforms.<br></span></blockquote><div><br></div><div>I think it might actually be worth making it work. I have vague recollections of Chromium developers wondering how to do the equivalent size saving optimization on non-Windows targets. We'd have to pin down what makes a "complex" class hierarchy. I'm assuming the fix would be to emit the vptr store if the class has virtual bases.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
</span>MSVC supports an Itanium build target. What does __declspec(novtable)<br>
do there with the complex class layouts?<br>
<br>
I don't have Visual Studio installed with support for Itanium,<br>
otherwise I would test this myself.<br></blockquote><div><br></div><div>I think Bob is talking about the Itanium C++ ABI, which I don't think MSVC ever implemented. If they did, I wouldn't be surprised if they simply ignored this declspec.</div></div></div></div>