diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 11 | ||||
-rw-r--r-- | clang/lib/Frontend/ChainedIncludesSource.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 11 | ||||
-rw-r--r-- | clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index cbdfa33453f..ace3e9c6aad 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -781,7 +781,7 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename, // Tell the diagnostic client that we have started a source file. AST->getDiagnostics().getClient()->BeginSourceFile(Context.getLangOpts(),&PP); - return AST.take(); + return AST.release(); } namespace { @@ -1798,7 +1798,7 @@ ASTUnit *ASTUnit::create(CompilerInvocation *CI, AST->SourceMgr = new SourceManager(AST->getDiagnostics(), *AST->FileMgr, UserFilesAreVolatile); - return AST.take(); + return AST.release(); } ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI, @@ -1938,7 +1938,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI, Act->EndSourceFile(); if (OwnAST) - return OwnAST.take(); + return OwnAST.release(); else return AST; } @@ -2001,7 +2001,8 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI, llvm::CrashRecoveryContextReleaseRefCleanup<DiagnosticsEngine> > DiagCleanup(Diags.getPtr()); - return AST->LoadFromCompilerInvocation(PrecompilePreamble)? 0 : AST.take(); + return AST->LoadFromCompilerInvocation(PrecompilePreamble) ? 0 + : AST.release(); } ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, @@ -2093,7 +2094,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin, return 0; } - return AST.take(); + return AST.release(); } bool ASTUnit::Reparse(ArrayRef<RemappedFile> RemappedFiles) { diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp index 1bdd48e1681..04753ee0c03 100644 --- a/clang/lib/Frontend/ChainedIncludesSource.cpp +++ b/clang/lib/Frontend/ChainedIncludesSource.cpp @@ -44,7 +44,7 @@ static ASTReader *createASTReader(CompilerInstance &CI, case ASTReader::Success: // Set the predefines buffer as suggested by the PCH reader. PP.setPredefines(Reader->getSuggestedPredefines()); - return Reader.take(); + return Reader.release(); case ASTReader::Failure: case ASTReader::Missing: @@ -98,7 +98,7 @@ ChainedIncludesSource::create(CompilerInstance &CI) { new DiagnosticsEngine(DiagID, &CI.getDiagnosticOpts(), DiagClient)); OwningPtr<CompilerInstance> Clang(new CompilerInstance()); - Clang->setInvocation(CInvok.take()); + Clang->setInvocation(CInvok.release()); Clang->setDiagnostics(Diags.getPtr()); Clang->setTarget(TargetInfo::CreateTargetInfo(Clang->getDiagnostics(), &Clang->getTargetOpts())); @@ -116,7 +116,7 @@ ChainedIncludesSource::create(CompilerInstance &CI) { /*isysroot=*/"", &OS)); Clang->getASTContext().setASTMutationListener( consumer->GetASTMutationListener()); - Clang->setASTConsumer(consumer.take()); + Clang->setASTConsumer(consumer.release()); Clang->createSema(TU_Prefix, 0); if (firstInclude) { @@ -156,7 +156,7 @@ ChainedIncludesSource::create(CompilerInstance &CI) { serialBufs.push_back( llvm::MemoryBuffer::getMemBufferCopy(StringRef(serialAST.data(), serialAST.size()))); - source->CIs.push_back(Clang.take()); + source->CIs.push_back(Clang.release()); } assert(!serialBufs.empty()); diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index be1a5402683..086d96fca83 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -156,11 +156,10 @@ static void SetupSerializedDiagnostics(DiagnosticOptions *DiagOpts, << OutputFile << ErrorInfo; return; } - + DiagnosticConsumer *SerializedConsumer = - clang::serialized_diags::create(OS.take(), DiagOpts); + clang::serialized_diags::create(OS.release(), DiagOpts); - Diags.setClient(new ChainedDiagnosticConsumer(Diags.takeClient(), SerializedConsumer)); } @@ -355,7 +354,7 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path, // Set the predefines buffer as suggested by the PCH reader. Typically, the // predefines buffer will be empty. PP.setPredefines(Reader->getSuggestedPredefines()); - return Reader.take(); + return Reader.release(); case ASTReader::Failure: // Unrecoverable failure: don't even try to process the input file. @@ -607,7 +606,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath, if (TempPathName) *TempPathName = TempFile; - return OS.take(); + return OS.release(); } // Initialization Utilities @@ -671,7 +670,7 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input, const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(), SB->getBufferSize(), 0); SourceMgr.createMainFileID(File, Kind); - SourceMgr.overrideFileContents(File, SB.take()); + SourceMgr.overrideFileContents(File, SB.release()); } assert(!SourceMgr.getMainFileID().isInvalid() && diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index 78f39d4298a..62a89fa1307 100644 --- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -85,5 +85,5 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, CCArgs.size(), *Diags)) return 0; - return CI.take(); + return CI.release(); } diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 6cebeadee95..f61b3bacc47 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -227,7 +227,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, } IntrusiveRefCntPtr<vfs::FileSystem> FS = - vfs::getVFSFromYAML(Buffer.take(), /*DiagHandler*/0); + vfs::getVFSFromYAML(Buffer.release(), /*DiagHandler*/ 0); if (!FS.getPtr()) { CI.getDiagnostics().Report(diag::err_invalid_vfs_overlay) << *I; goto failure; @@ -343,7 +343,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, goto failure; } - CI.setASTConsumer(Consumer.take()); + CI.setASTConsumer(Consumer.release()); if (!CI.hasASTConsumer()) goto failure; } |