summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-10-26 22:44:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-10-26 22:44:13 +0000
commita885796d5fd85e4c7c71407feb48553ef7d4e258 (patch)
tree91527c022eee45fa040d87d150e55b16c515c549 /clang/lib/Frontend/CompilerInstance.cpp
parent789d29df34169e21d40bd8581c303e1b3a29f6d2 (diff)
downloadbcm5719-llvm-a885796d5fd85e4c7c71407feb48553ef7d4e258.tar.gz
bcm5719-llvm-a885796d5fd85e4c7c71407feb48553ef7d4e258.zip
Make VFS and FileManager match the current MemoryBuffer API.
This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 1f336b48e29..03ab20b083e 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -717,14 +717,14 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
// pick up the correct size, and simply override their contents as we do for
// STDIN.
if (File->isNamedPipe()) {
- std::string ErrorStr;
- if (std::unique_ptr<llvm::MemoryBuffer> MB =
- FileMgr.getBufferForFile(File, &ErrorStr, /*isVolatile=*/true)) {
+ auto MB = FileMgr.getBufferForFile(File, /*isVolatile=*/true);
+ if (MB) {
// Create a new virtual file that will have the correct size.
- File = FileMgr.getVirtualFile(InputFile, MB->getBufferSize(), 0);
- SourceMgr.overrideFileContents(File, std::move(MB));
+ File = FileMgr.getVirtualFile(InputFile, (*MB)->getBufferSize(), 0);
+ SourceMgr.overrideFileContents(File, std::move(*MB));
} else {
- Diags.Report(diag::err_cannot_open_file) << InputFile << ErrorStr;
+ Diags.Report(diag::err_cannot_open_file) << InputFile
+ << MB.getError().message();
return false;
}
}
OpenPOWER on IntegriCloud