defm xray_ignore_loops : OptInFFlag<"xray-ignore-loops",
"Don't instrument functions with loops unless they also meet the minimum function size">;
-
-def fxray_function_index : Flag<["-"], "fxray-function-index">,
- Group<f_Group>, Flags<[CC1Option]>;
-def fno_xray_function_index : Flag<["-"], "fno-xray-function-index">,
- Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Omit the xray index section to reduce binary size at the expense of single-function patching performance">;
+defm xray_function_index : OptOutFFlag<"xray-function-index", "",
+ "Omit function index section at the expense of single-function patching performance">;
def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group<f_Group>,
Flags<[CC1Option]>,
bool XRayAlwaysEmitTypedEvents = false;
bool XRayRT = true;
bool XRayIgnoreLoops = false;
- bool XRayOmitFunctionIndex = false;
+ bool XRayFunctionIndex;
public:
/// Parses the XRay arguments from an argument list.
options::OPT_fno_xray_ignore_loops, false))
XRayIgnoreLoops = true;
- if (!Args.hasFlag(options::OPT_fxray_function_index,
- options::OPT_fno_xray_function_index, true))
- XRayOmitFunctionIndex = true;
+ XRayFunctionIndex = Args.hasFlag(options::OPT_fxray_function_index,
+ options::OPT_fno_xray_function_index, true);
auto Bundles =
Args.getAllArgValues(options::OPT_fxray_instrumentation_bundle);
if (XRayIgnoreLoops)
CmdArgs.push_back("-fxray-ignore-loops");
- if (XRayOmitFunctionIndex)
+ if (!XRayFunctionIndex)
CmdArgs.push_back("-fno-xray-function-index");
CmdArgs.push_back(Args.MakeArgString(Twine(XRayInstructionThresholdOption) +
// options respect the -fno-xray-function-index flag we provide in the
// invocation. The default should be to *include* the function index.
//
-// RUN: %clang -fxray-instrument -fxray-function-index -target x86_64-linux- -### \
-// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
-// RUN: | FileCheck %s
+// RUN: %clang -### -fxray-instrument -target x86_64 -c %s 2>&1 | FileCheck %s
+// RUN: %clang -### -fxray-instrument -target x86_64 -fxray-function-index -c %s 2>&1 | FileCheck %s
+
// CHECK-NOT: -fno-xray-function-index
-//
-// RUN: %clang -fxray-instrument -target x86_64-linux- -### \
-// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
-// RUN: | FileCheck %s -check-prefix CHECK-DEFAULT
-// CHECK-DEFAULT-NOT: -fno-xray-function-index
-//
-// RUN: %clang -fxray-instrument -fno-xray-function-index -target x86_64-linux- -### \
-// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
-// RUN: | FileCheck %s -check-prefix CHECK-DISABLED
+
+// RUN: %clang -### -fxray-instrument -target x86_64 -fno-xray-function-index -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-DISABLED
+
// CHECK-DISABLED: -fno-xray-function-index
-//
-// REQUIRES: x86_64 || x86_64h
// invocation.
//
// RUN: %clang -fxray-instrument -fxray-ignore-loops -target x86_64-linux- -### \
-// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
-// RUN: | FileCheck %s
+// RUN: -x c++ -emit-llvm -c -o - %s 2>&1 | FileCheck %s
// CHECK: -fxray-ignore-loops
//
// REQUIRES: x86_64 || x86_64h
// invocation.
//
// RUN: %clang -fxray-instrument -fxray-instrumentation-bundle=function -### \
-// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \
-// RUN: | FileCheck %s
+// RUN: -c -o - %s 2>&1 | FileCheck %s
// CHECK: -fxray-instrumentation-bundle=function
//
// REQUIRES: linux || freebsd