aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lli
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-07-21 00:45:20 -0700
committerStephen Hines <srhines@google.com>2014-07-21 00:45:20 -0700
commitc6a4f5e819217e1e12c458aed8e7b122e23a3a58 (patch)
tree81b7dd2bb4370a392f31d332a566c903b5744764 /tools/lli
parent19c6fbb3e8aaf74093afa08013134b61fa08f245 (diff)
downloadexternal_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.zip
external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.gz
external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.bz2
Update LLVM for rebase to r212749.
Includes a cherry-pick of: r212948 - fixes a small issue with atomic calls Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/RemoteMemoryManager.cpp2
-rw-r--r--tools/lli/lli.cpp20
2 files changed, 11 insertions, 11 deletions
diff --git a/tools/lli/RemoteMemoryManager.cpp b/tools/lli/RemoteMemoryManager.cpp
index 200ab75..4816517 100644
--- a/tools/lli/RemoteMemoryManager.cpp
+++ b/tools/lli/RemoteMemoryManager.cpp
@@ -61,7 +61,7 @@ allocateDataSection(uintptr_t Size, unsigned Alignment,
}
sys::MemoryBlock RemoteMemoryManager::allocateSection(uintptr_t Size) {
- error_code ec;
+ std::error_code ec;
sys::MemoryBlock MB = sys::Memory::allocateMappedMemory(Size,
&Near,
sys::Memory::MF_READ |
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 4cde105..48828c1 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -285,8 +285,8 @@ public:
if (!getCacheFilename(ModuleID, CacheName))
return nullptr;
// Load the object from the cache filename
- std::unique_ptr<MemoryBuffer> IRObjectBuffer;
- MemoryBuffer::getFile(CacheName.c_str(), IRObjectBuffer, -1, false);
+ ErrorOr<std::unique_ptr<MemoryBuffer>> IRObjectBuffer =
+ MemoryBuffer::getFile(CacheName.c_str(), -1, false);
// If the file isn't there, that's OK.
if (!IRObjectBuffer)
return nullptr;
@@ -294,7 +294,7 @@ public:
// because the file has probably just been mmapped. Instead we make
// a copy. The filed-based buffer will be released when it goes
// out of scope.
- return MemoryBuffer::getMemBufferCopy(IRObjectBuffer->getBuffer());
+ return MemoryBuffer::getMemBufferCopy(IRObjectBuffer.get()->getBuffer());
}
private:
@@ -415,7 +415,7 @@ int main(int argc, char **argv, char * const *envp) {
// If not jitting lazily, load the whole bitcode file eagerly too.
if (NoLazyCompilation) {
- if (error_code EC = Mod->materializeAllPermanently()) {
+ if (std::error_code EC = Mod->materializeAllPermanently()) {
errs() << argv[0] << ": bitcode didn't read correctly.\n";
errs() << "Reason: " << EC.message() << "\n";
exit(1);
@@ -538,15 +538,15 @@ int main(int argc, char **argv, char * const *envp) {
}
for (unsigned i = 0, e = ExtraArchives.size(); i != e; ++i) {
- std::unique_ptr<MemoryBuffer> ArBuf;
- error_code ec;
- ec = MemoryBuffer::getFileOrSTDIN(ExtraArchives[i], ArBuf);
- if (ec) {
+ ErrorOr<std::unique_ptr<MemoryBuffer>> ArBuf =
+ MemoryBuffer::getFileOrSTDIN(ExtraArchives[i]);
+ if (!ArBuf) {
Err.print(argv[0], errs());
return 1;
}
- object::Archive *Ar = new object::Archive(ArBuf.release(), ec);
- if (ec || !Ar) {
+ std::error_code EC;
+ object::Archive *Ar = new object::Archive(std::move(ArBuf.get()), EC);
+ if (EC || !Ar) {
Err.print(argv[0], errs());
return 1;
}