Revert r236879, "Do not emit thunks with available_externally linkage in comdats"

It broke pecoff, at least i686-cygwin.

llvm-svn: 236937
This commit is contained in:
NAKAMURA Takumi
2015-05-09 21:10:07 +00:00
parent 1af9c7b9d4
commit c7da6da58e
7 changed files with 28 additions and 47 deletions

View File

@@ -378,6 +378,9 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn,
// Set the right linkage.
CGM.setFunctionLinkage(GD, Fn);
if (CGM.supportsCOMDAT() && Fn->isWeakForLinker())
Fn->setComdat(CGM.getModule().getOrInsertComdat(Fn->getName()));
// Set the right visibility.
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
setThunkVisibility(CGM, MD, Thunk, Fn);
@@ -458,7 +461,6 @@ void CodeGenVTables::emitThunk(GlobalDecl GD, const ThunkInfo &Thunk,
CGM.getCXXABI().setThunkLinkage(ThunkFn, ForVTable, GD,
!Thunk.Return.isEmpty());
}
CGM.maybeSetTrivialComdat(*ThunkFn);
}
void CodeGenVTables::maybeEmitThunkForVTable(GlobalDecl GD,