[cfe-commits] r80861 - /cfe/trunk/lib/Frontend/ASTUnit.cpp
Steve Naroff
snaroff at apple.com
Wed Sep 2 17:43:53 PDT 2009
Author: snaroff
Date: Wed Sep 2 19:43:52 2009
New Revision: 80861
URL: http://llvm.org/viewvc/llvm-project?rev=80861&view=rev
Log:
Remove redundant local variable (use newly created instance data).
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=80861&r1=80860&r2=80861&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed Sep 2 19:43:52 2009
@@ -104,15 +104,13 @@
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 @@
PP.setPredefines(Predefines);
PP.setCounterValue(Counter);
- Reader->setPreprocessor(PP);
+ AST->Reader->setPreprocessor(PP);
// Create and initialize the ASTContext.
@@ -147,12 +145,12 @@
/* 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();
More information about the cfe-commits
mailing list