[Support] Use default member initialization (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 13 Jun 2022 01:46:25 +0000 (18:46 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 13 Jun 2022 01:46:25 +0000 (18:46 -0700)
Identified with modernize-use-default-member-init.

llvm/lib/Support/CommandLine.cpp
llvm/lib/Support/DynamicLibrary.cpp

index 742e245..eb6c04d 100644 (file)
@@ -166,7 +166,7 @@ public:
   // This collects the different subcommands that have been registered.
   SmallPtrSet<SubCommand *, 4> RegisteredSubCommands;
 
-  CommandLineParser() : ActiveSubCommand(nullptr) {
+  CommandLineParser() {
     registerSubCommand(&*TopLevelSubCommand);
     registerSubCommand(&*AllSubCommands);
   }
@@ -418,7 +418,7 @@ public:
   }
 
 private:
-  SubCommand *ActiveSubCommand;
+  SubCommand *ActiveSubCommand = nullptr;
 
   Option *LookupOption(SubCommand &Sub, StringRef &Arg, StringRef &Value);
   Option *LookupLongOption(SubCommand &Sub, StringRef &Arg, StringRef &Value,
index d82a4a8..7b9d7ab 100644 (file)
@@ -26,14 +26,14 @@ using namespace llvm::sys;
 class DynamicLibrary::HandleSet {
   typedef std::vector<void *> HandleList;
   HandleList Handles;
-  void *Process;
+  void *Process = nullptr;
 
 public:
   static void *DLOpen(const char *Filename, std::string *Err);
   static void DLClose(void *Handle);
   static void *DLSym(void *Handle, const char *Symbol);
 
-  HandleSet() : Process(nullptr) {}
+  HandleSet() = default;
   ~HandleSet();
 
   HandleList::iterator Find(void *Handle) { return find(Handles, Handle); }