[cfe-commits] r80895 - /cfe/trunk/lib/Frontend/ASTUnit.cpp

Daniel Dunbar daniel at zuster.org
Wed Sep 2 22:59:35 PDT 2009


Author: ddunbar
Date: Thu Sep  3 00:59:35 2009
New Revision: 80895

URL: http://llvm.org/viewvc/llvm-project?rev=80895&view=rev
Log:
Revert "Remove redundant local variable (use newly created instance data).", the
previous commit this depends on is breaking x86_64-apple-darwin10 and Linux tests.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=80895&r1=80894&r2=80895&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Sep  3 00:59:35 2009
@@ -104,13 +104,15 @@
   std::string Predefines;
   unsigned Counter;
 
+  llvm::OwningPtr<PCHReader>        Reader;
   llvm::OwningPtr<ExternalASTSource> Source;
 
-  AST->Reader.reset(new PCHReader(SourceMgr, FileMgr, Diags));
-  AST->Reader->setListener(new PCHInfoCollector(LangInfo, HeaderInfo, 
-                                                TargetTriple, Predefines, 
-                                                Counter));
-  switch (AST->Reader->ReadPCH(Filename)) {
+  Reader.reset(new PCHReader(SourceMgr, FileMgr, Diags));
+  AST->Reader.reset(Reader.get());
+  Reader->setListener(new PCHInfoCollector(LangInfo, HeaderInfo, TargetTriple,
+                                           Predefines, Counter));
+
+  switch (Reader->ReadPCH(Filename)) {
   case PCHReader::Success:
     break;
     
@@ -131,7 +133,7 @@
 
   PP.setPredefines(Predefines);
   PP.setCounterValue(Counter);
-  AST->Reader->setPreprocessor(PP);
+  Reader->setPreprocessor(PP);
   
   // Create and initialize the ASTContext.
 
@@ -145,12 +147,12 @@
                                 /* size_reserve = */0));
   ASTContext &Context = *AST->Ctx.get();
   
-  AST->Reader->InitializeContext(Context);
+  Reader->InitializeContext(Context);
   
   // Attach the PCH reader to the AST context as an external AST
   // source, so that declarations will be deserialized from the
   // PCH file as needed.
-  Source.reset(AST->Reader.get());
+  Source.reset(Reader.take());
   Context.setExternalSource(Source);
 
   return AST.take(); 





More information about the cfe-commits mailing list