Skip to content

Commit fded769

Browse files
committed
PiJoules suggestions
1 parent 7da5378 commit fded769

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

clang/include/clang/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ FEATURE(is_trivially_assignable, LangOpts.CPlusPlus)
303303
FEATURE(is_trivially_constructible, LangOpts.CPlusPlus)
304304
FEATURE(is_trivially_copyable, LangOpts.CPlusPlus)
305305
FEATURE(is_union, LangOpts.CPlusPlus)
306-
FEATURE(cfi_sanitizer, LangOpts.Sanitize.hasOneOf(SanitizerKind::CFI | SanitizerKind::CFICastStrict | SanitizerKind::KCFI))
306+
FEATURE(cfi_sanitizer, LangOpts.Sanitize.hasOneOf(SanitizerKind::CFI))
307307
FEATURE(cfi_cast_strict_sanitizer, LangOpts.Sanitize.has(SanitizerKind::CFICastStrict))
308308
FEATURE(cfi_derived_cast_sanitizer, LangOpts.Sanitize.has(SanitizerKind::CFIDerivedCast))
309309
FEATURE(cfi_icall_sanitizer, LangOpts.Sanitize.has(SanitizerKind::CFIICall))

clang/test/Lexer/has_feature_cfi.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// RUN: %clang -E -fvisibility=hidden -flto -fno-sanitize-ignorelist -fsanitize=cfi -c %s -o - | FileCheck %s --check-prefix=CHECK-CFI
22
// RUN: %clang -E -fvisibility=hidden -flto -fno-sanitize-ignorelist -fsanitize=cfi -fsanitize-cfi-cross-dso -c %s -o - | FileCheck %s --check-prefix=CHECK-CFI
33
// RUN: %clang -E -fvisibility=hidden -flto -fno-sanitize-ignorelist -fsanitize=cfi -fno-sanitize=cfi-nvcall,cfi-vcall,cfi-mfcall,cfi-icall -c %s -o - | FileCheck %s --check-prefix=CHECK-CFI
4-
// RUN: %clang -E -fsanitize=kcfi -c %s -o - | FileCheck %s --check-prefix=CHECK-CFI
54
// CHECK-CFI: CFISanitizerEnabled
65

76
// RUN: %clang -E -c %s -o - | FileCheck %s --check-prefix=CHECK-NO-CFI
87
// CHECK-NO-CFI: CFISanitizerDisabled
98

10-
// RUN: %clang -E -fsanitize=cfi-cast-strict -c %s -o - | FileCheck %s --check-prefixes=CHECK-CFI,CHECK-CFI-CAST-STRICT
9+
// RUN: %clang -E -fsanitize=kcfi -c %s -o - | FileCheck %s --check-prefixes=CHECK-KCFI,CHECK-NO-CFI
10+
// CHECK-KCFI: KCFISanitizerEnabled
11+
12+
// RUN: %clang -E -fsanitize=cfi-cast-strict -c %s -o - | FileCheck %s --check-prefix=CHECK-CFI-CAST-STRICT
1113
// CHECK-CFI-CAST-STRICT: CFICastStrictSanitizerEnabled
1214

1315
// RUN: %clang -E -fvisibility=hidden -flto -fno-sanitize-ignorelist -fsanitize=cfi-derived-cast -c %s -o - | FileCheck %s --check-prefixes=CHECK-CFI,CHECK-CFI-DERIVED-CAST
@@ -34,6 +36,12 @@ int CFISanitizerEnabled();
3436
int CFISanitizerDisabled();
3537
#endif
3638

39+
#if __has_feature(kcfi)
40+
int KCFISanitizerEnabled();
41+
#else
42+
int KCFISanitizerDisabled();
43+
#endif
44+
3745
#if __has_feature(cfi_cast_strict_sanitizer)
3846
int CFICastStrictSanitizerEnabled();
3947
#else

0 commit comments

Comments
 (0)