diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index db6c5075ed..20e5fcec56 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -375,9 +375,8 @@ static llvm::GlobalVariable::LinkageTypes getTypeInfoLinkage(QualType Ty) { // 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()) + if (KeyFunction->getBody(KeyFunctionDefinition) && + KeyFunctionDefinition->isInlined()) return llvm::GlobalValue::WeakODRLinkage; // Otherwise, the RTTI descriptor is emitted with external linkage. |