From b85ffb689eab10ea63f24c5f489a92e2b49e44ae Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 16 Dec 2009 03:07:12 +0000 Subject: Add an addition check for undefined behavior for when we hit a __builtin_unreachable. WIP. llvm-svn: 91499 --- clang/lib/CodeGen/CGBuiltin.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CGBuiltin.cpp') diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index c70443245c7..96bc3ef62cb 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/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); -- cgit v1.2.3