summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-11 22:38:33 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-11 22:38:33 +0000
commit599669983434af7a75047de35e802f66fa4b3c6e (patch)
tree7b669bddd31021e088866a03dae6a6c1aea610d5 /clang/lib/CodeGen/CodeGenFunction.cpp
parent7b974a45db5f986edaad15be952af14aad492798 (diff)
downloadbcm5719-llvm-599669983434af7a75047de35e802f66fa4b3c6e.tar.gz
bcm5719-llvm-599669983434af7a75047de35e802f66fa4b3c6e.zip
Revise r110163: don't mark weak functions nounwind, because the optimizer
treats that as a contract to be fulfilled by any replacements. llvm-svn: 110864
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 58d56ef0df9..e5cfa624b2c 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -315,6 +315,10 @@ void CodeGenFunction::EmitFunctionBody(FunctionArgList &Args) {
/// non-existence of any throwing calls within it. We believe this is
/// lightweight enough to do at -O0.
static void TryMarkNoThrow(llvm::Function *F) {
+ // LLVM treats 'nounwind' on a function as part of the type, so we
+ // can't do this on functions that can be overwritten.
+ if (F->mayBeOverridden()) return;
+
for (llvm::Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI)
for (llvm::BasicBlock::iterator
BI = FI->begin(), BE = FI->end(); BI != BE; ++BI)
OpenPOWER on IntegriCloud