summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp13
-rw-r--r--clang/lib/CodeGen/TargetInfo.h5
2 files changed, 11 insertions, 7 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);
diff --git a/clang/lib/CodeGen/TargetInfo.h b/clang/lib/CodeGen/TargetInfo.h
index 87f13760e8e..0c3fdc3c8ac 100644
--- a/clang/lib/CodeGen/TargetInfo.h
+++ b/clang/lib/CodeGen/TargetInfo.h
@@ -226,9 +226,8 @@ public:
return 0;
}
- /// Control whether __builtin_longjmp / __builtin_setjmp are lowered to
- /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp or the normal library
- /// function.
+ /// Control if __builtin_longjmp / __builtin_setjmp can be lowered to
+ /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp.
virtual bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const {
return false;
}
OpenPOWER on IntegriCloud