Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options

This commit is contained in:
Fangrui Song 2022-06-05 01:07:50 -07:00
parent d86a206f06
commit 95a134254a
45 changed files with 98 additions and 117 deletions

View File

@ -109,7 +109,7 @@ static cl::list<std::string>
cl::cat(ClangLinkerWrapperCategory)); cl::cat(ClangLinkerWrapperCategory));
static cl::list<std::string> static cl::list<std::string>
LinkerArgs("device-linker", cl::ZeroOrMore, LinkerArgs("device-linker",
cl::desc("Arguments to pass to the device linker invocation"), cl::desc("Arguments to pass to the device linker invocation"),
cl::value_desc("<value> or <triple>=<value>"), cl::value_desc("<value> or <triple>=<value>"),
cl::cat(ClangLinkerWrapperCategory)); cl::cat(ClangLinkerWrapperCategory));

View File

@ -74,7 +74,7 @@ static cl::opt<bool> Inplace("i", cl::desc("Overwrite edited <file>s."),
static cl::list<std::string> static cl::list<std::string>
QualifiedNames("qualified-name", QualifiedNames("qualified-name",
cl::desc("The fully qualified name of the symbol."), cl::desc("The fully qualified name of the symbol."),
cl::ZeroOrMore, cl::cat(ClangRenameOptions)); cl::cat(ClangRenameOptions));
static cl::list<std::string> static cl::list<std::string>
NewNames("new-name", cl::desc("The new name to change the symbol to."), NewNames("new-name", cl::desc("The new name to change the symbol to."),

View File

@ -105,7 +105,7 @@ static cl::list<std::string> InputFiles(cl::Positional, cl::OneOrMore,
// Command line arguments to pass to the JITed main function. // Command line arguments to pass to the JITed main function.
static cl::list<std::string> InputArgv("args", cl::Positional, static cl::list<std::string> InputArgv("args", cl::Positional,
cl::desc("<program arguments>..."), cl::desc("<program arguments>..."),
cl::ZeroOrMore, cl::PositionalEatsArgs); cl::PositionalEatsArgs);
// Given paths must exist on the remote target. // Given paths must exist on the remote target.
static cl::list<std::string> static cl::list<std::string>

View File

@ -146,8 +146,8 @@ static cl::opt<int> SwpLoopLimit("pipeliner-max", cl::Hidden, cl::init(-1));
#endif #endif
static cl::opt<bool> SwpIgnoreRecMII("pipeliner-ignore-recmii", static cl::opt<bool> SwpIgnoreRecMII("pipeliner-ignore-recmii",
cl::ReallyHidden, cl::init(false), cl::ReallyHidden,
cl::ZeroOrMore, cl::desc("Ignore RecMII")); cl::desc("Ignore RecMII"));
static cl::opt<bool> SwpShowResMask("pipeliner-show-mask", cl::Hidden, static cl::opt<bool> SwpShowResMask("pipeliner-show-mask", cl::Hidden,
cl::init(false)); cl::init(false));

View File

@ -115,20 +115,18 @@ static cl::opt<bool> PrintGCInfo("print-gc", cl::Hidden,
cl::desc("Dump garbage collector data")); cl::desc("Dump garbage collector data"));
static cl::opt<cl::boolOrDefault> static cl::opt<cl::boolOrDefault>
VerifyMachineCode("verify-machineinstrs", cl::Hidden, VerifyMachineCode("verify-machineinstrs", cl::Hidden,
cl::desc("Verify generated machine code"), cl::desc("Verify generated machine code"));
cl::ZeroOrMore); static cl::opt<cl::boolOrDefault>
static cl::opt<cl::boolOrDefault> DebugifyAndStripAll( DebugifyAndStripAll("debugify-and-strip-all-safe", cl::Hidden,
"debugify-and-strip-all-safe", cl::Hidden, cl::desc("Debugify MIR before and Strip debug after "
cl::desc( "each pass except those known to be unsafe "
"Debugify MIR before and Strip debug after " "when debug info is present"));
"each pass except those known to be unsafe when debug info is present"),
cl::ZeroOrMore);
static cl::opt<cl::boolOrDefault> DebugifyCheckAndStripAll( static cl::opt<cl::boolOrDefault> DebugifyCheckAndStripAll(
"debugify-check-and-strip-all-safe", cl::Hidden, "debugify-check-and-strip-all-safe", cl::Hidden,
cl::desc( cl::desc(
"Debugify MIR before, by checking and stripping the debug info after, " "Debugify MIR before, by checking and stripping the debug info after, "
"each pass except those known to be unsafe when debug info is present"), "each pass except those known to be unsafe when debug info is "
cl::ZeroOrMore); "present"));
// Enable or disable the MachineOutliner. // Enable or disable the MachineOutliner.
static cl::opt<RunOutliner> EnableMachineOutliner( static cl::opt<RunOutliner> EnableMachineOutliner(
"enable-machine-outliner", cl::desc("Enable the machine outliner"), "enable-machine-outliner", cl::desc("Enable the machine outliner"),

View File

@ -45,7 +45,7 @@ static cl::opt<bool> IgnoreBBRegPressure("ignore-bb-reg-pressure", cl::Hidden,
cl::init(false)); cl::init(false));
static cl::opt<bool> UseNewerCandidate("use-newer-candidate", cl::Hidden, static cl::opt<bool> UseNewerCandidate("use-newer-candidate", cl::Hidden,
cl::ZeroOrMore, cl::init(true)); cl::init(true));
static cl::opt<unsigned> SchedDebugVerboseLevel("misched-verbose-level", static cl::opt<unsigned> SchedDebugVerboseLevel("misched-verbose-level",
cl::Hidden, cl::init(1)); cl::Hidden, cl::init(1));

View File

@ -47,8 +47,7 @@ static cl::opt<PassRemarksOpt, true, cl::parser<std::string>> PassRemarks(
"pass-remarks", cl::value_desc("pattern"), "pass-remarks", cl::value_desc("pattern"),
cl::desc("Enable optimization remarks from passes whose name match " cl::desc("Enable optimization remarks from passes whose name match "
"the given regular expression"), "the given regular expression"),
cl::Hidden, cl::location(PassRemarksPassedOptLoc), cl::ValueRequired, cl::Hidden, cl::location(PassRemarksPassedOptLoc), cl::ValueRequired);
cl::ZeroOrMore);
// -pass-remarks-missed // -pass-remarks-missed
// Command line flag to enable emitOptimizationRemarkMissed() // Command line flag to enable emitOptimizationRemarkMissed()
@ -56,8 +55,7 @@ static cl::opt<PassRemarksOpt, true, cl::parser<std::string>> PassRemarksMissed(
"pass-remarks-missed", cl::value_desc("pattern"), "pass-remarks-missed", cl::value_desc("pattern"),
cl::desc("Enable missed optimization remarks from passes whose name match " cl::desc("Enable missed optimization remarks from passes whose name match "
"the given regular expression"), "the given regular expression"),
cl::Hidden, cl::location(PassRemarksMissedOptLoc), cl::ValueRequired, cl::Hidden, cl::location(PassRemarksMissedOptLoc), cl::ValueRequired);
cl::ZeroOrMore);
// -pass-remarks-analysis // -pass-remarks-analysis
// Command line flag to enable emitOptimizationRemarkAnalysis() // Command line flag to enable emitOptimizationRemarkAnalysis()
@ -67,8 +65,7 @@ static cl::opt<PassRemarksOpt, true, cl::parser<std::string>>
cl::desc( cl::desc(
"Enable optimization analysis remarks from passes whose name match " "Enable optimization analysis remarks from passes whose name match "
"the given regular expression"), "the given regular expression"),
cl::Hidden, cl::location(PassRemarksAnalysisOptLoc), cl::ValueRequired, cl::Hidden, cl::location(PassRemarksAnalysisOptLoc), cl::ValueRequired);
cl::ZeroOrMore);
} }
bool DiagnosticHandler::isAnalysisRemarkEnabled(StringRef PassName) const { bool DiagnosticHandler::isAnalysisRemarkEnabled(StringRef PassName) const {

View File

@ -49,8 +49,7 @@ struct CreateDebugCounterOption {
return new DebugCounterList( return new DebugCounterList(
"debug-counter", cl::Hidden, "debug-counter", cl::Hidden,
cl::desc("Comma separated list of debug counter skip and count"), cl::desc("Comma separated list of debug counter skip and count"),
cl::CommaSeparated, cl::ZeroOrMore, cl::CommaSeparated, cl::location(DebugCounter::instance()));
cl::location(DebugCounter::instance()));
} }
}; };
} // namespace } // namespace

