summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-31 19:36:25 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-31 19:36:25 +0000
commit2d21394190a3556e2b0137ab2ee7367f82e7e48e (patch)
tree43fab3a9ef5d547dcaac390dd248d689362904d7 /clang/lib/CodeGen
parent1d8979422a8086dcc4a4f03a0e744edd56a70e91 (diff)
downloadbcm5719-llvm-2d21394190a3556e2b0137ab2ee7367f82e7e48e.tar.gz
bcm5719-llvm-2d21394190a3556e2b0137ab2ee7367f82e7e48e.zip
If the key function of a record is inline, then the RTTI data should have weak_odr linkage.
llvm-svn: 92371
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGRTTI.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGRTTI.cpp b/clang/lib/CodeGen/CGRTTI.cpp
index b00b9155e86..db6c5075ede 100644
--- a/clang/lib/CodeGen/CGRTTI.cpp
+++ b/clang/lib/CodeGen/CGRTTI.cpp
@@ -372,6 +372,14 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(QualType Ty) {
return llvm::GlobalValue::WeakODRLinkage;
}
+ // If the key function is defined, but inlined, then the RTTI descriptor is
+ // emitted with weak_odr linkage.
+ const FunctionDecl* KeyFunctionDefinition;
+ KeyFunction->getBody(KeyFunctionDefinition);
+
+ if (KeyFunctionDefinition->isInlined())
+ return llvm::GlobalValue::WeakODRLinkage;
+
// Otherwise, the RTTI descriptor is emitted with external linkage.
return llvm::GlobalValue::ExternalLinkage;
}
OpenPOWER on IntegriCloud