diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-31 19:28:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-31 19:28:59 +0000 |
commit | 9e435806aaf5bd7e974d317ef247f200200ad686 (patch) | |
tree | 950414edc74ebec2c62ac1b5fd10e799f0204b5b /lib/CodeGen/CodeGenModule.cpp | |
parent | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (diff) |
Notes
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 8981bfe89cb4a..1b07160908adb 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1928,31 +1928,6 @@ void CodeGenModule::MaybeHandleStaticInExternC(const SomeDecl *D, R.first->second = nullptr; } -static bool shouldBeInCOMDAT(CodeGenModule &CGM, const Decl &D) { - if (!CGM.supportsCOMDAT()) - return false; - - if (D.hasAttr<SelectAnyAttr>()) - return true; - - GVALinkage Linkage; - if (auto *VD = dyn_cast<VarDecl>(&D)) - Linkage = CGM.getContext().GetGVALinkageForVariable(VD); - else - Linkage = CGM.getContext().GetGVALinkageForFunction(cast<FunctionDecl>(&D)); - - switch (Linkage) { - case GVA_Internal: - case GVA_AvailableExternally: - case GVA_StrongExternal: - return false; - case GVA_DiscardableODR: - case GVA_StrongODR: - return true; - } - llvm_unreachable("No such linkage"); -} - void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { llvm::Constant *Init = nullptr; QualType ASTTy = D->getType(); @@ -2096,9 +2071,6 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { setTLSMode(GV, *D); } - if (shouldBeInCOMDAT(*this, *D)) - GV->setComdat(TheModule.getOrInsertComdat(GV->getName())); - // Emit the initializer function if necessary. if (NeedsGlobalCtor || NeedsGlobalDtor) EmitCXXGlobalVarDeclInitFunc(D, GV, NeedsGlobalCtor); @@ -2433,9 +2405,6 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, MaybeHandleStaticInExternC(D, Fn); - if (shouldBeInCOMDAT(*this, *D)) - Fn->setComdat(TheModule.getOrInsertComdat(Fn->getName())); - CodeGenFunction(*this).GenerateCode(D, Fn, FI); setFunctionDefinitionAttributes(D, Fn); |