View File

@ -21,11 +21,10 @@ struct CreateScalableErrorAsWarning {
/// using the wrong interface on a scalable vector. /// using the wrong interface on a scalable vector.
static void *call() { static void *call() {
return new cl::opt<bool>( return new cl::opt<bool>(
"treat-scalable-fixed-error-as-warning", cl::Hidden, cl::init(false), "treat-scalable-fixed-error-as-warning", cl::Hidden,
cl::desc( cl::desc(
"Treat issues where a fixed-width property is requested from a " "Treat issues where a fixed-width property is requested from a "
"scalable type as a warning, instead of an error."), "scalable type as a warning, instead of an error"));
cl::ZeroOrMore);
} }
}; };
} // namespace } // namespace

View File

@ -28,10 +28,10 @@
#define GET_INSTRMAP_INFO #define GET_INSTRMAP_INFO
#include "AMDGPUGenInstrInfo.inc" #include "AMDGPUGenInstrInfo.inc"
static llvm::cl::opt<unsigned> AmdhsaCodeObjectVersion( static llvm::cl::opt<unsigned>
"amdhsa-code-object-version", llvm::cl::Hidden, AmdhsaCodeObjectVersion("amdhsa-code-object-version", llvm::cl::Hidden,
llvm::cl::desc("AMDHSA Code Object Version"), llvm::cl::init(4), llvm::cl::desc("AMDHSA Code Object Version"),
llvm::cl::ZeroOrMore); llvm::cl::init(4));
namespace { namespace {

View File

@ -54,8 +54,7 @@ using namespace llvm;
static cl::opt<bool> OptSpeculate("commgep-speculate", cl::init(true), static cl::opt<bool> OptSpeculate("commgep-speculate", cl::init(true),
cl::Hidden); cl::Hidden);
static cl::opt<bool> OptEnableInv("commgep-inv", cl::init(true), cl::Hidden, static cl::opt<bool> OptEnableInv("commgep-inv", cl::init(true), cl::Hidden);
cl::ZeroOrMore);
static cl::opt<bool> OptEnableConst("commgep-const", cl::init(true), static cl::opt<bool> OptEnableConst("commgep-const", cl::init(true),
cl::Hidden); cl::Hidden);

View File

@ -152,9 +152,10 @@ using namespace llvm;
static cl::opt<bool> DisableDeallocRet("disable-hexagon-dealloc-ret", static cl::opt<bool> DisableDeallocRet("disable-hexagon-dealloc-ret",
cl::Hidden, cl::desc("Disable Dealloc Return for Hexagon target")); cl::Hidden, cl::desc("Disable Dealloc Return for Hexagon target"));
static cl::opt<unsigned> NumberScavengerSlots("number-scavenger-slots", static cl::opt<unsigned>
cl::Hidden, cl::desc("Set the number of scavenger slots"), cl::init(2), NumberScavengerSlots("number-scavenger-slots", cl::Hidden,
cl::ZeroOrMore); cl::desc("Set the number of scavenger slots"),
cl::init(2));
static cl::opt<int> static cl::opt<int>
SpillFuncThreshold("spill-func-threshold", cl::Hidden, SpillFuncThreshold("spill-func-threshold", cl::Hidden,

View File

@ -72,14 +72,11 @@ static cl::opt<bool>
cl::desc("Enable detailed timing of insert " cl::desc("Enable detailed timing of insert "
"generation")); "generation"));
static cl::opt<bool> OptSelectAll0("insert-all0", cl::init(false), cl::Hidden, static cl::opt<bool> OptSelectAll0("insert-all0", cl::init(false), cl::Hidden);
cl::ZeroOrMore); static cl::opt<bool> OptSelectHas0("insert-has0", cl::init(false), cl::Hidden);
static cl::opt<bool> OptSelectHas0("insert-has0", cl::init(false), cl::Hidden,
cl::ZeroOrMore);
// Whether to construct constant values via "insert". Could eliminate constant // Whether to construct constant values via "insert". Could eliminate constant
// extenders, but often not practical. // extenders, but often not practical.
static cl::opt<bool> OptConst("insert-const", cl::init(false), cl::Hidden, static cl::opt<bool> OptConst("insert-const", cl::init(false), cl::Hidden);
cl::ZeroOrMore);
// The preprocessor gets confused when the DEBUG macro is passed larger // The preprocessor gets confused when the DEBUG macro is passed larger
// chunks of code. Use this function to detect debugging. // chunks of code. Use this function to detect debugging.

View File

@ -129,7 +129,7 @@ static cl::list<std::string> FunctionSeedAllowList(
"attributor-function-seed-allow-list", cl::Hidden, "attributor-function-seed-allow-list", cl::Hidden,
cl::desc("Comma seperated list of function names that are " cl::desc("Comma seperated list of function names that are "
"allowed to be seeded."), "allowed to be seeded."),
cl::ZeroOrMore, cl::CommaSeparated); cl::CommaSeparated);
#endif #endif
static cl::opt<bool> static cl::opt<bool>

View File

@ -202,8 +202,7 @@ static cl::opt<bool> ClUseShortGranules(
static cl::opt<bool> ClInstrumentPersonalityFunctions( static cl::opt<bool> ClInstrumentPersonalityFunctions(
"hwasan-instrument-personality-functions", "hwasan-instrument-personality-functions",
cl::desc("instrument personality functions"), cl::Hidden, cl::init(false), cl::desc("instrument personality functions"), cl::Hidden);
cl::ZeroOrMore);
static cl::opt<bool> ClInlineAllChecks("hwasan-inline-all-checks", static cl::opt<bool> ClInlineAllChecks("hwasan-inline-all-checks",
cl::desc("inline all checks"), cl::desc("inline all checks"),

View File

@ -118,7 +118,7 @@ cl::opt<bool> DoCounterPromotion("do-counter-promotion",
cl::desc("Do counter register promotion"), cl::desc("Do counter register promotion"),
cl::init(false)); cl::init(false));
cl::opt<unsigned> MaxNumOfPromotionsPerLoop( cl::opt<unsigned> MaxNumOfPromotionsPerLoop(
cl::ZeroOrMore, "max-counter-promotions-per-loop", cl::init(20), "max-counter-promotions-per-loop", cl::init(20),
cl::desc("Max number counter promotions per loop to avoid" cl::desc("Max number counter promotions per loop to avoid"
" increasing register pressure too much")); " increasing register pressure too much"));

View File

@ -117,7 +117,7 @@ static cl::opt<FusionDependenceAnalysisChoice> FusionDependenceAnalysis(
"Use the dependence analysis interface"), "Use the dependence analysis interface"),
clEnumValN(FUSION_DEPENDENCE_ANALYSIS_ALL, "all", clEnumValN(FUSION_DEPENDENCE_ANALYSIS_ALL, "all",
"Use all available analyses")), "Use all available analyses")),
cl::Hidden, cl::init(FUSION_DEPENDENCE_ANALYSIS_ALL), cl::ZeroOrMore); cl::Hidden, cl::init(FUSION_DEPENDENCE_ANALYSIS_ALL));
static cl::opt<unsigned> FusionPeelMaxCount( static cl::opt<unsigned> FusionPeelMaxCount(
"loop-fusion-peel-max-count", cl::init(0), cl::Hidden, "loop-fusion-peel-max-count", cl::init(0), cl::Hidden,

View File

@ -119,7 +119,7 @@ cl::list<std::string> ToolArgv("tool-args", cl::Positional,
cl::list<std::string> SafeToolArgv("safe-tool-args", cl::Positional, cl::list<std::string> SafeToolArgv("safe-tool-args", cl::Positional,
cl::desc("<safe-tool arguments>..."), cl::desc("<safe-tool arguments>..."),
cl::ZeroOrMore, cl::PositionalEatsArgs); cl::PositionalEatsArgs);
cl::opt<std::string> CCBinary("gcc", cl::init(""), cl::opt<std::string> CCBinary("gcc", cl::init(""),
cl::desc("The gcc binary to use.")); cl::desc("The gcc binary to use."));

View File

@ -144,8 +144,7 @@ namespace {
"-extra-module arguments.")); "-extra-module arguments."));
cl::list<std::string> cl::list<std::string>
Dylibs("dlopen", cl::desc("Dynamic libraries to load before linking"), Dylibs("dlopen", cl::desc("Dynamic libraries to load before linking"));
cl::ZeroOrMore);
// The MCJIT supports building for a target address space separate from // The MCJIT supports building for a target address space separate from
// the JIT compilation process. Use a forked process and a copying // the JIT compilation process. Use a forked process and a copying

