<div dir="ltr">We could replace it with an out of line constructor.<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 2:36 AM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">__declspec(dllexport) isn't needed, is it?<br>
<div class="HOEnZb"><div class="h5"><br>
2014-09-12 8:38 GMT+04:00 David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>>:<br>
> Author: majnemer<br>
> Date: Thu Sep 11 23:38:08 2014<br>
> New Revision: 217654<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217654&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=217654&view=rev</a><br>
> Log:<br>
> MS ABI: The latest VC "14" CTP implements deleted virtual functions<br>
><br>
> Deleted virtual functions get _purecall inserted into the vftable.<br>
> Earlier CTPs would simply stick nullptr in there.<br>
><br>
> N.B. MSVC can't handle deleted virtual functions which require return<br>
> adjusting thunks, they give an error that a deleted function couldn't be<br>
> called inside of a compiler generated function. We get this correct by<br>
> making the thunk have a __purecall entry as well.<br>
><br>
> Modified:<br>
> cfe/trunk/lib/AST/VTableBuilder.cpp<br>
> cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp<br>
> cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp<br>
><br>
> Modified: cfe/trunk/lib/AST/VTableBuilder.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=217654&r1=217653&r2=217654&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=217654&r1=217653&r2=217654&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/AST/VTableBuilder.cpp (original)<br>
> +++ cfe/trunk/lib/AST/VTableBuilder.cpp Thu Sep 11 23:38:08 2014<br>
> @@ -2566,13 +2566,6 @@ private:<br>
> }<br>
> }<br>
><br>
> - void ErrorUnsupported(StringRef Feature, SourceLocation Location) {<br>
> - clang::DiagnosticsEngine &Diags = Context.getDiagnostics();<br>
> - unsigned DiagID = Diags.getCustomDiagID(<br>
> - DiagnosticsEngine::Error, "v-table layout for %0 is not supported yet");<br>
> - Diags.Report(Context.getFullLoc(Location), DiagID) << Feature;<br>
> - }<br>
> -<br>
> public:<br>
> VFTableBuilder(MicrosoftVTableContext &VTables,<br>
> const CXXRecordDecl *MostDerivedClass, const VPtrInfo *Which)<br>
> @@ -3037,10 +3030,8 @@ void VFTableBuilder::dumpLayout(raw_ostr<br>
> if (MD->isPure())<br>
> Out << " [pure]";<br>
><br>
> - if (MD->isDeleted()) {<br>
> - ErrorUnsupported("deleted methods", MD->getLocation());<br>
> + if (MD->isDeleted())<br>
> Out << " [deleted]";<br>
> - }<br>
><br>
> ThunkInfo Thunk = VTableThunks.lookup(I);<br>
> if (!Thunk.isEmpty())<br>
><br>
> Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=217654&r1=217653&r2=217654&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=217654&r1=217653&r2=217654&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)<br>
> +++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Thu Sep 11 23:38:08 2014<br>
> @@ -63,8 +63,6 @@ public:<br>
> }<br>
><br>
> StringRef GetPureVirtualCallName() override { return "_purecall"; }<br>
> - // No known support for deleted functions in MSVC yet, so this choice is<br>
> - // arbitrary.<br>
> StringRef GetDeletedVirtualCallName() override { return "_purecall"; }<br>
><br>
> llvm::Value *adjustToCompleteObject(CodeGenFunction &CGF,<br>
><br>
> Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp?rev=217654&r1=217653&r2=217654&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp?rev=217654&r1=217653&r2=217654&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp (original)<br>
> +++ cfe/trunk/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp Thu Sep 11 23:38:08 2014<br>
> @@ -1,4 +1,4 @@<br>
> -// RUN: %clang_cc1 -fno-rtti -emit-llvm -o %t.ll -fdump-vtable-layouts %s -triple=i386-pc-win32 >%t<br>
> +// RUN: %clang_cc1 -std=c++11 -fms-extensions -fno-rtti -emit-llvm -o %t.ll -fdump-vtable-layouts %s -triple=i386-pc-win32 >%t<br>
> // RUN: FileCheck %s < %t<br>
> // RUN: FileCheck --check-prefix=MANGLING %s < %t.ll<br>
><br>
> @@ -764,3 +764,11 @@ struct W : B, Y {<br>
><br>
> W::W() {}<br>
> }<br>
> +<br>
> +namespace Test13 {<br>
> +struct __declspec(dllexport) A {<br>
> + // CHECK-LABEL: VFTable for 'Test13::A' (1 entry).<br>
> + // CHECK-NEXT: 0 | void Test13::A::f() [deleted]<br>
> + virtual void f() = delete;<br>
> +};<br>
> +}<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>