summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 9768e71178b..86536cdc062 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -3627,22 +3627,12 @@ static StructorCodegen getCodegenToUse(CodeGenModule &CGM,
}
llvm::GlobalValue::LinkageTypes Linkage = CGM.getFunctionLinkage(AliasDecl);
- // All discardable structors can be RAUWed, but we don't want to do that in
- // unoptimized code, as that makes complete structor symbol disappear
- // completely, which degrades debugging experience.
- // Symbols with private linkage can be safely aliased, so we special case them
- // here.
- if (llvm::GlobalValue::isLocalLinkage(Linkage))
- return CGM.getCodeGenOpts().OptimizationLevel > 0 ? StructorCodegen::RAUW
- : StructorCodegen::Alias;
+ if (llvm::GlobalValue::isDiscardableIfUnused(Linkage))
+ return StructorCodegen::RAUW;
- // Linkonce structors cannot be aliased nor placed in a comdat, so these need
- // to be emitted separately.
// FIXME: Should we allow available_externally aliases?
- if (llvm::GlobalValue::isDiscardableIfUnused(Linkage) ||
- !llvm::GlobalAlias::isValidLinkage(Linkage))
- return CGM.getCodeGenOpts().OptimizationLevel > 0 ? StructorCodegen::RAUW
- : StructorCodegen::Emit;
+ if (!llvm::GlobalAlias::isValidLinkage(Linkage))
+ return StructorCodegen::RAUW;
if (llvm::GlobalValue::isWeakForLinker(Linkage)) {
// Only ELF and wasm support COMDATs with arbitrary names (C5/D5).
OpenPOWER on IntegriCloud