If a method is virtual and the class key function is in another file, emit the method as available_externally.
Fixes PR6747 llvm-svn: 101757
This commit is contained in:
@@ -314,7 +314,14 @@ GetLinkageForFunction(ASTContext &Context, const FunctionDecl *FD,
|
||||
if (FD->getTemplateSpecializationKind()
|
||||
== TSK_ExplicitInstantiationDeclaration)
|
||||
return CodeGenModule::GVA_C99Inline;
|
||||
|
||||
|
||||
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
|
||||
const CXXRecordDecl *RD = MD->getParent();
|
||||
if (MD->isVirtual() &&
|
||||
CodeGenVTables::isKeyFunctionInAnotherTU(Context, RD))
|
||||
return CodeGenModule::GVA_C99Inline;
|
||||
}
|
||||
|
||||
return CodeGenModule::GVA_CXXInline;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user