summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index d3d1e22b4bb..014ea9d9392 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -859,8 +859,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
return RValue::get(Builder.CreateZExt(Result, Int64Ty, "extend.zext"));
}
case Builtin::BI__builtin_setjmp: {
- if (!getTargetHooks().hasSjLjLowering(*this))
- break;
+ if (!getTargetHooks().hasSjLjLowering(*this)) {
+ CGM.ErrorUnsupported(E, "__builtin_setjmp");
+ return RValue::get(nullptr);
+ }
+
// Buffer is a void**.
Value *Buf = EmitScalarExpr(E->getArg(0));
@@ -883,8 +886,10 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
return RValue::get(Builder.CreateCall(F, Buf));
}
case Builtin::BI__builtin_longjmp: {
- if (!getTargetHooks().hasSjLjLowering(*this))
- break;
+ if (!getTargetHooks().hasSjLjLowering(*this)) {
+ CGM.ErrorUnsupported(E, "__builtin_longjmp");
+ return RValue::get(nullptr);
+ }
Value *Buf = EmitScalarExpr(E->getArg(0));
Buf = Builder.CreateBitCast(Buf, Int8PtrTy);
OpenPOWER on IntegriCloud