diff options
Diffstat (limited to 'lib/Linker/LinkItems.cpp')
-rw-r--r-- | lib/Linker/LinkItems.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp index cbbdd4b..7716b61 100644 --- a/lib/Linker/LinkItems.cpp +++ b/lib/Linker/LinkItems.cpp @@ -18,6 +18,7 @@ #include "llvm/Support/Path.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/system_error.h" using namespace llvm; // LinkItems - This function is the main entry point into linking. It takes a @@ -160,7 +161,8 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) { // Check for a file of name "-", which means "read standard input" if (File.str() == "-") { std::auto_ptr<Module> M; - if (MemoryBuffer *Buffer = MemoryBuffer::getSTDIN(&Error)) { + error_code ec; + if (MemoryBuffer *Buffer = MemoryBuffer::getSTDIN(ec)) { if (!Buffer->getBufferSize()) { delete Buffer; Error = "standard input is empty"; @@ -172,7 +174,7 @@ bool Linker::LinkInFile(const sys::Path &File, bool &is_native) { return false; } } - return error("Cannot link stdin: " + Error); + return error("Cannot link stdin: " + ec.message()); } // Determine what variety of file it is. |