]> granicus.if.org Git - clang/commitdiff
ASTUnit doesn't actually care about the predefines; don't record them.
authorDouglas Gregor <dgregor@apple.com>
Thu, 25 Oct 2012 00:09:28 +0000 (00:09 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 25 Oct 2012 00:09:28 +0000 (00:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166650 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/ASTUnit.cpp

index 410b7e6195dc3d071eecbb57d32fd5aa3615d3a5..8738035c4922814bf54ca4effad195e13ce7f408 100644 (file)
@@ -506,7 +506,6 @@ class ASTInfoCollector : public ASTReaderListener {
   HeaderSearch &HSI;
   IntrusiveRefCntPtr<TargetOptions> &TargetOpts;
   IntrusiveRefCntPtr<TargetInfo> &Target;
-  std::string &Predefines;
   unsigned &Counter;
 
   unsigned NumHeaderInfos;
@@ -517,11 +516,10 @@ public:
                    HeaderSearch &HSI, 
                    IntrusiveRefCntPtr<TargetOptions> &TargetOpts,
                    IntrusiveRefCntPtr<TargetInfo> &Target,
-                   std::string &Predefines,
                    unsigned &Counter)
     : PP(PP), Context(Context), LangOpt(LangOpt), HSI(HSI), 
       TargetOpts(TargetOpts), Target(Target),
-      Predefines(Predefines), Counter(Counter), NumHeaderInfos(0),
+      Counter(Counter), NumHeaderInfos(0),
       InitializedLanguage(false) {}
 
   virtual bool ReadLanguageOptions(const LangOptions &LangOpts,
@@ -550,18 +548,6 @@ public:
     return false;
   }
 
-  virtual bool ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers,
-                                    StringRef OriginalFileName,
-                                    std::string &SuggestedPredefines,
-                                    FileManager &FileMgr,
-                                    bool Complain) {
-    Predefines = Buffers[0].Data;
-    for (unsigned I = 1, N = Buffers.size(); I != N; ++I) {
-      Predefines += Buffers[I].Data;
-    }
-    return false;
-  }
-
   virtual void ReadHeaderFileInfo(const HeaderFileInfo &HFI, unsigned ID) {
     HSI.setHeaderFileInfoForUID(HFI, NumHeaderInfos++);
   }
@@ -768,7 +754,6 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
   // Gather Info for preprocessor construction later on.
 
   HeaderSearch &HeaderInfo = *AST->HeaderInfo.get();
-  std::string Predefines;
   unsigned Counter;
 
   OwningPtr<ASTReader> Reader;
@@ -808,7 +793,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
   Reader->setListener(new ASTInfoCollector(*AST->PP, Context,
                                            AST->ASTFileLangOpts, HeaderInfo, 
                                            AST->TargetOpts, AST->Target, 
-                                           Predefines, Counter));
+                                           Counter));
 
   switch (Reader->ReadAST(Filename, serialization::MK_MainFile,
                           ASTReader::ARR_None)) {
@@ -826,7 +811,6 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
 
   AST->OriginalSourceFile = Reader->getOriginalSourceFile();
 
-  PP.setPredefines(Reader->getSuggestedPredefines());
   PP.setCounterValue(Counter);
 
   // Attach the AST reader to the AST context as an external AST