summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendActions.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/FrontendActions.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/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 31e232139f0..b6ec895a5b2 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -681,14 +681,13 @@ void PrintPreambleAction::ExecuteAction() {
// We can't do anything with these.
return;
}
-
+
CompilerInstance &CI = getCompilerInstance();
- llvm::MemoryBuffer *Buffer
+ std::unique_ptr<llvm::MemoryBuffer> Buffer
= CI.getFileManager().getBufferForFile(getCurrentFile());
if (Buffer) {
unsigned Preamble =
Lexer::ComputePreamble(Buffer->getBuffer(), CI.getLangOpts()).first;
llvm::outs().write(Buffer->getBufferStart(), Preamble);
- delete Buffer;
}
}
OpenPOWER on IntegriCloud