summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-profdata/llvm-profdata.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-08 19:41:06 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-08 19:41:06 +0000
commit732afdd09a7ff0e8ec60fc9503ed947a9b7b7eca (patch)
tree17fc2ccb250922e11410849638641e52007b211d /llvm/tools/llvm-profdata/llvm-profdata.cpp
parent30cbd1ab84a26e688ee7910a32e13722feabfb57 (diff)
downloadbcm5719-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-profdata/llvm-profdata.cpp')
-rw-r--r--llvm/tools/llvm-profdata/llvm-profdata.cpp7
1 files changed, 3 insertions, 4 deletions
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");
OpenPOWER on IntegriCloud