From 3ffe113e11168abcd809ec5ac539538ade5db0cb Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 8 Oct 2016 19:41:06 +0000 Subject: 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283671 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/llvm-mc.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'tools/llvm-mc') diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 78ad8765960..58eb33aa1f3 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/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 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 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 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. -- cgit v1.2.3