summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:28:14 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:28:14 +0000
commitd9da7a1f160d32520791e89db9184bfa4d5f35f7 (patch)
treea44445cf75cef436112f1657a2037227043ae54e /clang/lib/Frontend/CompilerInstance.cpp
parent4030ff79b126175c2ca160d1d9db8a9020636671 (diff)
downloadbcm5719-llvm-d9da7a1f160d32520791e89db9184bfa4d5f35f7.tar.gz
bcm5719-llvm-d9da7a1f160d32520791e89db9184bfa4d5f35f7.zip
MemoryBuffer API update.
llvm-svn: 121956
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index d1e1e69184c..d97e8c77277 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -487,9 +487,8 @@ bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
}
SourceMgr.createMainFileID(File);
} else {
- llvm::error_code ec;
- llvm::MemoryBuffer *SB = llvm::MemoryBuffer::getSTDIN(ec);
- if (!SB) {
+ llvm::OwningPtr<llvm::MemoryBuffer> SB;
+ if (llvm::MemoryBuffer::getSTDIN(SB)) {
// FIXME: Give ec.message() in this diag.
Diags.Report(diag::err_fe_error_reading_stdin);
return false;
@@ -497,7 +496,7 @@ bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
SB->getBufferSize(), 0);
SourceMgr.createMainFileID(File);
- SourceMgr.overrideFileContents(File, SB);
+ SourceMgr.overrideFileContents(File, SB.take());
}
assert(!SourceMgr.getMainFileID().isInvalid() &&
OpenPOWER on IntegriCloud