[llvm-branch-commits] [clang] 578e500 - [Sparc] Create an error when `__builtin_longjmp` is used
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Dec 20 10:25:41 PST 2021
Author: Tee KOBAYASHI
Date: 2021-12-20T10:25:14-08:00
New Revision: 578e500fe5ba0abbb1ed212db720ce22aa2147d2
URL: https://github.com/llvm/llvm-project/commit/578e500fe5ba0abbb1ed212db720ce22aa2147d2
DIFF: https://github.com/llvm/llvm-project/commit/578e500fe5ba0abbb1ed212db720ce22aa2147d2.diff
LOG: [Sparc] Create an error when `__builtin_longjmp` is used
Support for builtin setjmp/longjmp was removed by https://reviews.llvm.org/D51487. An
error should be created when compiling C code using __builtin_setjmp or __builtin_longjmp.
Reviewed By: dcederman
Differential Revision: https://reviews.llvm.org/D108901
(cherry picked from commit eeb4266f8137c232f0f218a727dd12b5d4f52adc)
Added:
Modified:
clang/lib/Basic/Targets/Sparc.h
clang/test/Sema/builtin-longjmp.c
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/Sparc.h b/clang/lib/Basic/Targets/Sparc.h
index 07844abafe11b..e9f8c10db7b04 100644
--- a/clang/lib/Basic/Targets/Sparc.h
+++ b/clang/lib/Basic/Targets/Sparc.h
@@ -50,8 +50,6 @@ class LLVM_LIBRARY_VISIBILITY SparcTargetInfo : public TargetInfo {
bool hasFeature(StringRef Feature) const override;
- bool hasSjLjLowering() const override { return true; }
-
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
// FIXME: Implement!
return None;
@@ -180,7 +178,6 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo {
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override;
- bool hasSjLjLowering() const override { return true; }
bool hasExtIntType() const override { return true; }
};
diff --git a/clang/test/Sema/builtin-longjmp.c b/clang/test/Sema/builtin-longjmp.c
index 3023098a76310..99463cf3385a1 100644
--- a/clang/test/Sema/builtin-longjmp.c
+++ b/clang/test/Sema/builtin-longjmp.c
@@ -3,12 +3,12 @@
// RUN: %clang_cc1 -triple x86_64-windows -emit-llvm < %s| FileCheck %s
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm < %s| FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm < %s| FileCheck %s
-// RUN: %clang_cc1 -triple sparc-eabi-unknown -emit-llvm < %s | FileCheck %s
// RUN: %clang_cc1 -triple ve-unknown-unknown -emit-llvm < %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm-only -verify %s
// RUN: %clang_cc1 -triple mips-unknown-unknown -emit-llvm-only -verify %s
// RUN: %clang_cc1 -triple mips64-unknown-unknown -emit-llvm-only -verify %s
+// RUN: %clang_cc1 -triple sparc-eabi-unknown -emit-llvm-only -verify %s
// Check that __builtin_longjmp and __builtin_setjmp are lowered into
// IR intrinsics on those architectures that can handle them.
More information about the llvm-branch-commits
mailing list