diff options
author | Mike Stump <mrs@apple.com> | 2009-12-16 03:07:12 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-12-16 03:07:12 +0000 |
commit | fba565d044a8979cfd916ce52655a6847bfaa601 (patch) | |
tree | 6cd55e7038eb09ad4f185193d742167083be7cf3 /lib/CodeGen/CGBuiltin.cpp | |
parent | b14e62d5aee7522b98c410ee65bd750c2cfe6f01 (diff) |
Add an addition check for undefined behavior for when we hit a
__builtin_unreachable. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBuiltin.cpp')
-rw-r--r-- | lib/CodeGen/CGBuiltin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index c70443245c..96bc3ef62c 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -229,6 +229,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, return RValue::get(Builder.CreateCall(F)); } case Builtin::BI__builtin_unreachable: { + if (CatchUndefined && HaveInsertPoint()) + EmitBranch(getTrapBB()); Value *V = Builder.CreateUnreachable(); Builder.ClearInsertionPoint(); return RValue::get(V); |