summaryrefslogtreecommitdiff
path: root/lib/Linker/LinkItems.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:36:48 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-09 17:36:48 +0000
commit333fb04506233255f10d8095c9e2de5e5f0fdc6f (patch)
tree29b15348801de3482b07a438b1fb1f2ba094d3d2 /lib/Linker/LinkItems.cpp
parent908b6ddad6dac40c4c0453d690f0db9422b48b10 (diff)
downloadllvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.gz
llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.bz2
llvm-333fb04506233255f10d8095c9e2de5e5f0fdc6f.tar.xz
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkItems.cpp')
-rw-r--r--lib/Linker/LinkItems.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp
index cbbdd4ba10..7716b61a79 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.