View File

@ -671,7 +671,7 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
"name-allowlist", cl::Optional, "name-allowlist", cl::Optional,
cl::desc("Show code coverage only for functions listed in the given " cl::desc("Show code coverage only for functions listed in the given "
"file"), "file"),
cl::ZeroOrMore, cl::cat(FilteringCategory)); cl::cat(FilteringCategory));
// Allow for accepting previous option name. // Allow for accepting previous option name.
cl::list<std::string> NameFilterFilesDeprecated( cl::list<std::string> NameFilterFilesDeprecated(
@ -684,7 +684,7 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
"name-regex", cl::Optional, "name-regex", cl::Optional,
cl::desc("Show code coverage only for functions that match the given " cl::desc("Show code coverage only for functions that match the given "
"regular expression"), "regular expression"),
cl::ZeroOrMore, cl::cat(FilteringCategory)); cl::cat(FilteringCategory));
cl::list<std::string> IgnoreFilenameRegexFilters( cl::list<std::string> IgnoreFilenameRegexFilters(
"ignore-filename-regex", cl::Optional, "ignore-filename-regex", cl::Optional,

View File

@ -121,7 +121,7 @@ using namespace cl;
OptionCategory DwarfDumpCategory("Specific Options"); OptionCategory DwarfDumpCategory("Specific Options");
static list<std::string> static list<std::string>
InputFilenames(Positional, desc("<input object files or .dSYM bundles>"), InputFilenames(Positional, desc("<input object files or .dSYM bundles>"),
ZeroOrMore, cat(DwarfDumpCategory)); cat(DwarfDumpCategory));
cl::OptionCategory SectionCategory("Section-specific Dump Options", cl::OptionCategory SectionCategory("Section-specific Dump Options",
"These control which sections are dumped. " "These control which sections are dumped. "

View File

@ -88,8 +88,7 @@ static cl::list<std::string> ExtractBlocks(
" --bb=f:bb1;bb2 will extract one function with both bb1 and bb2;\n" " --bb=f:bb1;bb2 will extract one function with both bb1 and bb2;\n"
" --bb=f:bb1 --bb=f:bb2 will extract two functions, one with bb1, one " " --bb=f:bb1 --bb=f:bb2 will extract two functions, one with bb1, one "
"with bb2."), "with bb2."),
cl::ZeroOrMore, cl::value_desc("function:bb1[;bb2...]"), cl::value_desc("function:bb1[;bb2...]"), cl::cat(ExtractCat));
cl::cat(ExtractCat));
// ExtractAlias - The alias to extract from the module. // ExtractAlias - The alias to extract from the module.
static cl::list<std::string> static cl::list<std::string>

View File

@ -65,7 +65,7 @@ static opt<bool> Verbose("verbose",
cat(GeneralOptions)); cat(GeneralOptions));
static list<std::string> InputFilenames(Positional, desc("<input GSYM files>"), static list<std::string> InputFilenames(Positional, desc("<input GSYM files>"),
ZeroOrMore, cat(GeneralOptions)); cat(GeneralOptions));
static opt<std::string> static opt<std::string>
ConvertFilename("convert", cl::init(""), ConvertFilename("convert", cl::init(""),

View File

@ -122,7 +122,7 @@ static cl::list<std::string>
static cl::list<std::string> InputArgv("args", cl::Positional, static cl::list<std::string> InputArgv("args", cl::Positional,
cl::desc("<program arguments>..."), cl::desc("<program arguments>..."),
cl::ZeroOrMore, cl::PositionalEatsArgs, cl::PositionalEatsArgs,
cl::cat(JITLinkCategory)); cl::cat(JITLinkCategory));
static cl::opt<bool> static cl::opt<bool>
@ -142,7 +142,7 @@ static cl::list<std::string> AbsoluteDefs(
static cl::list<std::string> static cl::list<std::string>
Aliases("alias", cl::desc("Inject symbol aliases (syntax: <name>=<addr>)"), Aliases("alias", cl::desc("Inject symbol aliases (syntax: <name>=<addr>)"),
cl::ZeroOrMore, cl::cat(JITLinkCategory)); cl::cat(JITLinkCategory));
static cl::list<std::string> TestHarnesses("harness", cl::Positional, static cl::list<std::string> TestHarnesses("harness", cl::Positional,
cl::desc("Test harness files"), cl::desc("Test harness files"),

View File

@ -78,7 +78,7 @@ static cl::list<std::string> Libraries(
"l<x> searches for the library libx.a in the library search path. If" "l<x> searches for the library libx.a in the library search path. If"
" the string 'x' ends with '.o', then the library 'x' is searched for" " the string 'x' ends with '.o', then the library 'x' is searched for"
" without prepending 'lib' or appending '.a'"), " without prepending 'lib' or appending '.a'"),
cl::ZeroOrMore, cl::Prefix, cl::cat(LibtoolCategory)); cl::Prefix, cl::cat(LibtoolCategory));
static cl::list<std::string> LibrarySearchDirs( static cl::list<std::string> LibrarySearchDirs(
"L", "L",

View File

@ -215,7 +215,7 @@ static cl::list<std::string> ExportedSymbols(
static cl::list<std::string> static cl::list<std::string>
DSOSymbols("dso-symbol", DSOSymbols("dso-symbol",
cl::desc("Symbol to put in the symtab in the resulting dso"), cl::desc("Symbol to put in the symtab in the resulting dso"),
cl::ZeroOrMore, cl::cat(LTOCategory)); cl::cat(LTOCategory));
static cl::opt<bool> ListSymbolsOnly( static cl::opt<bool> ListSymbolsOnly(
"list-symbols-only", cl::init(false), "list-symbols-only", cl::init(false),

View File

@ -90,8 +90,7 @@ static cl::list<std::string> SymbolResolutions(
" runtime and is known to be in this linkage unit\n" " runtime and is known to be in this linkage unit\n"
" x - externally visible: the definition of this symbol is\n" " x - externally visible: the definition of this symbol is\n"
" visible outside of the LTO unit\n" " visible outside of the LTO unit\n"
"A resolution for each symbol must be specified."), "A resolution for each symbol must be specified"));
cl::ZeroOrMore);
static cl::opt<std::string> OverrideTriple( static cl::opt<std::string> OverrideTriple(
"override-triple", "override-triple",

View File

@ -319,12 +319,14 @@ cl::list<std::string>
ExcludeTypes("exclude-types", ExcludeTypes("exclude-types",
cl::desc("Exclude types by regular expression"), cl::desc("Exclude types by regular expression"),
cl::cat(FilterCategory), cl::sub(PrettySubcommand)); cl::cat(FilterCategory), cl::sub(PrettySubcommand));
cl::list<std::string> ExcludeSymbols( cl::list<std::string>
"exclude-symbols", cl::desc("Exclude symbols by regular expression"), ExcludeSymbols("exclude-symbols",
cl::ZeroOrMore, cl::cat(FilterCategory), cl::sub(PrettySubcommand)); cl::desc("Exclude symbols by regular expression"),
cl::list<std::string> ExcludeCompilands( cl::cat(FilterCategory), cl::sub(PrettySubcommand));
"exclude-compilands", cl::desc("Exclude compilands by regular expression"), cl::list<std::string>
cl::ZeroOrMore, cl::cat(FilterCategory), cl::sub(PrettySubcommand)); ExcludeCompilands("exclude-compilands",
cl::desc("Exclude compilands by regular expression"),
cl::cat(FilterCategory), cl::sub(PrettySubcommand));
cl::list<std::string> IncludeTypes( cl::list<std::string> IncludeTypes(
"include-types", "include-types",
@ -333,7 +335,7 @@ cl::list<std::string> IncludeTypes(
cl::list<std::string> IncludeSymbols( cl::list<std::string> IncludeSymbols(
"include-symbols", "include-symbols",
cl::desc("Include only symbols which match a regular expression"), cl::desc("Include only symbols which match a regular expression"),
cl::ZeroOrMore, cl::cat(FilterCategory), cl::sub(PrettySubcommand)); cl::cat(FilterCategory), cl::sub(PrettySubcommand));
cl::list<std::string> IncludeCompilands( cl::list<std::string> IncludeCompilands(
"include-compilands", "include-compilands",
cl::desc("Include only compilands those which match a regular expression"), cl::desc("Include only compilands those which match a regular expression"),
@ -418,7 +420,7 @@ cl::list<uint32_t> TypeIndex(
cl::CommaSeparated, cl::sub(BytesSubcommand), cl::cat(TypeCategory)); cl::CommaSeparated, cl::sub(BytesSubcommand), cl::cat(TypeCategory));
cl::list<uint32_t> cl::list<uint32_t>
IdIndex("id", cl::desc("Dump the id record with the given type index"), IdIndex("id", cl::desc("Dump the id record with the given type index"),
cl::ZeroOrMore, cl::CommaSeparated, cl::sub(BytesSubcommand), cl::CommaSeparated, cl::sub(BytesSubcommand),
cl::cat(TypeCategory)); cl::cat(TypeCategory));
cl::opt<uint32_t> ModuleIndex( cl::opt<uint32_t> ModuleIndex(

View File

@ -83,7 +83,7 @@ static cl::list<std::string> Dylibs("dylib", cl::desc("Add library."),
static cl::list<std::string> InputArgv("args", cl::Positional, static cl::list<std::string> InputArgv("args", cl::Positional,
cl::desc("<program arguments>..."), cl::desc("<program arguments>..."),
cl::ZeroOrMore, cl::PositionalEatsArgs, cl::PositionalEatsArgs,
cl::cat(RTDyldCategory)); cl::cat(RTDyldCategory));
static cl::opt<std::string> static cl::opt<std::string>

View File

@ -64,8 +64,7 @@ public:
static StringRef ToolName; static StringRef ToolName;
static cl::list<std::string> InputFileNames(cl::Positional, static cl::list<std::string> InputFileNames(cl::Positional,
cl::desc("<input object files>"), cl::desc("<input object files>"));
cl::ZeroOrMore);
static int MinLength = 4; static int MinLength = 4;
static bool PrintFileName; static bool PrintFileName;

View File

@ -192,10 +192,9 @@ static cl::opt<bool>
DisableSimplifyLibCalls("disable-simplify-libcalls", DisableSimplifyLibCalls("disable-simplify-libcalls",
cl::desc("Disable simplify-libcalls")); cl::desc("Disable simplify-libcalls"));
static cl::list<std::string> static cl::list<std::string> DisableBuiltins(
DisableBuiltins("disable-builtin", "disable-builtin",
cl::desc("Disable specific target library builtin function"), cl::desc("Disable specific target library builtin function"));
cl::ZeroOrMore);
static cl::opt<bool> EnableDebugify( static cl::opt<bool> EnableDebugify(
"enable-debugify", "enable-debugify",

View File

@ -1157,7 +1157,7 @@ TEST(CommandLineTest, PositionalEatArgsError) {
cl::PositionalEatsArgs); cl::PositionalEatsArgs);
StackOption<std::string, cl::list<std::string>> PosEatArgs2( StackOption<std::string, cl::list<std::string>> PosEatArgs2(
"positional-eat-args2", cl::Positional, cl::desc("Some strings"), "positional-eat-args2", cl::Positional, cl::desc("Some strings"),
cl::ZeroOrMore, cl::PositionalEatsArgs); cl::PositionalEatsArgs);
const char *args[] = {"prog", "-positional-eat-args=XXXX"}; const char *args[] = {"prog", "-positional-eat-args=XXXX"};
const char *args2[] = {"prog", "-positional-eat-args=XXXX", "-foo"}; const char *args2[] = {"prog", "-positional-eat-args=XXXX", "-foo"};

View File

@ -66,8 +66,7 @@ static cl::opt<enum AnalysisType> OptAnalysisType(
"Exact dependences without transitive dependences"), "Exact dependences without transitive dependences"),
clEnumValN(MEMORY_BASED_ANALYSIS, "memory-based", clEnumValN(MEMORY_BASED_ANALYSIS, "memory-based",
"Overapproximation of dependences")), "Overapproximation of dependences")),
cl::Hidden, cl::init(VALUE_BASED_ANALYSIS), cl::ZeroOrMore, cl::Hidden, cl::init(VALUE_BASED_ANALYSIS), cl::cat(PollyCategory));
cl::cat(PollyCategory));
static cl::opt<Dependences::AnalysisLevel> OptAnalysisLevel( static cl::opt<Dependences::AnalysisLevel> OptAnalysisLevel(
"polly-dependences-analysis-level", "polly-dependences-analysis-level",
@ -80,8 +79,7 @@ static cl::opt<Dependences::AnalysisLevel> OptAnalysisLevel(
clEnumValN(Dependences::AL_Access, "access-wise", clEnumValN(Dependences::AL_Access, "access-wise",
"Memory reference level analysis that distinguish" "Memory reference level analysis that distinguish"
" access instructions in the same statement")), " access instructions in the same statement")),
cl::Hidden, cl::init(Dependences::AL_Statement), cl::ZeroOrMore, cl::Hidden, cl::init(Dependences::AL_Statement), cl::cat(PollyCategory));
cl::cat(PollyCategory));
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -117,7 +117,7 @@ static cl::list<std::string> OnlyFunctions(
"Multiple regexes can be comma separated. " "Multiple regexes can be comma separated. "
"Scop detection will run on all functions that match " "Scop detection will run on all functions that match "
"ANY of the regexes provided."), "ANY of the regexes provided."),
cl::ZeroOrMore, cl::CommaSeparated, cl::cat(PollyCategory)); cl::CommaSeparated, cl::cat(PollyCategory));
static cl::list<std::string> IgnoredFunctions( static cl::list<std::string> IgnoredFunctions(
"polly-ignore-func", "polly-ignore-func",
@ -125,7 +125,7 @@ static cl::list<std::string> IgnoredFunctions(
"Multiple regexes can be comma separated. " "Multiple regexes can be comma separated. "
"Scop detection will ignore all functions that match " "Scop detection will ignore all functions that match "
"ANY of the regexes provided."), "ANY of the regexes provided."),
cl::ZeroOrMore, cl::CommaSeparated, cl::cat(PollyCategory)); cl::CommaSeparated, cl::cat(PollyCategory));
bool polly::PollyAllowFullFunction; bool polly::PollyAllowFullFunction;
@ -207,7 +207,7 @@ static cl::opt<bool, true>
PollyDelinearizeX("polly-delinearize", PollyDelinearizeX("polly-delinearize",
cl::desc("Delinearize array access functions"), cl::desc("Delinearize array access functions"),
cl::location(PollyDelinearize), cl::Hidden, cl::location(PollyDelinearize), cl::Hidden,
cl::ZeroOrMore, cl::init(true), cl::cat(PollyCategory)); cl::init(true), cl::cat(PollyCategory));
static cl::opt<bool> static cl::opt<bool>
VerifyScops("polly-detect-verify", VerifyScops("polly-detect-verify",

View File

@ -155,8 +155,7 @@ bool polly::UseInstructionNames;
static cl::opt<bool, true> XUseInstructionNames( static cl::opt<bool, true> XUseInstructionNames(
"polly-use-llvm-names", "polly-use-llvm-names",
cl::desc("Use LLVM-IR names when deriving statement names"), cl::desc("Use LLVM-IR names when deriving statement names"),
cl::location(UseInstructionNames), cl::Hidden, cl::init(false), cl::location(UseInstructionNames), cl::Hidden, cl::cat(PollyCategory));
cl::ZeroOrMore, cl::cat(PollyCategory));
static cl::opt<bool> PollyPrintInstructions( static cl::opt<bool> PollyPrintInstructions(
"polly-print-instructions", cl::desc("Output instructions per ScopStmt"), "polly-print-instructions", cl::desc("Output instructions per ScopStmt"),

View File

@ -39,8 +39,7 @@ bool PollyDebugPrinting;
static cl::opt<bool, true> DebugPrintingX( static cl::opt<bool, true> DebugPrintingX(
"polly-codegen-add-debug-printing", "polly-codegen-add-debug-printing",
cl::desc("Add printf calls that show the values loaded/stored."), cl::desc("Add printf calls that show the values loaded/stored."),
cl::location(PollyDebugPrinting), cl::Hidden, cl::init(false), cl::location(PollyDebugPrinting), cl::Hidden, cl::cat(PollyCategory));
cl::ZeroOrMore, cl::cat(PollyCategory));
static cl::opt<bool> TraceStmts( static cl::opt<bool> TraceStmts(
"polly-codegen-trace-stmts", "polly-codegen-trace-stmts",

View File

@ -58,8 +58,8 @@ bool polly::PerfMonitoring;
static cl::opt<bool, true> static cl::opt<bool, true>
XPerfMonitoring("polly-codegen-perf-monitoring", XPerfMonitoring("polly-codegen-perf-monitoring",
cl::desc("Add run-time performance monitoring"), cl::Hidden, cl::desc("Add run-time performance monitoring"), cl::Hidden,
cl::location(polly::PerfMonitoring), cl::init(false), cl::location(polly::PerfMonitoring),
cl::ZeroOrMore, cl::cat(PollyCategory)); cl::cat(PollyCategory));
STATISTIC(ScopsProcessed, "Number of SCoP processed"); STATISTIC(ScopsProcessed, "Number of SCoP processed");
STATISTIC(CodegenedScops, "Number of successfully generated SCoPs"); STATISTIC(CodegenedScops, "Number of successfully generated SCoPs");

View File

@ -72,7 +72,7 @@ static cl::opt<bool> PollyParallelForce(
"polly-parallel-force", "polly-parallel-force",
cl::desc( cl::desc(
"Force generation of thread parallel code ignoring any cost model"), "Force generation of thread parallel code ignoring any cost model"),
cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::cat(PollyCategory));
static cl::opt<bool> UseContext("polly-ast-use-context", static cl::opt<bool> UseContext("polly-ast-use-context",
cl::desc("Use context"), cl::Hidden, cl::desc("Use context"), cl::Hidden,

View File

@ -34,7 +34,7 @@ static cl::opt<OverflowTrackingChoice> OTMode(
"Track the overflow bit if requested."), "Track the overflow bit if requested."),
clEnumValN(OT_ALWAYS, "always", clEnumValN(OT_ALWAYS, "always",
"Always track the overflow bit.")), "Always track the overflow bit.")),
cl::Hidden, cl::init(OT_REQUEST), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(OT_REQUEST), cl::cat(PollyCategory));
IslExprBuilder::IslExprBuilder(Scop &S, PollyIRBuilder &Builder, IslExprBuilder::IslExprBuilder(Scop &S, PollyIRBuilder &Builder,
IDToValueTy &IDToValue, ValueMapT &GlobalMap, IDToValueTy &IDToValue, ValueMapT &GlobalMap,

View File

@ -40,7 +40,7 @@ static cl::opt<bool> IgnoreLinkageForGlobals(
cl::desc( cl::desc(
"By default, we only rewrite globals with internal linkage. This flag " "By default, we only rewrite globals with internal linkage. This flag "
"enables rewriting of globals regardless of linkage"), "enables rewriting of globals regardless of linkage"),
cl::Hidden, cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::cat(PollyCategory));
#define DEBUG_TYPE "polly-acc-rewrite-managed-memory" #define DEBUG_TYPE "polly-acc-rewrite-managed-memory"
namespace { namespace {

View File

@ -87,7 +87,7 @@ static cl::opt<bool, true>
" that all memory has been" " that all memory has been"
" declared as managed memory"), " declared as managed memory"),
cl::location(PollyManagedMemory), cl::Hidden, cl::location(PollyManagedMemory), cl::Hidden,
cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::init(false), cl::cat(PollyCategory));
static cl::opt<bool> static cl::opt<bool>
FailOnVerifyModuleFailure("polly-acc-fail-on-verify-module-failure", FailOnVerifyModuleFailure("polly-acc-fail-on-verify-module-failure",
@ -112,14 +112,15 @@ static cl::opt<int>
cl::Hidden, cl::init(10 * 512 * 512)); cl::Hidden, cl::init(10 * 512 * 512));
GPURuntime polly::GPURuntimeChoice; GPURuntime polly::GPURuntimeChoice;
static cl::opt<GPURuntime, true> XGPURuntimeChoice( static cl::opt<GPURuntime, true>
"polly-gpu-runtime", cl::desc("The GPU Runtime API to target"), XGPURuntimeChoice("polly-gpu-runtime",
cl::values(clEnumValN(GPURuntime::CUDA, "libcudart", cl::desc("The GPU Runtime API to target"),
"use the CUDA Runtime API"), cl::values(clEnumValN(GPURuntime::CUDA, "libcudart",
clEnumValN(GPURuntime::OpenCL, "libopencl", "use the CUDA Runtime API"),
"use the OpenCL Runtime API")), clEnumValN(GPURuntime::OpenCL, "libopencl",
cl::location(polly::GPURuntimeChoice), cl::init(GPURuntime::CUDA), "use the OpenCL Runtime API")),
cl::ZeroOrMore, cl::cat(PollyCategory)); cl::location(polly::GPURuntimeChoice),
cl::init(GPURuntime::CUDA), cl::cat(PollyCategory));
GPUArch polly::GPUArchChoice; GPUArch polly::GPUArchChoice;
static cl::opt<GPUArch, true> static cl::opt<GPUArch, true>
@ -131,8 +132,7 @@ static cl::opt<GPUArch, true>
clEnumValN(GPUArch::SPIR64, "spir64", clEnumValN(GPUArch::SPIR64, "spir64",
"target SPIR 64-bit architecture")), "target SPIR 64-bit architecture")),
cl::location(polly::GPUArchChoice), cl::location(polly::GPUArchChoice),
cl::init(GPUArch::NVPTX64), cl::ZeroOrMore, cl::init(GPUArch::NVPTX64), cl::cat(PollyCategory));
cl::cat(PollyCategory));
extern bool polly::PerfMonitoring; extern bool polly::PerfMonitoring;

View File

@ -88,8 +88,7 @@ static cl::opt<PassPositionChoice> PassPosition(
"After the loop optimizer (but within the inline cycle)"), "After the loop optimizer (but within the inline cycle)"),
clEnumValN(POSITION_BEFORE_VECTORIZER, "before-vectorizer", clEnumValN(POSITION_BEFORE_VECTORIZER, "before-vectorizer",
"Right before the vectorizer")), "Right before the vectorizer")),
cl::Hidden, cl::init(POSITION_BEFORE_VECTORIZER), cl::ZeroOrMore, cl::Hidden, cl::init(POSITION_BEFORE_VECTORIZER), cl::cat(PollyCategory));
cl::cat(PollyCategory));
static cl::opt<OptimizerChoice> static cl::opt<OptimizerChoice>
Optimizer("polly-optimizer", cl::desc("Select the scheduling optimizer"), Optimizer("polly-optimizer", cl::desc("Select the scheduling optimizer"),
@ -104,7 +103,7 @@ static cl::opt<CodeGenChoice> CodeGeneration(
cl::values(clEnumValN(CODEGEN_FULL, "full", "AST and IR generation"), cl::values(clEnumValN(CODEGEN_FULL, "full", "AST and IR generation"),
clEnumValN(CODEGEN_AST, "ast", "Only AST generation"), clEnumValN(CODEGEN_AST, "ast", "Only AST generation"),
clEnumValN(CODEGEN_NONE, "none", "No code generation")), clEnumValN(CODEGEN_NONE, "none", "No code generation")),
cl::Hidden, cl::init(CODEGEN_FULL), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(CODEGEN_FULL), cl::cat(PollyCategory));
enum TargetChoice { TARGET_CPU, TARGET_GPU, TARGET_HYBRID }; enum TargetChoice { TARGET_CPU, TARGET_GPU, TARGET_HYBRID };
static cl::opt<TargetChoice> static cl::opt<TargetChoice>
@ -117,7 +116,7 @@ static cl::opt<TargetChoice>
"generate GPU code (preferably) or CPU code") "generate GPU code (preferably) or CPU code")
#endif #endif
), ),
cl::init(TARGET_CPU), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::init(TARGET_CPU), cl::cat(PollyCategory));
VectorizerChoice PollyVectorizerChoice; VectorizerChoice PollyVectorizerChoice;
@ -130,7 +129,7 @@ static cl::opt<VectorizerChoice, true> Vectorizer(
VECTORIZER_STRIPMINE, "stripmine", VECTORIZER_STRIPMINE, "stripmine",
"Strip-mine outer loops for the loop-vectorizer to trigger")), "Strip-mine outer loops for the loop-vectorizer to trigger")),
cl::location(PollyVectorizerChoice), cl::init(VECTORIZER_NONE), cl::location(PollyVectorizerChoice), cl::init(VECTORIZER_NONE),
cl::ZeroOrMore, cl::cat(PollyCategory)); cl::cat(PollyCategory));
static cl::opt<bool> ImportJScop( static cl::opt<bool> ImportJScop(
"polly-import", "polly-import",
@ -155,7 +154,7 @@ static cl::opt<bool> PollyViewer(
"polly-show", "polly-show",
cl::desc("Highlight the code regions that will be optimized in a " cl::desc("Highlight the code regions that will be optimized in a "
"(CFG BBs and LLVM-IR instructions)"), "(CFG BBs and LLVM-IR instructions)"),
cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::cat(PollyCategory));
static cl::opt<bool> PollyOnlyViewer( static cl::opt<bool> PollyOnlyViewer(
"polly-show-only", "polly-show-only",

View File

@ -49,7 +49,7 @@ cl::opt<int> DCEPreciseSteps(
cl::desc("The number of precise steps between two approximating " cl::desc("The number of precise steps between two approximating "
"iterations. (A value of -1 schedules another approximation stage " "iterations. (A value of -1 schedules another approximation stage "
"before the actual dead code elimination."), "before the actual dead code elimination."),
cl::ZeroOrMore, cl::init(-1), cl::cat(PollyCategory)); cl::init(-1), cl::cat(PollyCategory));
class DeadCodeElimWrapperPass final : public ScopPass { class DeadCodeElimWrapperPass final : public ScopPass {
public: public:

View File

@ -54,14 +54,14 @@ static cl::opt<int> LatencyVectorFma(
cl::desc("The minimal number of cycles between issuing two " cl::desc("The minimal number of cycles between issuing two "
"dependent consecutive vector fused multiply-add " "dependent consecutive vector fused multiply-add "
"instructions."), "instructions."),
cl::Hidden, cl::init(8), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(8), cl::cat(PollyCategory));
static cl::opt<int> ThroughputVectorFma( static cl::opt<int> ThroughputVectorFma(
"polly-target-throughput-vector-fma", "polly-target-throughput-vector-fma",
cl::desc("A throughput of the processor floating-point arithmetic units " cl::desc("A throughput of the processor floating-point arithmetic units "
"expressed in the number of vector fused multiply-add " "expressed in the number of vector fused multiply-add "
"instructions per clock cycle."), "instructions per clock cycle."),
cl::Hidden, cl::init(1), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(1), cl::cat(PollyCategory));
static cl::opt<int> FirstCacheLevelSize( static cl::opt<int> FirstCacheLevelSize(
"polly-target-1st-cache-level-size", "polly-target-1st-cache-level-size",

View File

@ -121,7 +121,7 @@ static cl::opt<int> FirstLevelDefaultTileSize(
"polly-default-tile-size", "polly-default-tile-size",
cl::desc("The default tile size (if not enough were provided by" cl::desc("The default tile size (if not enough were provided by"
" --polly-tile-sizes)"), " --polly-tile-sizes)"),
cl::Hidden, cl::init(32), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(32), cl::cat(PollyCategory));
static cl::list<int> static cl::list<int>
FirstLevelTileSizes("polly-tile-sizes", FirstLevelTileSizes("polly-tile-sizes",
@ -155,7 +155,7 @@ static cl::opt<int> RegisterDefaultTileSize(
"polly-register-tiling-default-tile-size", "polly-register-tiling-default-tile-size",
cl::desc("The default register tile size (if not enough were provided by" cl::desc("The default register tile size (if not enough were provided by"
" --polly-register-tile-sizes)"), " --polly-register-tile-sizes)"),
cl::Hidden, cl::init(2), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::Hidden, cl::init(2), cl::cat(PollyCategory));
static cl::list<int> static cl::list<int>
RegisterTileSizes("polly-register-tile-sizes", RegisterTileSizes("polly-register-tile-sizes",
@ -188,7 +188,7 @@ static cl::opt<bool> OptimizedScops(
cl::desc("Polly - Dump polyhedral description of Scops optimized with " cl::desc("Polly - Dump polyhedral description of Scops optimized with "
"the isl scheduling optimizer and the set of post-scheduling " "the isl scheduling optimizer and the set of post-scheduling "
"transformations is applied on the schedule tree"), "transformations is applied on the schedule tree"),
cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); cl::cat(PollyCategory));
STATISTIC(ScopsProcessed, "Number of scops processed"); STATISTIC(ScopsProcessed, "Number of scops processed");
STATISTIC(ScopsRescheduled, "Number of scops rescheduled"); STATISTIC(ScopsRescheduled, "Number of scops rescheduled");