]> granicus.if.org Git - clang/commitdiff
Turn cl::values() (for enum) from a vararg function to using C++ variadic template
authorMehdi Amini <mehdi.amini@apple.com>
Sat, 8 Oct 2016 19:41:06 +0000 (19:41 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sat, 8 Oct 2016 19:41:06 +0000 (19:41 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283671 91177308-0d34-0410-b5e6-96231b3b80d8

tools/c-index-test/core_main.cpp
utils/TableGen/TableGen.cpp

index e64dae726fe31ac3a2f08ddeae4ede1f64b73173..7b7acf07704d012ea6adb15c16cf8434faf6e24d 100644 (file)
@@ -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(
index 9aa0c495ce617b2471c6594971e9b13b51e86665..6fb5b00c4bac5807c13222f37066fcad95c72e51 100644 (file)
@@ -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",