summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 30c3b62c191..d1e1e69184c 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -36,6 +36,7 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Signals.h"
+#include "llvm/Support/system_error.h"
using namespace clang;
CompilerInstance::CompilerInstance()
@@ -486,8 +487,10 @@ bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
}
SourceMgr.createMainFileID(File);
} else {
- llvm::MemoryBuffer *SB = llvm::MemoryBuffer::getSTDIN();
+ llvm::error_code ec;
+ llvm::MemoryBuffer *SB = llvm::MemoryBuffer::getSTDIN(ec);
if (!SB) {
+ // FIXME: Give ec.message() in this diag.
Diags.Report(diag::err_fe_error_reading_stdin);
return false;
}
OpenPOWER on IntegriCloud