Skip to content

Commit 578e500

Browse files
xtkobatstellar
authored andcommitted
[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 eeb4266)
1 parent cd4ebb2 commit 578e500

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

clang/lib/Basic/Targets/Sparc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class LLVM_LIBRARY_VISIBILITY SparcTargetInfo : public TargetInfo {
5050

5151
bool hasFeature(StringRef Feature) const override;
5252

53-
bool hasSjLjLowering() const override { return true; }
54-
5553
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
5654
// FIXME: Implement!
5755
return None;
@@ -180,7 +178,6 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo {
180178
void getTargetDefines(const LangOptions &Opts,
181179
MacroBuilder &Builder) const override;
182180

183-
bool hasSjLjLowering() const override { return true; }
184181
bool hasExtIntType() const override { return true; }
185182
};
186183

clang/test/Sema/builtin-longjmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
// RUN: %clang_cc1 -triple x86_64-windows -emit-llvm < %s| FileCheck %s
44
// RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm < %s| FileCheck %s
55
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm < %s| FileCheck %s
6-
// RUN: %clang_cc1 -triple sparc-eabi-unknown -emit-llvm < %s | FileCheck %s
76
// RUN: %clang_cc1 -triple ve-unknown-unknown -emit-llvm < %s | FileCheck %s
87

98
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm-only -verify %s
109
// RUN: %clang_cc1 -triple mips-unknown-unknown -emit-llvm-only -verify %s
1110
// RUN: %clang_cc1 -triple mips64-unknown-unknown -emit-llvm-only -verify %s
11+
// RUN: %clang_cc1 -triple sparc-eabi-unknown -emit-llvm-only -verify %s
1212

1313
// Check that __builtin_longjmp and __builtin_setjmp are lowered into
1414
// IR intrinsics on those architectures that can handle them.

0 commit comments

Comments
 (0)