Add an addition check for undefined behavior for when we hit a

__builtin_unreachable.  WIP.

llvm-svn: 91499
This commit is contained in:
Mike Stump 2009-12-16 03:07:12 +00:00
parent 3f6f9febad
commit b85ffb689e
1 changed files with 2 additions and 0 deletions

View File

@ -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);