[llvm-commits] [llvm] r128485 - in /llvm/trunk: include/llvm/ExecutionEngine/RuntimeDyld.h lib/ExecutionEngine/MCJIT/MCJIT.cpp lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp tools/llvm-rtdyld/Makefile tools/llvm-rtdyld/llvm-rtdyld.cpp
Jim Grosbach
grosbach at apple.com
Tue Mar 29 14:03:05 PDT 2011
Author: grosbach
Date: Tue Mar 29 16:03:05 2011
New Revision: 128485
URL: http://llvm.org/viewvc/llvm-project?rev=128485&view=rev
Log:
Instantiate a JITMemoryManager for MCJIT Dyld
Modified:
llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h
llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
llvm/trunk/tools/llvm-rtdyld/Makefile
llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
Modified: llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h?rev=128485&r1=128484&r2=128485&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/RuntimeDyld.h Tue Mar 29 16:03:05 2011
@@ -21,6 +21,7 @@
class RuntimeDyldImpl;
class MemoryBuffer;
+class JITMemoryManager;
class RuntimeDyld {
RuntimeDyld(const RuntimeDyld &); // DO NOT IMPLEMENT
@@ -30,7 +31,7 @@
// interface.
RuntimeDyldImpl *Dyld;
public:
- RuntimeDyld();
+ RuntimeDyld(JITMemoryManager*);
~RuntimeDyld();
bool loadObject(MemoryBuffer *InputBuffer);
Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=128485&r1=128484&r2=128485&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Tue Mar 29 16:03:05 2011
@@ -67,7 +67,7 @@
MCJIT::MCJIT(Module *m, TargetMachine *tm, TargetJITInfo &tji,
JITMemoryManager *JMM, CodeGenOpt::Level OptLevel,
bool AllocateGVsWithCode)
- : ExecutionEngine(m), TM(tm), M(m), OS(Buffer) {
+ : ExecutionEngine(m), TM(tm), M(m), OS(Buffer), Dyld(JMM) {
PM.add(new TargetData(*TM->getTargetData()));
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp?rev=128485&r1=128484&r2=128485&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp Tue Mar 29 16:03:05 2011
@@ -18,6 +18,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
+#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/Object/MachOObject.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
@@ -34,6 +35,9 @@
unsigned CPUType;
unsigned CPUSubtype;
+ // The JITMemoryManager to load objects into.
+ JITMemoryManager *JMM;
+
// Master symbol table. As modules are loaded and external symbols are
// resolved, their addresses are stored here.
StringMap<void*> SymbolTable;
@@ -68,7 +72,7 @@
const InMemoryStruct<macho::SymtabLoadCommand> &SymtabLC);
public:
- RuntimeDyldImpl() : HasError(false) {}
+ RuntimeDyldImpl(JITMemoryManager *jmm) : JMM(jmm), HasError(false) {}
bool loadObject(MemoryBuffer *InputBuffer);
@@ -526,8 +530,8 @@
//===----------------------------------------------------------------------===//
// RuntimeDyld class implementation
-RuntimeDyld::RuntimeDyld() {
- Dyld = new RuntimeDyldImpl;
+RuntimeDyld::RuntimeDyld(JITMemoryManager *JMM) {
+ Dyld = new RuntimeDyldImpl(JMM);
}
RuntimeDyld::~RuntimeDyld() {
Modified: llvm/trunk/tools/llvm-rtdyld/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/Makefile?rev=128485&r1=128484&r2=128485&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-rtdyld/Makefile (original)
+++ llvm/trunk/tools/llvm-rtdyld/Makefile Tue Mar 29 16:03:05 2011
@@ -18,6 +18,6 @@
# early so we can set up LINK_COMPONENTS before including Makefile.rules
include $(LEVEL)/Makefile.config
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) support MC object RuntimeDyld
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) support MC object RuntimeDyld JIT
include $(LLVM_SRC_ROOT)/Makefile.rules
Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=128485&r1=128484&r2=128485&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Tue Mar 29 16:03:05 2011
@@ -13,6 +13,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/OwningPtr.h"
+#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
#include "llvm/Object/MachOObject.h"
#include "llvm/Support/CommandLine.h"
@@ -60,7 +61,7 @@
return Error("unable to read input: '" + ec.message() + "'");
// Instantiate a dynamic linker.
- RuntimeDyld Dyld;
+ RuntimeDyld Dyld(JITMemoryManager::CreateDefaultMemManager());
// Load the object file into it.
if (Dyld.loadObject(InputBuffer.take())) {
More information about the llvm-commits
mailing list