From afb785f51161b78b9af7d9ecd3ce7632160efee9 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 2 Aug 2022 00:47:36 -0700 Subject: [PATCH] [Driver] Remove Separate form for XRay options Supporting something like `-fxray-instruction-threshold= 1` is not intended. --- clang/include/clang/Driver/Options.td | 15 ++++++--------- clang/lib/Driver/XRayArgs.cpp | 3 +-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index e37b461c95cb..709dbfd12cdb 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -2032,31 +2032,28 @@ defm xray_instrument : BoolFOption<"xray-instrument", NegFlag>; def fxray_instruction_threshold_EQ : - JoinedOrSeparate<["-"], "fxray-instruction-threshold=">, + Joined<["-"], "fxray-instruction-threshold=">, Group, Flags<[CC1Option]>, HelpText<"Sets the minimum function size to instrument with XRay">, MarshallingInfoInt, "200">; -def fxray_instruction_threshold_ : - JoinedOrSeparate<["-"], "fxray-instruction-threshold">, - Group, Flags<[CC1Option]>; def fxray_always_instrument : - JoinedOrSeparate<["-"], "fxray-always-instrument=">, + Joined<["-"], "fxray-always-instrument=">, Group, Flags<[CC1Option]>, HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">, MarshallingInfoStringVector>; def fxray_never_instrument : - JoinedOrSeparate<["-"], "fxray-never-instrument=">, + Joined<["-"], "fxray-never-instrument=">, Group, Flags<[CC1Option]>, HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">, MarshallingInfoStringVector>; def fxray_attr_list : - JoinedOrSeparate<["-"], "fxray-attr-list=">, + Joined<["-"], "fxray-attr-list=">, Group, Flags<[CC1Option]>, HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">, MarshallingInfoStringVector>; def fxray_modes : - JoinedOrSeparate<["-"], "fxray-modes=">, + Joined<["-"], "fxray-modes=">, Group, Flags<[CC1Option]>, HelpText<"List of modes to link in by default into XRay instrumented binaries.">; @@ -2091,7 +2088,7 @@ def fnoxray_link_deps : Flag<["-"], "fnoxray-link-deps">, Group, Flags<[CC1Option]>; def fxray_instrumentation_bundle : - JoinedOrSeparate<["-"], "fxray-instrumentation-bundle=">, + Joined<["-"], "fxray-instrumentation-bundle=">, Group, Flags<[CC1Option]>, HelpText<"Select which XRay instrumentation points to emit. Options: all, none, function-entry, function-exit, function, custom. Default is 'all'. 'function' includes both 'function-entry' and 'function-exit'.">; diff --git a/clang/lib/Driver/XRayArgs.cpp b/clang/lib/Driver/XRayArgs.cpp index 63b575178bd1..cf9b5780c455 100644 --- a/clang/lib/Driver/XRayArgs.cpp +++ b/clang/lib/Driver/XRayArgs.cpp @@ -79,8 +79,7 @@ XRayArgs::XRayArgs(const ToolChain &TC, const ArgList &Args) { XRayInstrument = true; if (const Arg *A = - Args.getLastArg(options::OPT_fxray_instruction_threshold_, - options::OPT_fxray_instruction_threshold_EQ)) { + Args.getLastArg(options::OPT_fxray_instruction_threshold_EQ)) { StringRef S = A->getValue(); if (S.getAsInteger(0, InstructionThreshold) || InstructionThreshold < 0) D.Diag(clang::diag::err_drv_invalid_value) << A->getAsString(Args) << S;