]> granicus.if.org Git - clang/commitdiff
Modules: Simplify CompilerInstance constructor, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 2 Feb 2017 05:09:51 +0000 (05:09 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 2 Feb 2017 05:09:51 +0000 (05:09 +0000)
Initialize fields directly in header.  Note that the ModuleManager field is an
IntrusiveRefCntPtr, so there's no need for explicit initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293863 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/CompilerInstance.h
lib/Frontend/CompilerInstance.cpp

index 3ebbc61515c660ff1f094fe64a4d95c9761fbb1e..91d9198ddf69c415c16299f2300190b507c426ca 100644 (file)
@@ -142,13 +142,13 @@ class CompilerInstance : public ModuleLoader {
 
   /// \brief Whether we should (re)build the global module index once we
   /// have finished with this translation unit.
-  bool BuildGlobalModuleIndex;
+  bool BuildGlobalModuleIndex = false;
 
   /// \brief We have a full global module index, with all modules.
-  bool HaveFullGlobalModuleIndex;
+  bool HaveFullGlobalModuleIndex = false;
 
   /// \brief One or more modules failed to build.
-  bool ModuleBuildFailed;
+  bool ModuleBuildFailed = false;
 
   /// \brief Holds information about the output file.
   ///
index afcaa6e87878436dd59df5b9ed9c3c75229eb9e1..39fe7771a6ff03480b84921fce0137d9f2b5092b 100644 (file)
@@ -57,10 +57,7 @@ CompilerInstance::CompilerInstance(
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
     bool BuildingModule)
     : ModuleLoader(BuildingModule), Invocation(new CompilerInvocation()),
-      ModuleManager(nullptr),
-      ThePCHContainerOperations(std::move(PCHContainerOps)),
-      BuildGlobalModuleIndex(false), HaveFullGlobalModuleIndex(false),
-      ModuleBuildFailed(false) {}
+      ThePCHContainerOperations(std::move(PCHContainerOps)) {}
 
 CompilerInstance::~CompilerInstance() {
   assert(OutputFiles.empty() && "Still output files in flight?");