[PATCH] D27067: [CommandLine] Remove redundant initializers for StringRef members

Malcolm Parsons via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 14:40:52 PST 2016


malcolm.parsons created this revision.
malcolm.parsons added reviewers: beanz, zturner.
malcolm.parsons added a subscriber: llvm-commits.

The default constructor for a StringRef stores an empty string.


https://reviews.llvm.org/D27067

Files:
  include/llvm/Support/CommandLine.h


Index: include/llvm/Support/CommandLine.h
===================================================================
--- include/llvm/Support/CommandLine.h
+++ include/llvm/Support/CommandLine.h
@@ -179,8 +179,8 @@
 //
 class SubCommand {
 private:
-  StringRef Name = "";
-  StringRef Description = "";
+  StringRef Name;
+  StringRef Description;
 
 protected:
   void registerSubCommand();
@@ -304,8 +304,8 @@
                   enum OptionHidden Hidden)
       : NumOccurrences(0), Occurrences(OccurrencesFlag), Value(0),
         HiddenFlag(Hidden), Formatting(NormalFormatting), Misc(0), Position(0),
-        AdditionalVals(0), ArgStr(""), HelpStr(""), ValueStr(""),
-        Category(&GeneralCategory), FullyInitialized(false) {}
+        AdditionalVals(0), Category(&GeneralCategory), FullyInitialized(false) {
+  }
 
   inline void setNumAdditionalVals(unsigned n) { AdditionalVals = n; }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27067.79153.patch
Type: text/x-patch
Size: 894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161123/abd42205/attachment.bin>


More information about the llvm-commits mailing list