This revision was automatically updated to reflect the committed changes.
Closed by commit rC342358: [Lexer] Add xray_instrument feature (authored by 
phosek, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52159?vs=165705&id=165712#toc

Repository:
  rC Clang

https://reviews.llvm.org/D52159

Files:
  include/clang/Basic/Features.def
  test/Lexer/has_feature_xray_instrument.cpp


Index: include/clang/Basic/Features.def
===================================================================
--- include/clang/Basic/Features.def
+++ include/clang/Basic/Features.def
@@ -37,6 +37,7 @@
 FEATURE(hwaddress_sanitizer,
         LangOpts.Sanitize.hasOneOf(SanitizerKind::HWAddress |
                                    SanitizerKind::KernelHWAddress))
+FEATURE(xray_instrument, LangOpts.XRayInstrument)
 FEATURE(assume_nonnull, true)
 FEATURE(attribute_analyzer_noreturn, true)
 FEATURE(attribute_availability, true)
Index: test/Lexer/has_feature_xray_instrument.cpp
===================================================================
--- test/Lexer/has_feature_xray_instrument.cpp
+++ test/Lexer/has_feature_xray_instrument.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -E -fxray-instrument %s -o - | FileCheck 
--check-prefix=CHECK-XRAY %s
+// RUN: %clang_cc1 -E  %s -o - | FileCheck --check-prefix=CHECK-NO-XRAY %s
+
+#if __has_feature(xray_instrument)
+int XRayInstrumentEnabled();
+#else
+int XRayInstrumentDisabled();
+#endif
+
+// CHECK-XRAY: XRayInstrumentEnabled
+// CHECK-NO-XRAY: XRayInstrumentDisabled


Index: include/clang/Basic/Features.def
===================================================================
--- include/clang/Basic/Features.def
+++ include/clang/Basic/Features.def
@@ -37,6 +37,7 @@
 FEATURE(hwaddress_sanitizer,
         LangOpts.Sanitize.hasOneOf(SanitizerKind::HWAddress |
                                    SanitizerKind::KernelHWAddress))
+FEATURE(xray_instrument, LangOpts.XRayInstrument)
 FEATURE(assume_nonnull, true)
 FEATURE(attribute_analyzer_noreturn, true)
 FEATURE(attribute_availability, true)
Index: test/Lexer/has_feature_xray_instrument.cpp
===================================================================
--- test/Lexer/has_feature_xray_instrument.cpp
+++ test/Lexer/has_feature_xray_instrument.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -E -fxray-instrument %s -o - | FileCheck --check-prefix=CHECK-XRAY %s
+// RUN: %clang_cc1 -E  %s -o - | FileCheck --check-prefix=CHECK-NO-XRAY %s
+
+#if __has_feature(xray_instrument)
+int XRayInstrumentEnabled();
+#else
+int XRayInstrumentDisabled();
+#endif
+
+// CHECK-XRAY: XRayInstrumentEnabled
+// CHECK-NO-XRAY: XRayInstrumentDisabled
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to