summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-02-06 20:09:44 +0000
committerAnders Carlsson <andersca@mac.com>2011-02-06 20:09:44 +0000
commite866d44417a420a05d3ef9a04b6fd4a21b47a0e6 (patch)
tree5ba188cf86fe123679c33edfddb20ea3942a417c /clang/lib/CodeGen
parent7dc9dce770366f1545246ca3a67d2ce40ee3a645 (diff)
downloadbcm5719-llvm-e866d44417a420a05d3ef9a04b6fd4a21b47a0e6.tar.gz
bcm5719-llvm-e866d44417a420a05d3ef9a04b6fd4a21b47a0e6.zip
Fix self-host; if a thunk already exists and has available_externally linkage, we should change its linkage instead of asserting.
llvm-svn: 124986
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 3dd7a15fe35..d74226ec89b 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -2723,8 +2723,13 @@ void CodeGenVTables::EmitThunk(GlobalDecl GD, const ThunkInfo &Thunk,
return;
}
- // We should never be able to get a function with a definition here.
- assert(false && "Shouldn't have an already existing definition");
+ // If a function has a body, it should have available_externally linkage.
+ assert(ThunkFn->hasAvailableExternallyLinkage() &&
+ "Function should have available_externally linkage!");
+
+ // Change the linkage.
+ CGM.setFunctionLinkage(cast<CXXMethodDecl>(GD.getDecl()), ThunkFn);
+ return;
}
// Actually generate the thunk body.
OpenPOWER on IntegriCloud