From: Steve Naroff Date: Thu, 3 Sep 2009 00:43:52 +0000 (+0000) Subject: Remove redundant local variable (use newly created instance data). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bbff6990ac96c1767cdbe66d439fc6ba5d3fa693;p=clang Remove redundant local variable (use newly created instance data). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80861 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 38452ed9d4..3fce817c0d 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -104,15 +104,13 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename, std::string Predefines; unsigned Counter; - llvm::OwningPtr Reader; llvm::OwningPtr Source; - 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)) { + AST->Reader.reset(new PCHReader(SourceMgr, FileMgr, Diags)); + AST->Reader->setListener(new PCHInfoCollector(LangInfo, HeaderInfo, + TargetTriple, Predefines, + Counter)); + switch (AST->Reader->ReadPCH(Filename)) { case PCHReader::Success: break; @@ -133,7 +131,7 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename, PP.setPredefines(Predefines); PP.setCounterValue(Counter); - Reader->setPreprocessor(PP); + AST->Reader->setPreprocessor(PP); // Create and initialize the ASTContext. @@ -147,12 +145,12 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename, /* size_reserve = */0)); ASTContext &Context = *AST->Ctx.get(); - Reader->InitializeContext(Context); + AST->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(Reader.take()); + Source.reset(AST->Reader.get()); Context.setExternalSource(Source); return AST.take();