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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user