aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-05 22:24:38 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-05 22:24:38 +0000
commit891c8b739917ec4d171a62ceaefc640115089e7d (patch)
treeb58a4e0a2b4993da8304935f50db8929ef975696 /lib/CodeGen/CGVtable.cpp
parent152d4dce59a123b9a103b3087dc3be7f0b71033e (diff)
If a class does not have a key function, its linkage should be weak_odr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index 9ed90f0ba5..9c78c23631 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -1092,7 +1092,7 @@ createGlobalVariable(CodeGenModule &CGM, const CXXRecordDecl *RD,
// Figure out the right linkage.
llvm::GlobalVariable::LinkageTypes Linkage =
- llvm::GlobalValue::LinkOnceODRLinkage;
+ llvm::GlobalValue::WeakODRLinkage;
if (!Init)
Linkage = llvm::GlobalValue::ExternalLinkage;
else if (RD->isInAnonymousNamespace())
@@ -1167,7 +1167,7 @@ llvm::Constant *CodeGenModule::GenerateVtable(const CXXRecordDecl *LayoutClass,
b.getVtable().size());
}
llvm::GlobalVariable *OGV = GV;
- GV = createGlobalVariable(*this, LayoutClass, ntype, C, Name);
+ GV = createGlobalVariable(*this, LayoutClass, ArrayType, Init, Name);
if (OGV) {
GV->takeName(OGV);
llvm::Constant *NewPtr =