diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 742e245c87815..eb6c04d987b31 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -166,7 +166,7 @@ class CommandLineParser { // This collects the different subcommands that have been registered. SmallPtrSet RegisteredSubCommands; - CommandLineParser() : ActiveSubCommand(nullptr) { + CommandLineParser() { registerSubCommand(&*TopLevelSubCommand); registerSubCommand(&*AllSubCommands); } @@ -418,7 +418,7 @@ class CommandLineParser { } private: - SubCommand *ActiveSubCommand; + SubCommand *ActiveSubCommand = nullptr; Option *LookupOption(SubCommand &Sub, StringRef &Arg, StringRef &Value); Option *LookupLongOption(SubCommand &Sub, StringRef &Arg, StringRef &Value, diff --git a/llvm/lib/Support/DynamicLibrary.cpp b/llvm/lib/Support/DynamicLibrary.cpp index d82a4a8cd1263..7b9d7abe7545d 100644 --- a/llvm/lib/Support/DynamicLibrary.cpp +++ b/llvm/lib/Support/DynamicLibrary.cpp @@ -26,14 +26,14 @@ using namespace llvm::sys; class DynamicLibrary::HandleSet { typedef std::vector 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); }