aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBen Dunbobbin <Ben.Dunbobbin@sony.com>2020-11-02 17:32:55 +0000
committerBen Dunbobbin <Ben.Dunbobbin@sony.com>2020-11-02 17:33:54 +0000
commit5024d3aa1855d4c17c7e875048d5ad20b8b2d8ce (patch)
tree80c192af49398a394763d2fb3cc52690d10de055 /clang/lib/CodeGen/CodeGenModule.cpp
parent9ac291009356b789010f297dcf064490201c2f84 (diff)
downloadllvm-5024d3aa1855d4c17c7e875048d5ad20b8b2d8ce.zip
llvm-5024d3aa1855d4c17c7e875048d5ad20b8b2d8ce.tar.gz
llvm-5024d3aa1855d4c17c7e875048d5ad20b8b2d8ce.tar.bz2
Revert "[Clang] Add the ability to map DLL storage class to visibility"
This reverts commit 415f7ee8836944942d8beb70e982e95a312866a7. The added tests were failing on the build bots!
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 9512b35..66a3c57 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -401,41 +401,6 @@ void InstrProfStats::reportDiagnostics(DiagnosticsEngine &Diags,
}
}
-static void setVisibilityFromDLLStorageClass(const clang::LangOptions &LO,
- llvm::Module &M) {
- if (!LO.VisibilityFromDLLStorageClass)
- return;
-
- llvm::GlobalValue::VisibilityTypes DLLExportVisibility =
- CodeGenModule::GetLLVMVisibility(LO.getDLLExportVisibility());
- llvm::GlobalValue::VisibilityTypes NoDLLStorageClassVisibility =
- CodeGenModule::GetLLVMVisibility(LO.getNoDLLStorageClassVisibility());
- llvm::GlobalValue::VisibilityTypes ExternDeclDLLImportVisibility =
- CodeGenModule::GetLLVMVisibility(LO.getExternDeclDLLImportVisibility());
- llvm::GlobalValue::VisibilityTypes ExternDeclNoDLLStorageClassVisibility =
- CodeGenModule::GetLLVMVisibility(
- LO.getExternDeclNoDLLStorageClassVisibility());
-
- for (llvm::GlobalValue &GV : M.global_values()) {
- if (GV.hasAppendingLinkage() || GV.hasLocalLinkage())
- return;
-
- if (GV.isDeclarationForLinker()) {
- GV.setVisibility(GV.getDLLStorageClass() ==
- llvm::GlobalValue::DLLImportStorageClass
- ? ExternDeclDLLImportVisibility
- : ExternDeclNoDLLStorageClassVisibility);
- } else {
- GV.setVisibility(GV.getDLLStorageClass() ==
- llvm::GlobalValue::DLLExportStorageClass
- ? DLLExportVisibility
- : NoDLLStorageClassVisibility);
- }
-
- GV.setDLLStorageClass(llvm::GlobalValue::DefaultStorageClass);
- }
-}
-
void CodeGenModule::Release() {
EmitDeferred();
EmitVTablesOpportunistically();
@@ -723,12 +688,6 @@ void CodeGenModule::Release() {
getTargetCodeGenInfo().emitTargetMetadata(*this, MangledDeclNames);
EmitBackendOptionsMetadata(getCodeGenOpts());
-
- // Set visibility from DLL export class
- // We do this at the end of LLVM IR generation; after any operation
- // that might affect the DLL storage class or the visibility, and
- // before anything that might act on these.
- setVisibilityFromDLLStorageClass(LangOpts, getModule());
}
void CodeGenModule::EmitOpenCLMetadata() {