summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2017-06-30 00:07:54 +0000
committerShoaib Meenai <smeenai@fb.com>2017-06-30 00:07:54 +0000
commita2222fa1d27163ab1b0a8885d53ae1b69def7afc (patch)
tree3ad3e9f5afa768563fd5719f6b4d38d4298011c8 /clang/lib
parent53b2cb77cc1dd071b0c98afee3c4cc20ca1eef22 (diff)
downloadbcm5719-llvm-a2222fa1d27163ab1b0a8885d53ae1b69def7afc.tar.gz
bcm5719-llvm-a2222fa1d27163ab1b0a8885d53ae1b69def7afc.zip
[CodeGen] Propagate dllexport to thunks
Under Windows Itanium, we need to export virtual and non-virtual thunks if the functions being thunked are exported. These thunks would previously inherit their dllexport attribute from the declaration, but r298330 changed declarations to not have dllexport attributes. We therefore need to add the dllexport attribute to the definition ourselves now. Differential Revision: https://reviews.llvm.org/D34850 llvm-svn: 306770
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 64b6d0d3fe9..7c9f07d32d8 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -64,6 +64,10 @@ static void setThunkProperties(CodeGenModule &CGM, const ThunkInfo &Thunk,
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()));
}
OpenPOWER on IntegriCloud