From 924ab935cdd30733455acc1ccac1223fbe6b2a73 Mon Sep 17 00:00:00 2001 From: dim Date: Thu, 12 Dec 2013 22:01:42 +0000 Subject: [PATCH] Merge r259214 from stable/10 (head r259100): 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 Approved by: re (glebius) git-svn-id: svn://svn.freebsd.org/base/releng/10.0@259278 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp index 069cd5f9..8559e4cc 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp @@ -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, -- 2.42.0