Pull in r196658 from upstream clang trunk:

CodeGen: Don't emit linkage on thunks that aren't emitted because they're
  vararg.

  This can happen when we're trying to emit a thunk with available_externally
  linkage with optimization enabled but bail because it doesn't make sense for
  vararg functions.

  [LLVM] PR18098.

This should fix clang "Broken module found, compilation aborted" errors when
building the qt4-based dvbcut port.

Reported by:	se
MFC after:	3 days
This commit is contained in:
Dimitry Andric 2013-12-08 13:56:26 +00:00
parent 87bd9889d1
commit 0514e96282
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=259100

View File

@ -454,10 +454,9 @@ void CodeGenVTables::EmitThunk(GlobalDecl GD, const ThunkInfo &Thunk,
} else {
// Normal thunk body generation.
CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk);
if (UseAvailableExternallyLinkage)
ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage);
}
if (UseAvailableExternallyLinkage)
ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage);
}
void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD,