diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-08 19:41:06 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-08 19:41:06 +0000 |
commit | 732afdd09a7ff0e8ec60fc9503ed947a9b7b7eca (patch) | |
tree | 17fc2ccb250922e11410849638641e52007b211d | |
parent | 30cbd1ab84a26e688ee7910a32e13722feabfb57 (diff) | |
download | bcm5719-llvm-732afdd09a7ff0e8ec60fc9503ed947a9b7b7eca.tar.gz bcm5719-llvm-732afdd09a7ff0e8ec60fc9503ed947a9b7b7eca.zip |
Turn cl::values() (for enum) from a vararg function to using C++ variadic template
The core of the change is supposed to be NFC, however it also fixes
what I believe was an undefined behavior when calling:
va_start(ValueArgs, Desc);
with Desc being a StringRef.
Differential Revision: https://reviews.llvm.org/D25342
llvm-svn: 283671
47 files changed, 106 insertions, 181 deletions
diff --git a/clang-tools-extra/include-fixer/tool/ClangIncludeFixer.cpp b/clang-tools-extra/include-fixer/tool/ClangIncludeFixer.cpp index 6084ff648fe..ed1ab204b7e 100644 --- a/clang-tools-extra/include-fixer/tool/ClangIncludeFixer.cpp +++ b/clang-tools-extra/include-fixer/tool/ClangIncludeFixer.cpp @@ -90,8 +90,7 @@ enum DatabaseFormatTy { cl::opt<DatabaseFormatTy> DatabaseFormat( "db", cl::desc("Specify input format"), cl::values(clEnumVal(fixed, "Hard-coded mapping"), - clEnumVal(yaml, "Yaml database created by find-all-symbols"), - clEnumValEnd), + clEnumVal(yaml, "Yaml database created by find-all-symbols")), cl::init(yaml), cl::cat(IncludeFixerCategory)); cl::opt<std::string> Input("input", diff --git a/clang/tools/c-index-test/core_main.cpp b/clang/tools/c-index-test/core_main.cpp index e64dae726fe..7b7acf07704 100644 --- a/clang/tools/c-index-test/core_main.cpp +++ b/clang/tools/c-index-test/core_main.cpp @@ -41,8 +41,7 @@ static cl::opt<ActionType> Action(cl::desc("Action:"), cl::init(ActionType::None), cl::values( clEnumValN(ActionType::PrintSourceSymbols, - "print-source-symbols", "Print symbols from source"), - clEnumValEnd), + "print-source-symbols", "Print symbols from source")), cl::cat(IndexTestCoreCategory)); static cl::extrahelp MoreHelp( diff --git a/clang/utils/TableGen/TableGen.cpp b/clang/utils/TableGen/TableGen.cpp index 9aa0c495ce6..6fb5b00c4ba 100644 --- a/clang/utils/TableGen/TableGen.cpp +++ b/clang/utils/TableGen/TableGen.cpp @@ -135,8 +135,7 @@ cl::opt<ActionType> Action( clEnumValN(GenAttrDocs, "gen-attr-docs", "Generate attribute documentation"), clEnumValN(GenDiagDocs, "gen-diag-docs", - "Generate attribute documentation"), - clEnumValEnd)); + "Generate attribute documentation"))); cl::opt<std::string> ClangComponent("clang-component", diff --git a/llvm/docs/CommandLine.rst b/llvm/docs/CommandLine.rst index 556c302501e..66a96eefbae 100644 --- a/llvm/docs/CommandLine.rst +++ b/llvm/docs/CommandLine.rst @@ -355,8 +355,7 @@ library fill it in with the appropriate level directly, which is used like this: clEnumVal(g , "No optimizations, enable debugging"), clEnumVal(O1, "Enable trivial optimizations"), clEnumVal(O2, "Enable default optimizations"), - clEnumVal(O3, "Enable expensive optimizations"), - clEnumValEnd)); + clEnumVal(O3, "Enable expensive optimizations"))); ... if (OptimizationLevel >= O2) doPartialRedundancyElimination(...); @@ -401,8 +400,7 @@ program. Because of this, we can alternatively write this example like this: clEnumValN(Debug, "g", "No optimizations, enable debugging"), clEnumVal(O1 , "Enable trivial optimizations"), clEnumVal(O2 , "Enable default optimizations"), - clEnumVal(O3 , "Enable expensive optimizations"), - clEnumValEnd)); + clEnumVal(O3 , "Enable expensive optimizations"))); ... if (OptimizationLevel == Debug) outputDebugInfo(...); @@ -436,8 +434,7 @@ the code looks like this: cl::values( clEnumValN(nodebuginfo, "none", "disable debug information"), clEnumVal(quick, "enable quick debug information"), - clEnumVal(detailed, "enable detailed debug information"), - clEnumValEnd)); + clEnumVal(detailed, "enable detailed debug information"))); This definition defines an enumerated command line variable of type "``enum DebugLev``", which works exactly the same way as before. The difference here is @@ -498,8 +495,7 @@ Then define your "``cl::list``" variable: clEnumVal(dce , "Dead Code Elimination"), clEnumVal(constprop , "Constant Propagation"), clEnumValN(inlining, "inline", "Procedure Integration"), - clEnumVal(strip , "Strip Symbols"), - clEnumValEnd)); + clEnumVal(strip , "Strip Symbols"))); This defines a variable that is conceptually of the type "``std::vector<enum Opts>``". Thus, you can access it with standard vector @@ -558,8 +554,7 @@ Reworking the above list example, we could replace `cl::list`_ with `cl::bits`_: clEnumVal(dce , "Dead Code Elimination"), clEnumVal(constprop , "Constant Propagation"), clEnumValN(inlining, "inline", "Procedure Integration"), - clEnumVal(strip , "Strip Symbols"), - clEnumValEnd)); + clEnumVal(strip , "Strip Symbols"))); To test to see if ``constprop`` was specified, we can use the ``cl:bits::isSet`` function: diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h index d8c00fd072a..823303d4764 100644 --- a/llvm/include/llvm/CodeGen/CommandFlags.h +++ b/llvm/include/llvm/CodeGen/CommandFlags.h @@ -58,8 +58,7 @@ cl::opt<Reloc::Model> RelocModel( clEnumValN(Reloc::RWPI, "rwpi", "Read-write data relocatable, accessed relative to static base"), clEnumValN(Reloc::ROPI_RWPI, "ropi-rwpi", - "Combination of ropi and rwpi"), - clEnumValEnd)); + "Combination of ropi and rwpi"))); static inline Optional<Reloc::Model> getRelocModel() { if (RelocModel.getNumOccurrences()) { @@ -76,8 +75,7 @@ TMModel("thread-model", cl::values(clEnumValN(ThreadModel::POSIX, "posix", "POSIX thread model"), clEnumValN(ThreadModel::Single, "single", - "Single thread model"), - clEnumValEnd)); + "Single thread model"))); cl::opt<llvm::CodeModel::Model> CMModel("code-model", @@ -92,8 +90,7 @@ CMModel("code-model", clEnumValN(CodeModel::Medium, "medium", "Medium code model"), clEnumValN(CodeModel::Large, "large", - "Large code model"), - clEnumValEnd)); + "Large code model"))); cl::opt<llvm::ExceptionHandling> ExceptionModel("exception-model", @@ -108,8 +105,7 @@ ExceptionModel("exception-model", clEnumValN(ExceptionHandling::ARM, "arm", "ARM EHABI exceptions"), clEnumValN(ExceptionHandling::WinEH, "wineh", - "Windows exception model"), - clEnumValEnd)); + "Windows exception model"))); cl::opt<TargetMachine::CodeGenFileType> FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), @@ -120,8 +116,7 @@ FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), clEnumValN(TargetMachine::CGFT_ObjectFile, "obj", "Emit a native object ('.o') file"), clEnumValN(TargetMachine::CGFT_Null, "null", - "Emit nothing, for performance testing"), - clEnumValEnd)); + "Emit nothing, for performance testing"))); cl::opt<bool> EnableFPMAD("enable-fp-mad", @@ -165,8 +160,7 @@ DenormalMode("denormal-fp-math", "the sign of a flushed-to-zero number is preserved " "in the sign of 0"), clEnumValN(FPDenormal::PositiveZero, "positive-zero", - "denormals are flushed to positive zero"), - clEnumValEnd)); + "denormals are flushed to positive zero"))); cl::opt<bool> EnableHonorSignDependentRoundingFPMath("enable-sign-dependent-rounding-fp-math", @@ -184,8 +178,7 @@ FloatABIForCalls("float-abi", clEnumValN(FloatABI::Soft, "soft", "Soft float ABI (implied by -soft-float)"), clEnumValN(FloatABI::Hard, "hard", - "Hard float ABI (uses FP registers)"), - clEnumValEnd)); + "Hard float ABI (uses FP registers)"))); cl::opt<llvm::FPOpFusion::FPOpFusionMode> FuseFPOps("fp-contract", @@ -197,8 +190,7 @@ FuseFPOps("fp-contract", clEnumValN(FPOpFusion::Standard, "on", "Only fuse 'blessed' FP ops."), clEnumValN(FPOpFusion::Strict, "off", - "Only fuse FP ops when the result won't be affected."), - clEnumValEnd)); + "Only fuse FP ops when the result won't be affected."))); cl::opt<bool> DontPlaceZerosInBSS("nozero-initialized-in-bss", @@ -269,8 +261,7 @@ JTableType("jump-table-type", clEnumValN(JumpTable::Simplified, "simplified", "Create one table per simplified function type."), clEnumValN(JumpTable::Full, "full", - "Create one table per unique function type."), - clEnumValEnd)); + "Create one table per unique function type."))); cl::opt<llvm::EABI> EABIVersion( "meabi", cl::desc("Set EABI type (default depends on triple):"), @@ -279,7 +270,7 @@ cl::opt<llvm::EABI> EABIVersion( "Triple default EABI version"), clEnumValN(EABI::EABI4, "4", "EABI version 4"), clEnumValN(EABI::EABI5, "5", "EABI version 5"), - clEnumValN(EABI::GNU, "gnu", "EABI GNU"), clEnumValEnd)); + clEnumValN(EABI::GNU, "gnu", "EABI GNU"))); cl::opt<DebuggerKind> DebuggerTuningOpt("debugger-tune", @@ -289,8 +280,7 @@ DebuggerTuningOpt("debugger-tune", clEnumValN(DebuggerKind::GDB, "gdb", "gdb"), clEnumValN(DebuggerKind::LLDB, "lldb", "lldb"), clEnumValN(DebuggerKind::SCE, "sce", - "SCE targets (e.g. PS4)"), - clEnumValEnd)); + "SCE targets (e.g. PS4)"))); // Common utility function tightly tied to the options listed here. Initializes // a TargetOptions object with CodeGen flags and returns it. diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h index 5180208d33b..801dd6a2d50 100644 --- a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h +++ b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h @@ -26,8 +26,7 @@ cl::opt<MCTargetOptions::AsmInstrumentation> AsmInstrumentation( cl::values(clEnumValN(MCTargetOptions::AsmInstrumentationNone, "none", "no instrumentation at all"), clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address", - "instrument instructions with memory arguments"), - clEnumValEnd)); + "instrument instructions with memory arguments"))); cl::opt<bool> RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, " diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index c46a99cb6bd..c20765d5d7f 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -556,52 +556,43 @@ private: //===----------------------------------------------------------------------===// // Enum valued command line option // -#define clEnumVal(ENUMVAL, DESC) #ENUMVAL, int(ENUMVAL), DESC -#define clEnumValN(ENUMVAL, FLAGNAME, DESC) FLAGNAME, int(ENUMVAL), DESC -#define clEnumValEnd (reinterpret_cast<void *>(0)) + +// This represents a single enum value, using "int" as the underlying type. +struct OptionEnumValue { + StringRef Name; + int Value; + StringRef Description; +}; + +#define clEnumVal(ENUMVAL, DESC) \ + cl::OptionEnumValue { #ENUMVAL, int(ENUMVAL), DESC } +#define clEnumValN(ENUMVAL, FLAGNAME, DESC) \ + cl::OptionEnumValue { FLAGNAME, int(ENUMVAL), DESC } // values - For custom data types, allow specifying a group of values together -// as the values that go into the mapping that the option handler uses. Note -// that the values list must always have a 0 at the end of the list to indicate -// that the list has ended. +// as the values that go into the mapping that the option handler uses. // -template <class DataType> class ValuesClass { +class ValuesClass { // Use a vector instead of a map, because the lists should be short, // the overhead is less, and most importantly, it keeps them in the order // inserted so we can print our option out nicely. - SmallVector<std::pair<StringRef , std::pair<int, StringRef >>, 4> Values; - void processValues(va_list Vals); + SmallVector<OptionEnumValue, 4> Values; public: - ValuesClass(StringRef EnumName, DataType Val, StringRef Desc, - va_list ValueArgs) { - // Insert the first value, which is required. - Values.push_back(std::make_pair(EnumName, std::make_pair(Val, Desc))); - - // Process the varargs portion of the values... - while (const char *enumName = va_arg(ValueArgs, const char * )) { - DataType EnumVal = static_cast<DataType>(va_arg(ValueArgs, int)); - auto EnumDesc = StringRef(va_arg(ValueArgs, const char * )); - Values.push_back(std::make_pair(StringRef(enumName), // Add value to value map - std::make_pair(EnumVal, EnumDesc))); - } - } + ValuesClass(std::initializer_list<OptionEnumValue> Options) + : Values(Options) {} template <class Opt> void apply(Opt &O) const { - for (size_t i = 0, e = Values.size(); i != e; ++i) - O.getParser().addLiteralOption(Values[i].first, Values[i].second.first, - Values[i].second.second); + for (auto Value : Values) + O.getParser().addLiteralOption(Value.Name, Value.Value, + Value.Description); } }; -template <class DataType> -ValuesClass<DataType> LLVM_END_WITH_NULL -values(StringRef Arg, DataType Val, StringRef Desc, ...) { - va_list ValueArgs; - va_start(ValueArgs, Desc); - ValuesClass<DataType> Vals(Arg, Val, Desc, ValueArgs); - va_end(ValueArgs); - return Vals; +/// Helper to build a ValuesClass by forwarding a variable number of arguments +/// as an initializer list to the ValuesClass constructor. +template <typename... OptsTy> ValuesClass values(OptsTy... Options) { + return ValuesClass({Options...}); } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp index b98869d677e..85f437d61da 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp @@ -39,8 +39,7 @@ static cl::opt<GVDAGType> ViewBlockFreqPropagationDAG( "display a graph using the raw " "integer fractional block frequency representation."), clEnumValN(GVDT_Count, "count", "display a graph using the real " - "profile count if available."), - clEnumValEnd)); + "profile count if available."))); cl::opt<std::string> ViewBlockFreqFuncName("view-bfi-func-name", cl::Hidden, diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp index 517cf700d1e..33c62ceaa6b 100644 --- a/llvm/lib/Analysis/RegionInfo.cpp +++ b/llvm/lib/Analysis/RegionInfo.cpp @@ -54,8 +54,7 @@ static cl::opt<Region::PrintStyle, true> printStyleX("print-region-style", clEnumValN(Region::PrintBB, "bb", "print regions in detail with block_iterator"), clEnumValN(Region::PrintRN, "rn", - "print regions in detail with element_iterator"), - clEnumValEnd)); + "print regions in detail with element_iterator"))); //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 7df15071053..add35739e8b 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -24,8 +24,7 @@ static cl::opt<TargetLibraryInfoImpl::VectorLibrary> ClVectorLibrary( clEnumValN(TargetLibraryInfoImpl::Accelerate, "Accelerate", "Accelerate framework"), clEnumValN(TargetLibraryInfoImpl::SVML, "SVML", - "Intel SVML library"), - clEnumValEnd)); + "Intel SVML library"))); StringRef const TargetLibraryInfoImpl::StandardNames[LibFunc::NumLibFuncs] = { #define TLI_DEFINE_STRING diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index aa8535c3cfc..52dd36273e3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -86,7 +86,7 @@ DwarfAccelTables("dwarf-accel-tables", cl::Hidden, cl::desc("Output prototype dwarf accelerator tables."), cl::values(clEnumVal(Default, "Default for platform"), clEnumVal(Enable, "Enabled"), - clEnumVal(Disable, "Disabled"), clEnumValEnd), + clEnumVal(Disable, "Disabled")), cl::init(Default)); static cl::opt<DefaultOnOff> @@ -94,7 +94,7 @@ SplitDwarf("split-dwarf", cl::Hidden, cl::desc("Output DWARF5 split debug info."), cl::values(clEnumVal(Default, "Default for platform"), clEnumVal(Enable, "Enabled"), - clEnumVal(Disable, "Disabled"), clEnumValEnd), + clEnumVal(Disable, "Disabled")), cl::init(Default)); static cl::opt<DefaultOnOff> @@ -102,7 +102,7 @@ DwarfPubSections("generate-dwarf-pub-sections", cl::Hidden, cl::desc("Generate DWARF pubnames and pubtypes sections"), cl::values(clEnumVal(Default, "Default for platform"), clEnumVal(Enable, "Enabled"), - clEnumVal(Disable, "Disabled"), clEnumValEnd), + clEnumVal(Disable, "Disabled")), cl::init(Default)); enum LinkageNameOption { @@ -117,8 +117,7 @@ static cl::opt<LinkageNameOption> "Default for platform"), clEnumValN(AllLinkageNames, "All", "All"), clEnumValN(AbstractLinkageNames, "Abstract", - "Abstract subprograms"), - clEnumValEnd), + "Abstract subprograms")), cl::init(DefaultLinkageNames)); static const char *const DWARFGroupName = "DWARF Emission"; diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 34843b52dc9..5b3b705541c 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -33,8 +33,7 @@ static cl::opt<RegBankSelect::Mode> RegBankSelectMode( cl::values(clEnumValN(RegBankSelect::Mode::Fast, "regbankselect-fast", "Run the Fast mode (default mapping)"), clEnumValN(RegBankSelect::Mode::Greedy, "regbankselect-greedy", - "Use the Greedy mode (best local mapping)"), - clEnumValEnd)); + "Use the Greedy mode (best local mapping)"))); char RegBankSelect::ID = 0; INITIALIZE_PASS_BEGIN(RegBankSelect, DEBUG_TYPE, diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp index d6acc1bc7f4..7d5124d30a0 100644 --- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -42,9 +42,7 @@ static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG( "display a graph using the raw " "integer fractional block frequency representation."), clEnumValN(GVDT_Count, "count", "display a graph using the real " - "profile count if available."), - - clEnumValEnd)); + "profile count if available."))); extern cl::opt<std::string> ViewBlockFreqFuncName; extern cl::opt<unsigned> ViewHotFreqPercent; diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 410a3ed38bb..f73904c321d 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -61,8 +61,7 @@ static cl::opt<SplitEditor::ComplementSpillMode> SplitSpillMode( cl::desc("Spill mode for splitting live ranges"), cl::values(clEnumValN(SplitEditor::SM_Partition, "default", "Default"), clEnumValN(SplitEditor::SM_Size, "size", "Optimize for size"), - clEnumValN(SplitEditor::SM_Speed, "speed", "Optimize for speed"), - clEnumValEnd), + clEnumValN(SplitEditor::SM_Speed, "speed", "Optimize for speed")), cl::init(SplitEditor::SM_Speed)); static cl::opt<unsigned> diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index 4a1b9958a5b..2f934f5ae02 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -60,8 +60,7 @@ static cl::opt<UnsafeStackPtrStorageVal> USPStorage("safe-stack-usp-storage", cl::values(clEnumValN(ThreadLocalUSP, "thread-local", "Thread-local storage"), clEnumValN(SingleThreadUSP, "single-thread", - "Non-thread-local storage"), - clEnumValEnd)); + "Non-thread-local storage"))); namespace llvm { diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index afe09581c08..e0f1b524da0 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -129,8 +129,7 @@ static cl::opt<CFLAAType> UseCFLAA( clEnumValN(CFLAAType::Andersen, "anders", "Enable inclusion-based CFL-AA"), clEnumValN(CFLAAType::Both, "both", - "Enable both variants of CFL-AA"), - clEnumValEnd)); + "Enable both variants of CFL-AA"))); /// Allow standard passes to be disabled by command line options. This supports /// simple binary flags that either suppress the pass or do nothing. diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index 71bb3dd957f..1381f457db5 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -56,8 +56,7 @@ PassDebugging("debug-pass", cl::Hidden, clEnumVal(Arguments , "print pass arguments to pass to 'opt'"), clEnumVal(Structure , "print pass structure before run()"), clEnumVal(Executions, "print pass name before it is executed"), - clEnumVal(Details , "print pass details when it is executed"), - clEnumValEnd)); + clEnumVal(Details , "print pass details when it is executed"))); namespace { typedef llvm::cl::list<const llvm::PassInfo *, bool, PassNameParser> diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp index fbce26e1d9a..8fc82232959 100644 --- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp +++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp @@ -29,8 +29,7 @@ static cl::opt<AsmWriterVariantTy> AsmWriterVariant( "aarch64-neon-syntax", cl::init(Default), cl::desc("Choose style of NEON code to emit from AArch64 backend:"), cl::values(clEnumValN(Generic, "generic", "Emit generic NEON assembly"), - clEnumValN(Apple, "apple", "Emit Apple-style NEON assembly"), - clEnumValEnd)); + clEnumValN(Apple, "apple", "Emit Apple-style NEON assembly"))); AArch64MCAsmInfoDarwin::AArch64MCAsmInfoDarwin() { // We prefer NEON instructions to be printed in the short form. diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp index f39e792025e..a27c190d2a4 100644 --- a/llvm/lib/Target/ARM/ARMSubtarget.cpp +++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp @@ -59,8 +59,7 @@ IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow deprecated IT based on ARMv8"), clEnumValN(NoRestrictedIT, "arm-no-restrict-it", - "Allow IT blocks based on ARMv7"), - clEnumValEnd)); + "Allow IT blocks based on ARMv7"))); /// ForceFastISel - Use the fast-isel, even for subtargets where it is not /// currently supported (for testing only). diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 8c63bea3539..2b210ddb07d 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -65,8 +65,7 @@ static cl::opt<ImplicitItModeTy> ImplicitItMode( clEnumValN(ImplicitItModeTy::ARMOnly, "arm", "Accept in ARM, reject in Thumb"), clEnumValN(ImplicitItModeTy::ThumbOnly, "thumb", - "Warn in ARM, emit implicit ITs in Thumb"), - clEnumValEnd)); + "Warn in ARM, emit implicit ITs in Thumb"))); class ARMOperand; diff --git a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp index c281f9718d7..73346b9ce41 100644 --- a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp +++ b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp @@ -54,8 +54,7 @@ HWMultMode("msp430-hwmult-mode", cl::Hidden, clEnumValN(HWMultIntr, "interrupts", "Assume hardware multiplier can be used inside interrupts"), clEnumValN(HWMultNoIntr, "use", - "Assume hardware multiplier cannot be used inside interrupts"), - clEnumValEnd)); + "Assume hardware multiplier cannot be used inside interrupts"))); MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM, const MSP430Subtarget &STI) diff --git a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp index cd206abda36..c821084f68c 100644 --- a/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -79,8 +79,7 @@ static cl::opt<CompactBranchPolicy> MipsCompactBranchPolicy( cl::values( clEnumValN(CB_Never, "never", "Do not use compact branches if possible."), clEnumValN(CB_Optimal, "optimal", "Use compact branches where appropiate (default)."), - clEnumValN(CB_Always, "always", "Always use compact branches if possible."), - clEnumValEnd + clEnumValN(CB_Always, "always", "Always use compact branches if possible.") ) ); diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp index b7c56cec2db..48a1d8f1330 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp @@ -31,8 +31,7 @@ static cl::opt<AsmWriterFlavorTy> AsmWriterFlavor("x86-asm-syntax", cl::init(ATT), cl::desc("Choose style of code to emit from X86 backend:"), cl::values(clEnumValN(ATT, "att", "Emit AT&T-style assembly"), - clEnumValN(Intel, "intel", "Emit Intel-style assembly"), - clEnumValEnd)); + clEnumValN(Intel, "intel", "Emit Intel-style assembly"))); static cl::opt<bool> MarkedJTDataRegions("mark-data-regions", cl::init(true), diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index ceaa214201f..5e05398d382 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -72,8 +72,7 @@ cl::opt<InlinerFunctionImportStatsOpts> InlinerFunctionImportStats( cl::values(clEnumValN(InlinerFunctionImportStatsOpts::Basic, "basic", "basic statistics"), clEnumValN(InlinerFunctionImportStatsOpts::Verbose, "verbose", - "printing of statistics for each inlined function"), - clEnumValEnd), + "printing of statistics for each inlined function")), cl::Hidden, cl::desc("Enable inliner stats for imported functions")); } // namespace diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index cf8348f2dec..235e13024a3 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -92,8 +92,7 @@ static cl::opt<CFLAAType> clEnumValN(CFLAAType::Andersen, "anders", "Enable inclusion-based CFL-AA"), clEnumValN(CFLAAType::Both, "both", - "Enable both variants of CFL-AA"), - clEnumValEnd)); + "Enable both variants of CFL-AA"))); static cl::opt<bool> EnableMLSM("mlsm", cl::init(true), cl::Hidden, diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 74c397aff28..daeb8e3e588 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -79,8 +79,7 @@ static cl::opt<ReplaceExitVal> ReplaceExitValue( clEnumValN(OnlyCheapRepl, "cheap", "only replace exit value when the cost is cheap"), clEnumValN(AlwaysRepl, "always", - "always replace exit value whenever possible"), - clEnumValEnd)); + "always replace exit value whenever possible"))); namespace { struct RewritePhi; diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp index b0f3880fa74..b26ba93cd61 100644 --- a/llvm/tools/bugpoint/ExecutionDriver.cpp +++ b/llvm/tools/bugpoint/ExecutionDriver.cpp @@ -60,8 +60,7 @@ cl::opt<OutputType> InterpreterSel( "compile the bitcode. Useful to avoid linking."), clEnumValN(Custom, "run-custom", "Use -exec-command to define a command to execute " - "the bitcode. Useful for cross-compilation."), - clEnumValEnd), + "the bitcode. Useful for cross-compilation.")), cl::init(AutoPick)); cl::opt<OutputType> SafeInterpreterSel( @@ -70,8 +69,7 @@ cl::opt<OutputType> SafeInterpreterSel( clEnumValN(RunLLC, "safe-run-llc", "Compile with LLC"), clEnumValN(Custom, "safe-run-custom", "Use -exec-command to define a command to execute " - "the bitcode. Useful for cross-compilation."), - clEnumValEnd), + "the bitcode. Useful for cross-compilation.")), cl::init(AutoPick)); cl::opt<std::string> SafeInterpreterPath( diff --git a/llvm/tools/lli/OrcLazyJIT.cpp b/llvm/tools/lli/OrcLazyJIT.cpp index de69a269887..40c9a5c4dc6 100644 --- a/llvm/tools/lli/OrcLazyJIT.cpp +++ b/llvm/tools/lli/OrcLazyJIT.cpp @@ -37,8 +37,7 @@ namespace { "mods-to-disk", "Dump modules to the current " "working directory. (WARNING: " - "will overwrite existing files)."), - clEnumValEnd), + "will overwrite existing files).")), cl::Hidden); cl::opt<bool> OrcInlineStubs("orc-lazy-inline-stubs", diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 00ae52d35e2..2bbd2287734 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -91,8 +91,7 @@ namespace { "Orc-based MCJIT replacement"), clEnumValN(JITKind::OrcLazy, "orc-lazy", - "Orc-based lazy JIT."), - clEnumValEnd)); + "Orc-based lazy JIT."))); // The MCJIT supports building for a target address space separate from // the JIT compilation process. Use a forked process and a copying @@ -194,8 +193,7 @@ namespace { clEnumValN(Reloc::PIC_, "pic", "Fully relocatable, position independent code"), clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", - "Relocatable external references, non-relocatable code"), - clEnumValEnd)); + "Relocatable external references, non-relocatable code"))); cl::opt<llvm::CodeModel::Model> CMModel("code-model", @@ -210,8 +208,7 @@ namespace { clEnumValN(CodeModel::Medium, "medium", "Medium code model"), clEnumValN(CodeModel::Large, "large", - "Large code model"), - clEnumValEnd)); + "Large code model"))); cl::opt<bool> GenerateSoftFloatCalls("soft-float", @@ -228,8 +225,7 @@ namespace { clEnumValN(FloatABI::Soft, "soft", "Soft float ABI (implied by -soft-float)"), clEnumValN(FloatABI::Hard, "hard", - "Hard float ABI (uses FP registers)"), - clEnumValEnd)); + "Hard float ABI (uses FP registers)"))); ExitOnError ExitOnErr; } diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 40e4a3a493c..b7cb95972d5 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -93,7 +93,7 @@ static cl::opt<Format> FormatOpt("format", cl::desc("Archive format to create"), cl::values(clEnumValN(Default, "default", "default"), clEnumValN(GNU, "gnu", "gnu"), - clEnumValN(BSD, "bsd", "bsd"), clEnumValEnd)); + clEnumValN(BSD, "bsd", "bsd"))); static std::string Options; diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index 96543bb6da2..b3457a9148d 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -485,8 +485,7 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { cl::values(clEnumValN(CoverageViewOptions::OutputFormat::Text, "text", "Text output"), clEnumValN(CoverageViewOptions::OutputFormat::HTML, "html", - "HTML output"), - clEnumValEnd), + "HTML output")), cl::init(CoverageViewOptions::OutputFormat::Text)); cl::opt<bool> FilenameEquivalence( diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index bbf36793e6d..429df622ef5 100644 --- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -72,7 +72,7 @@ static cl::opt<DIDumpType> DumpType( ".debug_str_offsets.dwo"), clEnumValN(DIDT_CUIndex, "cu_index", ".debug_cu_index"), clEnumValN(DIDT_GdbIndex, "gdb_index", ".gdb_index"), - clEnumValN(DIDT_TUIndex, "tu_index", ".debug_tu_index"), clEnumValEnd)); + clEnumValN(DIDT_TUIndex, "tu_index", ".debug_tu_index"))); static void error(StringRef Filename, std::error_code EC) { if (!EC) diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp index ddaedd04c93..483d5013233 100644 --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/tools/llvm-lto/llvm-lto.cpp @@ -102,8 +102,7 @@ cl::opt<ThinLTOModes> ThinLTOMode( "(requires -thinlto-index)."), clEnumValN(THINOPT, "optimize", "Perform ThinLTO optimizations."), clEnumValN(THINCODEGEN, "codegen", "CodeGen (expected to match llc)"), - clEnumValN(THINALL, "run", "Perform ThinLTO end-to-end"), - clEnumValEnd)); + clEnumValN(THINALL, "run", "Perform ThinLTO end-to-end"))); static cl::opt<std::string> ThinLTOIndex("thinlto-index", diff --git a/llvm/tools/llvm-mc-fuzzer/llvm-mc-fuzzer.cpp b/llvm/tools/llvm-mc-fuzzer/llvm-mc-fuzzer.cpp index df8e0112af5..e31ea762add 100644 --- a/llvm/tools/llvm-mc-fuzzer/llvm-mc-fuzzer.cpp +++ b/llvm/tools/llvm-mc-fuzzer/llvm-mc-fuzzer.cpp @@ -31,8 +31,7 @@ Action(cl::desc("Action to perform:"), cl::values(clEnumValN(AC_Assemble, "assemble", "Assemble a .s file (default)"), clEnumValN(AC_Disassemble, "disassemble", - "Disassemble strings of hex bytes"), - clEnumValEnd)); + "Disassemble strings of hex bytes"))); static cl::opt<std::string> TripleName("triple", cl::desc("Target triple to assemble for, " diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 78ad8765960..58eb33aa1f3 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -66,8 +66,7 @@ CompressDebugSections("compress-debug-sections", cl::ValueOptional, clEnumValN(DebugCompressionType::DCT_Zlib, "zlib", "Use zlib compression"), clEnumValN(DebugCompressionType::DCT_ZlibGnu, "zlib-gnu", - "Use zlib-gnu compression (deprecated)"), - clEnumValEnd)); + "Use zlib-gnu compression (deprecated)"))); static cl::opt<bool> ShowInst("show-inst", cl::desc("Show internal instruction representation")); @@ -105,8 +104,7 @@ FileType("filetype", cl::init(OFT_AssemblyFile), clEnumValN(OFT_Null, "null", "Don't emit anything (for timing purposes)"), clEnumValN(OFT_ObjectFile, "obj", - "Emit a native object ('.o') file"), - clEnumValEnd)); + "Emit a native object ('.o') file"))); static cl::list<std::string> IncludeDirs("I", cl::desc("Directory of include files"), @@ -148,8 +146,7 @@ CMModel("code-model", clEnumValN(CodeModel::Medium, "medium", "Medium code model"), clEnumValN(CodeModel::Large, "large", - "Large code model"), - clEnumValEnd)); + "Large code model"))); static cl::opt<bool> NoInitialTextSection("n", cl::desc("Don't assume assembly file starts " @@ -190,8 +187,7 @@ Action(cl::desc("Action to perform:"), clEnumValN(AC_Disassemble, "disassemble", "Disassemble strings of hex bytes"), clEnumValN(AC_MDisassemble, "mdis", - "Marked up disassembly of strings of hex bytes"), - clEnumValEnd)); + "Marked up disassembly of strings of hex bytes"))); static const Target *GetTarget(const char *ProgName) { // Figure out the target triple. diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 936a5c36d7a..0477dd13e02 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -56,7 +56,7 @@ cl::opt<OutputFormatTy> OutputFormat( "format", cl::desc("Specify output format"), cl::values(clEnumVal(bsd, "BSD format"), clEnumVal(sysv, "System V format"), clEnumVal(posix, "POSIX.2 format"), - clEnumVal(darwin, "Darwin -m format"), clEnumValEnd), + clEnumVal(darwin, "Darwin -m format")), cl::init(bsd)); cl::alias OutputFormat2("f", cl::desc("Alias for --format"), cl::aliasopt(OutputFormat)); @@ -143,7 +143,7 @@ enum Radix { d, o, x }; cl::opt<Radix> AddressRadix("radix", cl::desc("Radix (o/d/x) for printing symbol Values"), cl::values(clEnumVal(d, "decimal"), clEnumVal(o, "octal"), - clEnumVal(x, "hexadecimal"), clEnumValEnd), + clEnumVal(x, "hexadecimal")), cl::init(x)); cl::alias RadixAlias("t", cl::desc("Alias for --radix"), cl::aliasopt(AddressRadix)); diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 9dbce9726f5..43a9a7aaacc 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -188,8 +188,7 @@ cl::opt<bool> PrintFaultMaps("fault-map-section", cl::opt<DIDumpType> llvm::DwarfDumpType( "dwarf", cl::init(DIDT_Null), cl::desc("Dump of dwarf debug sections:"), - cl::values(clEnumValN(DIDT_Frames, "frames", ".debug_frame"), - clEnumValEnd)); + cl::values(clEnumValN(DIDT_Frames, "frames", ".debug_frame"))); cl::opt<bool> PrintSource( "source", diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp index 059c4dc79c8..08f74d955c6 100644 --- a/llvm/tools/llvm-profdata/llvm-profdata.cpp +++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp @@ -393,14 +393,13 @@ static int merge_main(int argc, const char *argv[]) { cl::opt<ProfileKinds> ProfileKind( cl::desc("Profile kind:"), cl::init(instr), cl::values(clEnumVal(instr, "Instrumentation profile (default)"), - clEnumVal(sample, "Sample profile"), clEnumValEnd)); + clEnumVal(sample, "Sample profile"))); cl::opt<ProfileFormat> OutputFormat( cl::desc("Format of output profile"), cl::init(PF_Binary), cl::values(clEnumValN(PF_Binary, "binary", "Binary encoding (default)"), clEnumValN(PF_Text, "text", "Text encoding"), clEnumValN(PF_GCC, "gcc", - "GCC encoding (only meaningful for -sample)"), - clEnumValEnd)); + "GCC encoding (only meaningful for -sample)"))); cl::opt<bool> OutputSparse("sparse", cl::init(false), cl::desc("Generate a sparse profile (only meaningful for -instr)")); cl::opt<unsigned> NumThreads( @@ -622,7 +621,7 @@ static int show_main(int argc, const char *argv[]) { cl::opt<ProfileKinds> ProfileKind( cl::desc("Profile kind:"), cl::init(instr), cl::values(clEnumVal(instr, "Instrumentation profile (default)"), - clEnumVal(sample, "Sample profile"), clEnumValEnd)); + clEnumVal(sample, "Sample profile"))); cl::ParseCommandLineOptions(argc, argv, "LLVM profile data summary\n"); diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp index ab51b64fd8c..caf44311a9c 100644 --- a/llvm/tools/llvm-readobj/llvm-readobj.cpp +++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -264,7 +264,7 @@ namespace opts { cl::opt<OutputStyleTy> Output("elf-output-style", cl::desc("Specify ELF dump style"), cl::values(clEnumVal(LLVM, "LLVM default style"), - clEnumVal(GNU, "GNU readelf style"), clEnumValEnd), + clEnumVal(GNU, "GNU readelf style")), cl::init(LLVM)); } // namespace opts diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp index f1b0e6d63c0..92c1ce6ab6a 100644 --- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -66,8 +66,7 @@ Action(cl::desc("Action to perform:"), clEnumValN(AC_PrintObjectLineInfo, "printobjline", "Like -printlineinfo but does not load the object first"), clEnumValN(AC_Verify, "verify", - "Load, link and verify the resulting memory image."), - clEnumValEnd)); + "Load, link and verify the resulting memory image."))); static cl::opt<std::string> EntryPoint("entry", diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp index 3cf76cd8864..c274649190b 100644 --- a/llvm/tools/llvm-size/llvm-size.cpp +++ b/llvm/tools/llvm-size/llvm-size.cpp @@ -40,14 +40,14 @@ static cl::opt<OutputFormatTy> OutputFormat("format", cl::desc("Specify output format"), cl::values(clEnumVal(sysv, "System V format"), clEnumVal(berkeley, "Berkeley format"), - clEnumVal(darwin, "Darwin -m format"), clEnumValEnd), + clEnumVal(darwin, "Darwin -m format")), cl::init(berkeley)); static cl::opt<OutputFormatTy> OutputFormatShort( cl::desc("Specify output format"), cl::values(clEnumValN(sysv, "A", "System V format"), clEnumValN(berkeley, "B", "Berkeley format"), - clEnumValN(darwin, "m", "Darwin -m format"), clEnumValEnd), + clEnumValN(darwin, "m", "Darwin -m format")), cl::init(berkeley)); static bool BerkeleyHeaderPrinted = false; @@ -81,8 +81,7 @@ static cl::opt<RadixTy> RadixShort(cl::desc("Print size in radix:"), cl::values(clEnumValN(octal, "o", "Print size in octal"), clEnumValN(decimal, "d", "Print size in decimal"), - clEnumValN(hexadecimal, "x", "Print size in hexadecimal"), - clEnumValEnd), + clEnumValN(hexadecimal, "x", "Print size in hexadecimal")), cl::init(decimal)); static cl::opt<bool> diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp index 7ee4ba19603..fc37dea4c48 100644 --- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp +++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp @@ -46,8 +46,7 @@ static cl::opt<FunctionNameKind> ClPrintFunctions( clEnumValN(FunctionNameKind::ShortName, "short", "print short function name"), clEnumValN(FunctionNameKind::LinkageName, "linkage", - "print function linkage name"), - clEnumValEnd)); + "print function linkage name"))); static cl::opt<bool> ClUseRelativeAddress("relative-address", cl::init(false), diff --git a/llvm/tools/sancov/sancov.cc b/llvm/tools/sancov/sancov.cc index 9479fe76758..8dd9ecc95ca 100644 --- a/llvm/tools/sancov/sancov.cc +++ b/llvm/tools/sancov/sancov.cc @@ -92,7 +92,7 @@ cl::opt<ActionType> Action( "REMOVED. Use -symbolize & coverage-report-server.py."), clEnumValN(SymbolizeAction, "symbolize", "Produces a symbolized JSON report from binary report."), - clEnumValN(MergeAction, "merge", "Merges reports."), clEnumValEnd)); + clEnumValN(MergeAction, "merge", "Merges reports."))); static cl::list<std::string> ClInputFiles(cl::Positional, cl::OneOrMore, diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp index 24dbe5d3a28..1847b5808ee 100644 --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/TableGen.cpp @@ -91,8 +91,7 @@ namespace { clEnumValN(GenAttributes, "gen-attrs", "Generate attributes"), clEnumValN(GenSearchableTables, "gen-searchable-tables", - "Generate generic binary-searchable table"), - clEnumValEnd)); + "Generate generic binary-searchable table"))); cl::opt<std::string> Class("class", cl::desc("Print Enum list for this class"), diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp index 06bc6575295..acf27f38735 100644 --- a/polly/lib/Analysis/DependenceInfo.cpp +++ b/polly/lib/Analysis/DependenceInfo.cpp @@ -65,8 +65,7 @@ static cl::opt<enum AnalysisType> OptAnalysisType( cl::values(clEnumValN(VALUE_BASED_ANALYSIS, "value-based", "Exact dependences without transitive dependences"), clEnumValN(MEMORY_BASED_ANALYSIS, "memory-based", - "Overapproximation of dependences"), - clEnumValEnd), + "Overapproximation of dependences")), cl::Hidden, cl::init(VALUE_BASED_ANALYSIS), cl::ZeroOrMore, cl::cat(PollyCategory)); @@ -80,8 +79,7 @@ static cl::opt<Dependences::AnalyisLevel> OptAnalysisLevel( " accessed references in the same statement"), clEnumValN(Dependences::AL_Access, "access-wise", "Memory reference level analysis that distinguish" - " access instructions in the same statement"), - clEnumValEnd), + " access instructions in the same statement")), cl::Hidden, cl::init(Dependences::AL_Statement), cl::ZeroOrMore, cl::cat(PollyCategory)); diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp index 730d2c7d2f6..160a574e817 100644 --- a/polly/lib/CodeGen/IslExprBuilder.cpp +++ b/polly/lib/CodeGen/IslExprBuilder.cpp @@ -35,8 +35,7 @@ static cl::opt<OverflowTrackingChoice> OTMode( clEnumValN(OT_REQUEST, "request", "Track the overflow bit if requested."), clEnumValN(OT_ALWAYS, "always", - "Always track the overflow bit."), - clEnumValEnd), + "Always track the overflow bit.")), cl::Hidden, cl::init(OT_REQUEST), cl::ZeroOrMore, cl::cat(PollyCategory)); IslExprBuilder::IslExprBuilder(Scop &S, PollyIRBuilder &Builder, diff --git a/polly/lib/Support/RegisterPasses.cpp b/polly/lib/Support/RegisterPasses.cpp index 6eb468e2ae7..53178630969 100644 --- a/polly/lib/Support/RegisterPasses.cpp +++ b/polly/lib/Support/RegisterPasses.cpp @@ -67,16 +67,14 @@ static cl::opt<PassPositionChoice> PassPosition( clEnumValN(POSITION_AFTER_LOOPOPT, "after-loopopt", "After the loop optimizer (but within the inline cycle)"), clEnumValN(POSITION_BEFORE_VECTORIZER, "before-vectorizer", - "Right before the vectorizer"), - clEnumValEnd), + "Right before the vectorizer")), cl::Hidden, cl::init(POSITION_EARLY), cl::ZeroOrMore, cl::cat(PollyCategory)); static cl::opt<OptimizerChoice> Optimizer( "polly-optimizer", cl::desc("Select the scheduling optimizer"), cl::values(clEnumValN(OPTIMIZER_NONE, "none", "No optimizer"), - clEnumValN(OPTIMIZER_ISL, "isl", "The isl scheduling optimizer"), - clEnumValEnd), + clEnumValN(OPTIMIZER_ISL, "isl", "The isl scheduling optimizer")), cl::Hidden, cl::init(OPTIMIZER_ISL), cl::ZeroOrMore, cl::cat(PollyCategory)); @@ -85,18 +83,17 @@ static cl::opt<CodeGenChoice> CodeGeneration( "polly-code-generation", cl::desc("How much code-generation to perform"), cl::values(clEnumValN(CODEGEN_FULL, "full", "AST and IR generation"), clEnumValN(CODEGEN_AST, "ast", "Only AST generation"), - clEnumValN(CODEGEN_NONE, "none", "No code generation"), - clEnumValEnd), + clEnumValN(CODEGEN_NONE, "none", "No code generation")), cl::Hidden, cl::init(CODEGEN_FULL), cl::ZeroOrMore, cl::cat(PollyCategory)); enum TargetChoice { TARGET_CPU, TARGET_GPU }; static cl::opt<TargetChoice> Target("polly-target", cl::desc("The hardware to target"), - cl::values(clEnumValN(TARGET_CPU, "cpu", "generate CPU code"), + cl::values(clEnumValN(TARGET_CPU, "cpu", "generate CPU code") #ifdef GPU_CODEGEN - clEnumValN(TARGET_GPU, "gpu", "generate GPU code"), + , clEnumValN(TARGET_GPU, "gpu", "generate GPU code") #endif - clEnumValEnd), + ), cl::init(TARGET_CPU), cl::ZeroOrMore, cl::cat(PollyCategory)); VectorizerChoice polly::PollyVectorizerChoice; @@ -107,8 +104,7 @@ static cl::opt<polly::VectorizerChoice, true> Vectorizer( clEnumValN(polly::VECTORIZER_POLLY, "polly", "Polly internal vectorizer"), clEnumValN(polly::VECTORIZER_STRIPMINE, "stripmine", - "Strip-mine outer loops for the loop-vectorizer to trigger"), - clEnumValEnd), + "Strip-mine outer loops for the loop-vectorizer to trigger")), cl::location(PollyVectorizerChoice), cl::init(polly::VECTORIZER_NONE), cl::ZeroOrMore, cl::cat(PollyCategory)); |