summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CGRTTI.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
commita3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824 (patch)
treea6082d4d1d1e9ddaea09a6a04bb4a47da95d642d /lib/CodeGen/CGRTTI.cpp
parentbb1e3bc1e0be2b8f891db46457a8943451bf4d8b (diff)
downloadFreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.zip
FreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.tar.gz
Update clang to r93512.
Diffstat (limited to 'lib/CodeGen/CGRTTI.cpp')
-rw-r--r--lib/CodeGen/CGRTTI.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp
index db6c507..29552ce 100644
--- a/lib/CodeGen/CGRTTI.cpp
+++ b/lib/CodeGen/CGRTTI.cpp
@@ -360,28 +360,12 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(QualType Ty) {
// If we're in an anonymous namespace, then we always want internal linkage.
if (RD->isInAnonymousNamespace() || !RD->hasLinkage())
return llvm::GlobalVariable::InternalLinkage;
-
+
+ // If this class does not have a vtable, we want weak linkage.
if (!RD->isDynamicClass())
return llvm::GlobalValue::WeakODRLinkage;
- // Get the key function.
- const CXXMethodDecl *KeyFunction = RD->getASTContext().getKeyFunction(RD);
- if (!KeyFunction) {
- // There is no key function, the RTTI descriptor is emitted with weak_odr
- // linkage.
- 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;
+ return CodeGenModule::getVtableLinkage(RD);
}
case Type::Vector:
OpenPOWER on IntegriCloud