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 /llvm/tools/llvm-size/llvm-size.cpp | |
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
Diffstat (limited to 'llvm/tools/llvm-size/llvm-size.cpp')
-rw-r--r-- | llvm/tools/llvm-size/llvm-size.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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> |