[PATCH] D34850: [CodeGen] Propagate dllexport to thunks
Shoaib Meenai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 29 17:08:19 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL306770: [CodeGen] Propagate dllexport to thunks (authored by smeenai).
Repository:
rL LLVM
https://reviews.llvm.org/D34850
Files:
cfe/trunk/lib/CodeGen/CGVTables.cpp
cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
Index: cfe/trunk/lib/CodeGen/CGVTables.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp
@@ -64,6 +64,10 @@
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
setThunkVisibility(CGM, MD, Thunk, ThunkFn);
+ // Propagate dllexport storage.
+ if (MD->hasAttr<DLLExportAttr>())
+ ThunkFn->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
+
if (CGM.supportsCOMDAT() && ThunkFn->isWeakForLinker())
ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName()));
}
Index: cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
+++ cfe/trunk/test/CodeGenCXX/windows-itanium-dllexport.cpp
@@ -53,3 +53,12 @@
// CHECK: declare dllimport {{.*}} @_ZN5outerIcE1fEv
// CHECK: define {{.*}} @_ZN5outerIcE5inner1fEv
+
+struct base {
+ virtual ~base();
+};
+struct __declspec(dllexport) derived : public virtual base {
+ virtual ~derived() {}
+};
+
+// CHECK: define {{.*}} dllexport {{.*}} @_ZTv0_n12_N7derivedD0Ev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34850.104785.patch
Type: text/x-patch
Size: 1192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170630/95310bd7/attachment.bin>
More information about the cfe-commits
mailing list