[clang-tools-extra] r283671 - Turn cl::values() (for enum) from a vararg function to using C++ variadic template

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 8 12:41:07 PDT 2016


Author: mehdi_amini
Date: Sat Oct  8 14:41:06 2016
New Revision: 283671

URL: http://llvm.org/viewvc/llvm-project?rev=283671&view=rev
Log:
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

Modified:
    clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp

Modified: clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp?rev=283671&r1=283670&r2=283671&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp (original)
+++ clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp Sat Oct  8 14:41:06 2016
@@ -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",




More information about the cfe-commits mailing list