summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-11-26 15:27:39 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-11-26 15:27:39 +0000
commit9fb411431d4df41f562008fc4580230fc2ee4362 (patch)
treefdb9b6a818d3444a9d5a984a625c86288f8a2a28 /llvm/tools
parent248f1e5156acec3108482fa599a91372207f6be9 (diff)
downloadbcm5719-llvm-9fb411431d4df41f562008fc4580230fc2ee4362.tar.gz
bcm5719-llvm-9fb411431d4df41f562008fc4580230fc2ee4362.zip
Reverting r222828 and r222810-r222812 as they broke the build on Windows.
http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753 llvm-svn: 222833
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lli/RemoteMemoryManager.cpp3
-rw-r--r--llvm/tools/lli/RemoteMemoryManager.h3
-rw-r--r--llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp2
-rw-r--r--llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp56
4 files changed, 22 insertions, 42 deletions
diff --git a/llvm/tools/lli/RemoteMemoryManager.cpp b/llvm/tools/lli/RemoteMemoryManager.cpp
index 47da8fb60c9..5a135eabd73 100644
--- a/llvm/tools/lli/RemoteMemoryManager.cpp
+++ b/llvm/tools/lli/RemoteMemoryManager.cpp
@@ -14,6 +14,7 @@
#include "RemoteMemoryManager.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
+#include "llvm/ExecutionEngine/ObjectImage.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
@@ -77,7 +78,7 @@ sys::MemoryBlock RemoteMemoryManager::allocateSection(uintptr_t Size) {
}
void RemoteMemoryManager::notifyObjectLoaded(ExecutionEngine *EE,
- const object::ObjectFile &Obj) {
+ const ObjectImage *Obj) {
// The client should have called setRemoteTarget() before triggering any
// code generation.
assert(Target);
diff --git a/llvm/tools/lli/RemoteMemoryManager.h b/llvm/tools/lli/RemoteMemoryManager.h
index 895bcdac4d1..0bdb4e2ad12 100644
--- a/llvm/tools/lli/RemoteMemoryManager.h
+++ b/llvm/tools/lli/RemoteMemoryManager.h
@@ -80,8 +80,7 @@ public:
// symbols from Modules it contains.
uint64_t getSymbolAddress(const std::string &Name) override { return 0; }
- void notifyObjectLoaded(ExecutionEngine *EE,
- const object::ObjectFile &Obj) override;
+ void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj) override;
bool finalizeMemory(std::string *ErrMsg) override;
diff --git a/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp b/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp
index 0f85a85e19c..0bb6e8bc886 100644
--- a/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp
+++ b/llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp
@@ -19,10 +19,10 @@
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/ExecutionEngine/MCJIT.h"
+#include "llvm/ExecutionEngine/ObjectImage.h"
#include "llvm/IR/Module.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index c38e42307dd..87d381e994f 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -13,6 +13,8 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/DebugInfo/DIContext.h"
+#include "llvm/ExecutionEngine/ObjectBuffer.h"
+#include "llvm/ExecutionEngine/ObjectImage.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
#include "llvm/ExecutionEngine/RuntimeDyldChecker.h"
#include "llvm/MC/MCAsmInfo.h"
@@ -205,32 +207,23 @@ static int printLineInfoForInput() {
if (std::error_code EC = InputBuffer.getError())
return Error("unable to read input: '" + EC.message() + "'");
- ErrorOr<std::unique_ptr<ObjectFile>> MaybeObj(
- ObjectFile::createObjectFile((*InputBuffer)->getMemBufferRef()));
-
- if (std::error_code EC = MaybeObj.getError())
- return Error("unable to create object file: '" + EC.message() + "'");
-
- ObjectFile &Obj = **MaybeObj;
-
+ std::unique_ptr<ObjectImage> LoadedObject;
// Load the object file
- std::unique_ptr<RuntimeDyld::LoadedObjectInfo> LoadedObjInfo =
- Dyld.loadObject(Obj);
-
- if (Dyld.hasError())
+ LoadedObject = Dyld.loadObject(
+ llvm::make_unique<ObjectBuffer>(std::move(*InputBuffer)));
+ if (!LoadedObject) {
return Error(Dyld.getErrorString());
+ }
// Resolve all the relocations we can.
Dyld.resolveRelocations();
- OwningBinary<ObjectFile> DebugObj = LoadedObjInfo->getObjectForDebug(Obj);
-
std::unique_ptr<DIContext> Context(
- DIContext::getDWARFContext(*DebugObj.getBinary()));
+ DIContext::getDWARFContext(*LoadedObject->getObjectFile()));
// Use symbol info to iterate functions in the object.
- for (object::symbol_iterator I = DebugObj.getBinary()->symbol_begin(),
- E = DebugObj.getBinary()->symbol_end();
+ for (object::symbol_iterator I = LoadedObject->begin_symbols(),
+ E = LoadedObject->end_symbols();
I != E; ++I) {
object::SymbolRef::Type SymType;
if (I->getType(SymType)) continue;
@@ -275,17 +268,11 @@ static int executeInput() {
MemoryBuffer::getFileOrSTDIN(InputFileList[i]);
if (std::error_code EC = InputBuffer.getError())
return Error("unable to read input: '" + EC.message() + "'");
- ErrorOr<std::unique_ptr<ObjectFile>> MaybeObj(
- ObjectFile::createObjectFile((*InputBuffer)->getMemBufferRef()));
-
- if (std::error_code EC = MaybeObj.getError())
- return Error("unable to create object file: '" + EC.message() + "'");
-
- ObjectFile &Obj = **MaybeObj;
-
+ std::unique_ptr<ObjectImage> LoadedObject;
// Load the object file
- Dyld.loadObject(Obj);
- if (Dyld.hasError()) {
+ LoadedObject = Dyld.loadObject(
+ llvm::make_unique<ObjectBuffer>(std::move(*InputBuffer)));
+ if (!LoadedObject) {
return Error(Dyld.getErrorString());
}
}
@@ -525,21 +512,14 @@ static int linkAndVerify() {
// Load the input memory buffer.
ErrorOr<std::unique_ptr<MemoryBuffer>> InputBuffer =
MemoryBuffer::getFileOrSTDIN(InputFileList[i]);
-
if (std::error_code EC = InputBuffer.getError())
return Error("unable to read input: '" + EC.message() + "'");
- ErrorOr<std::unique_ptr<ObjectFile>> MaybeObj(
- ObjectFile::createObjectFile((*InputBuffer)->getMemBufferRef()));
-
- if (std::error_code EC = MaybeObj.getError())
- return Error("unable to create object file: '" + EC.message() + "'");
-
- ObjectFile &Obj = **MaybeObj;
-
+ std::unique_ptr<ObjectImage> LoadedObject;
// Load the object file
- Dyld.loadObject(Obj);
- if (Dyld.hasError()) {
+ LoadedObject = Dyld.loadObject(
+ llvm::make_unique<ObjectBuffer>(std::move(*InputBuffer)));
+ if (!LoadedObject) {
return Error(Dyld.getErrorString());
}
}
OpenPOWER on IntegriCloud