]> granicus.if.org Git - clang/commitdiff
Remove the Chaining argument from the PCH/module generator. It's no longer used
authorDouglas Gregor <dgregor@apple.com>
Thu, 25 Aug 2011 22:35:51 +0000 (22:35 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 25 Aug 2011 22:35:51 +0000 (22:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138596 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/FrontendActions.h
include/clang/Serialization/ASTWriter.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/FrontendActions.cpp
lib/Serialization/ChainedIncludesSource.cpp
lib/Serialization/GeneratePCH.cpp

index ef204312c44f189119762e008c74c7df2b0d2b3b..72a3d908476a581874ff1f895bfd3788a42bca6c 100644 (file)
@@ -91,8 +91,7 @@ public:
                                           StringRef InFile,
                                           std::string &Sysroot,
                                           std::string &OutputFile,
-                                          raw_ostream *&OS,
-                                          bool &Chaining);
+                                          raw_ostream *&OS);
 };
 
 class SyntaxOnlyAction : public ASTFrontendAction {
index 1bb8edb0735a613417f96dacdd21aa770b5f2750..a3a5b433b59e98885c928cc266d76ab08b709dbb 100644 (file)
@@ -634,7 +634,6 @@ class PCHGenerator : public SemaConsumer {
   std::vector<unsigned char> Buffer;
   llvm::BitstreamWriter Stream;
   ASTWriter Writer;
-  bool Chaining;
 
 protected:
   ASTWriter &getWriter() { return Writer; }
@@ -642,7 +641,7 @@ protected:
 
 public:
   PCHGenerator(const Preprocessor &PP, StringRef OutputFile, 
-               bool Chaining, StringRef isysroot, raw_ostream *Out);
+               StringRef isysroot, raw_ostream *Out);
   ~PCHGenerator();
   virtual void InitializeSema(Sema &S) { SemaPtr = &S; }
   virtual void HandleTranslationUnit(ASTContext &Ctx);
index b8d9f2f8c201cd15ef8f7434eb6d0bff97997493..e3d56367fd42d622e881b576ddb21b2a4a939b5d 100644 (file)
@@ -771,10 +771,9 @@ class PrecompilePreambleConsumer : public PCHGenerator,
   std::vector<Decl *> TopLevelDecls;
                                      
 public:
-  PrecompilePreambleConsumer(ASTUnit &Unit,
-                             const Preprocessor &PP, bool Chaining,
+  PrecompilePreambleConsumer(ASTUnit &Unit, const Preprocessor &PP, 
                              StringRef isysroot, raw_ostream *Out)
-    : PCHGenerator(PP, "", Chaining, isysroot, Out), Unit(Unit),
+    : PCHGenerator(PP, "", isysroot, Out), Unit(Unit),
       Hash(Unit.getCurrentTopLevelHashValue()) {
     Hash = 0;
   }
@@ -827,10 +826,9 @@ public:
     std::string Sysroot;
     std::string OutputFile;
     raw_ostream *OS = 0;
-    bool Chaining;
     if (GeneratePCHAction::ComputeASTConsumerArguments(CI, InFile, Sysroot,
                                                        OutputFile,
-                                                       OS, Chaining))
+                                                       OS))
       return 0;
     
     if (!CI.getFrontendOpts().RelocatablePCH)
@@ -838,8 +836,8 @@ public:
 
     CI.getPreprocessor().addPPCallbacks(
      new MacroDefinitionTrackerPPCallbacks(Unit.getCurrentTopLevelHashValue()));
-    return new PrecompilePreambleConsumer(Unit, CI.getPreprocessor(), Chaining,
-                                          Sysroot, OS);
+    return new PrecompilePreambleConsumer(Unit, CI.getPreprocessor(), Sysroot, 
+                                          OS);
   }
 
   virtual bool hasCodeCompletionSupport() const { return false; }
index 5e2b9c473f02a7a2b54b787a13389a1bf16a5c5f..e05d5767eaa398196405b7ba30cc8daf8eeb92dc 100644 (file)
@@ -78,23 +78,19 @@ ASTConsumer *GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI,
   std::string Sysroot;
   std::string OutputFile;
   raw_ostream *OS = 0;
-  bool Chaining;
-  if (ComputeASTConsumerArguments(CI, InFile, Sysroot, OutputFile, OS, 
-                                  Chaining))
+  if (ComputeASTConsumerArguments(CI, InFile, Sysroot, OutputFile, OS))
     return 0;
 
   if (!CI.getFrontendOpts().RelocatablePCH)
     Sysroot.clear();
-  return new PCHGenerator(CI.getPreprocessor(), OutputFile, Chaining, Sysroot, 
-                          OS);
+  return new PCHGenerator(CI.getPreprocessor(), OutputFile, Sysroot, OS);
 }
 
 bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
                                                     StringRef InFile,
                                                     std::string &Sysroot,
                                                     std::string &OutputFile,
-                                                    raw_ostream *&OS,
-                                                    bool &Chaining) {
+                                                    raw_ostream *&OS) {
   Sysroot = CI.getHeaderSearchOpts().Sysroot;
   if (CI.getFrontendOpts().RelocatablePCH && Sysroot.empty()) {
     CI.getDiagnostics().Report(diag::err_relocatable_without_isysroot);
@@ -111,8 +107,6 @@ bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,
     return true;
 
   OutputFile = CI.getFrontendOpts().OutputFile;
-  Chaining = CI.getInvocation().getFrontendOpts().ChainedPCH &&
-             !CI.getPreprocessorOpts().ImplicitPCHInclude.empty();
   return false;
 }
 
index 4ee1c1667fd52858bd905c6bb48f602f40eb0e0b..56dc07f4cb401b1909c0a974bd066b4b4a658737 100644 (file)
@@ -106,7 +106,6 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) {
     llvm::raw_svector_ostream OS(serialAST);
     llvm::OwningPtr<ASTConsumer> consumer;
     consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-",
-                                    /*Chaining=*/!firstInclude,
                                     /*isysroot=*/"", &OS));
     Clang->getASTContext().setASTMutationListener(
                                             consumer->GetASTMutationListener());
index ac395bb2d6fdfb1e7ec078bf6375f7326066bcd2..358954ed1993a67cadb2b76f5da3dec5660b561c 100644 (file)
@@ -28,18 +28,14 @@ using namespace clang;
 
 PCHGenerator::PCHGenerator(const Preprocessor &PP,
                            StringRef OutputFile,
-                           bool Chaining,
                            StringRef isysroot,
                            raw_ostream *OS)
   : PP(PP), OutputFile(OutputFile), isysroot(isysroot.str()), Out(OS), 
-    SemaPtr(0), StatCalls(0), Stream(Buffer), Writer(Stream), Chaining(Chaining) {
+    SemaPtr(0), StatCalls(0), Stream(Buffer), Writer(Stream) {
   // Install a stat() listener to keep track of all of the stat()
   // calls.
   StatCalls = new MemorizeStatCalls();
-  // If we have a chain, we want new stat calls only, so install the memorizer
-  // *after* the already installed ASTReader's stat cache.
-  PP.getFileManager().addStatCache(StatCalls,
-    /*AtBeginning=*/!Chaining);
+  PP.getFileManager().addStatCache(StatCalls, /*AtBeginning=*/false);
 }
 
 PCHGenerator::~PCHGenerator() {
@@ -67,9 +63,7 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) {
 }
 
 ASTMutationListener *PCHGenerator::GetASTMutationListener() {
-  if (Chaining)
-    return &Writer;
-  return 0;
+  return &Writer;
 }
 
 ASTSerializationListener *PCHGenerator::GetASTSerializationListener() {