summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-26 19:54:40 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-26 19:54:40 +0000
commit6406f7b8e0fc43c5f9d14bb3cd1d7d9192e3d277 (patch)
treee1d44a3a5a3732181039d9607893c24807a2fc65 /clang/lib/Frontend/CompilerInstance.cpp
parentcb5674b9c2e4d7944bd8fe0ed92f316e8e5d5f30 (diff)
downloadbcm5719-llvm-6406f7b8e0fc43c5f9d14bb3cd1d7d9192e3d277.tar.gz
bcm5719-llvm-6406f7b8e0fc43c5f9d14bb3cd1d7d9192e3d277.zip
Return a std::unique_ptr from getBufferForFile. NFC.
llvm-svn: 216476
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 9537e85e631..fa0209887ff 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -723,11 +723,11 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
// STDIN.
if (File->isNamedPipe()) {
std::string ErrorStr;
- if (llvm::MemoryBuffer *MB =
+ if (std::unique_ptr<llvm::MemoryBuffer> MB =
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);
+ SourceMgr.overrideFileContents(File, MB.release());
} else {
Diags.Report(diag::err_cannot_open_file) << InputFile << ErrorStr;
return false;
OpenPOWER on IntegriCloud