[clang] eeb4266 - [Sparc] Create an error when `__builtin_longjmp` is used
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 3 20:41:59 PST 2021
Author: Tee KOBAYASHI
Date: 2021-12-03T23:41:50-05:00
New Revision: eeb4266f8137c232f0f218a727dd12b5d4f52adc
URL: https://github.com/llvm/llvm-project/commit/eeb4266f8137c232f0f218a727dd12b5d4f52adc
DIFF: https://github.com/llvm/llvm-project/commit/eeb4266f8137c232f0f218a727dd12b5d4f52adc.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
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 22a1621fcb9fe..badb568dfb805 100644
--- a/clang/lib/Basic/Targets/Sparc.h
+++ b/clang/lib/Basic/Targets/Sparc.h
@@ -48,8 +48,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;
@@ -178,7 +176,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 cfe-commits
mailing list