diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-27 20:54:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-27 20:54:45 +0000 |
commit | 49cc3181a264ee03eb680b03b80a01a812b2b9e9 (patch) | |
tree | b4c751e431dbd1e56fba597b1ee59052f1f643c0 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 833bc681e32b5aba400ed47ad4da27686d86ce19 (diff) | |
download | bcm5719-llvm-49cc3181a264ee03eb680b03b80a01a812b2b9e9.tar.gz bcm5719-llvm-49cc3181a264ee03eb680b03b80a01a812b2b9e9.zip |
Overload SourceManager::overrideFileContents so that unconditionally passing ownership is explicitly done using unique_ptr.
Only those callers who are dynamically passing ownership should need the
3 argument form. Those accepting the default ("do pass ownership")
should do so explicitly with a unique_ptr now.
llvm-svn: 216614
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index a535afdc056..4cba26cc632 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -727,7 +727,7 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input, FileMgr.getBufferForFile(File, &ErrorStr, /*isVolatile=*/true)) { // Create a new virtual file that will have the correct size. File = FileMgr.getVirtualFile(InputFile, MB->getBufferSize(), 0); - SourceMgr.overrideFileContents(File, MB.release()); + SourceMgr.overrideFileContents(File, std::move(MB)); } else { Diags.Report(diag::err_cannot_open_file) << InputFile << ErrorStr; return false; @@ -749,7 +749,7 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input, SB->getBufferSize(), 0); SourceMgr.setMainFileID( SourceMgr.createFileID(File, SourceLocation(), Kind)); - SourceMgr.overrideFileContents(File, SB.release()); + SourceMgr.overrideFileContents(File, std::move(SB)); } assert(!SourceMgr.getMainFileID().isInvalid() && @@ -951,7 +951,7 @@ static bool compileModuleImpl(CompilerInstance &ImportingInstance, llvm::MemoryBuffer::getMemBuffer(InferredModuleMapContent); ModuleMapFile = Instance.getFileManager().getVirtualFile( "__inferred_module.map", InferredModuleMapContent.size(), 0); - SourceMgr.overrideFileContents(ModuleMapFile, ModuleMapBuffer.release()); + SourceMgr.overrideFileContents(ModuleMapFile, std::move(ModuleMapBuffer)); } // Construct a module-generating action. Passing through the module map is |