Skip to content

Commit eeb4266

Browse files
xtkobabrad0
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
1 parent b8c6b15 commit eeb4266

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
@@ -48,8 +48,6 @@ class LLVM_LIBRARY_VISIBILITY SparcTargetInfo : public TargetInfo {
4848

4949
bool hasFeature(StringRef Feature) const override;
5050

51-
bool hasSjLjLowering() const override { return true; }
52-
5351
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
5452
// FIXME: Implement!
5553
return None;
@@ -178,7 +176,6 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo {
178176
void getTargetDefines(const LangOptions &Opts,
179177
MacroBuilder &Builder) const override;
180178

181-
bool hasSjLjLowering() const override { return true; }
182179
bool hasExtIntType() const override { return true; }
183180
};
184181

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)