diff options
author | Steve Naroff <snaroff@apple.com> | 2009-09-03 00:43:52 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-09-03 00:43:52 +0000 |
commit | bbff6990ac96c1767cdbe66d439fc6ba5d3fa693 (patch) | |
tree | 2f714a24757fc6c75b09891715badddff2027f21 /lib/Frontend/ASTUnit.cpp | |
parent | 16b10378a93e8644008289fd86c1caf737d1395c (diff) |
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
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
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<PCHReader> Reader; llvm::OwningPtr<ExternalASTSource> 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(); |