summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-09 19:52:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-09 19:52:38 +0000
commite30752c93bf3c049d0d4ed657f762789d11ef27b (patch)
tree676924c72bbbe1a114a58a0d6565c96daa2d20f6 /clang/lib/CodeGen/CodeGenFunction.cpp
parentbe5613c0a7ca9d0a0916dcdbefd3719f33723abc (diff)
downloadbcm5719-llvm-e30752c93bf3c049d0d4ed657f762789d11ef27b.tar.gz
bcm5719-llvm-e30752c93bf3c049d0d4ed657f762789d11ef27b.zip
-fcatch-undefined-behavior: emit calls to the runtime library whenever one of the checks fails.
llvm-svn: 165536
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index a86c2e4fa1f..d7fcf9f8b21 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -544,7 +544,9 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
if (getContext().getLangOpts().CPlusPlus && !FD->hasImplicitReturnZero() &&
!FD->getResultType()->isVoidType() && Builder.GetInsertBlock()) {
if (CatchUndefined)
- EmitCheck(Builder.getFalse());
+ EmitCheck(Builder.getFalse(), "missing_return",
+ EmitCheckSourceLocation(FD->getLocation()),
+ llvm::ArrayRef<llvm::Value*>());
Builder.CreateUnreachable();
Builder.ClearInsertionPoint();
}
OpenPOWER on IntegriCloud