[PATCH] Remove unnecessary string option.
Ariel Bernal
ariel.j.bernal at intel.com
Mon Sep 23 13:46:46 PDT 2013
Hi revane, tareqsiraj,
Use getNumOccurrences instead of using a default constructed constant string.
http://llvm-reviews.chandlerc.com/D1744
Files:
clang-modernize/tool/ClangModernize.cpp
Index: clang-modernize/tool/ClangModernize.cpp
===================================================================
--- clang-modernize/tool/ClangModernize.cpp
+++ clang-modernize/tool/ClangModernize.cpp
@@ -93,11 +93,10 @@
SummaryMode("summary", cl::desc("Print transform summary"),
cl::init(false));
-const char NoTiming[] = "no_timing";
static cl::opt<std::string> TimingDirectoryName(
"perf", cl::desc("Capture performance data and output to specified "
"directory. Default: ./migrate_perf"),
- cl::init(NoTiming), cl::ValueOptional, cl::value_desc("directory name"));
+ cl::ValueOptional, cl::value_desc("directory name"));
static cl::opt<std::string>
IncludePaths("include",
@@ -384,9 +383,8 @@
return 1;
}
- // Since ExecutionTimeDirectoryName could be an empty string we compare
- // against the default value when the command line option is not specified.
- GlobalOptions.EnableTiming = (TimingDirectoryName != NoTiming);
+ // Enable timming.
+ GlobalOptions.EnableTiming = TimingDirectoryName.getNumOccurrences() > 0;
// Check the reformatting style option
bool CmdSwitchError = false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1744.1.patch
Type: text/x-patch
Size: 1172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130923/b285b83c/attachment.bin>
More information about the cfe-commits
mailing list