소스 검색

Modules: Simplify CompilerInstance constructor, NFC

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
Duncan P. N. Exon Smith 8 년 전
부모
커밋
e6e8a1de30
2개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 3
      include/clang/Frontend/CompilerInstance.h
  2. 1 4
      lib/Frontend/CompilerInstance.cpp

+ 3 - 3
include/clang/Frontend/CompilerInstance.h

@@ -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.
   ///

+ 1 - 4
lib/Frontend/CompilerInstance.cpp

@@ -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?");