diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2004-09-11 04:31:03 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2004-09-11 04:31:03 +0000 |
| commit | 96019262cad753d113438cb269caf8cc458fd756 (patch) | |
| tree | 4e342bab9571341f991fda6e655e91428deffe79 /llvm/lib/ExecutionEngine/JIT/Emitter.cpp | |
| parent | 0bb062e55ddf16052074f5901727166dd3c85ac6 (diff) | |
| download | bcm5719-llvm-96019262cad753d113438cb269caf8cc458fd756.tar.gz bcm5719-llvm-96019262cad753d113438cb269caf8cc458fd756.zip | |
Convert the Emitter to use the lib/System "Memory" interface instead of the
old SystemUtils.h interface to allocate RWX blocks of memory.
llvm-svn: 16286
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/Emitter.cpp')
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/Emitter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/Emitter.cpp b/llvm/lib/ExecutionEngine/JIT/Emitter.cpp index 5758ebc432a..3ce5765cf49 100644 --- a/llvm/lib/ExecutionEngine/JIT/Emitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/Emitter.cpp @@ -22,7 +22,8 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Support/SystemUtils.h" +#include "llvm/System/Memory.h" + using namespace llvm; namespace { @@ -37,6 +38,7 @@ namespace { /// are emitting is. This never bothers to release the memory, because when /// we are ready to destroy the JIT, the program exits. class JITMemoryManager { + sys::Memory MemBlock; // Virtual memory block allocated RWX unsigned char *MemBase; // Base of block of memory, start of stub mem unsigned char *FunctionBase; // Start of the function body area unsigned char *CurStubPtr, *CurFunctionPtr; @@ -51,7 +53,8 @@ namespace { JITMemoryManager::JITMemoryManager() { // Allocate a 16M block of memory... - MemBase = (unsigned char*)AllocateRWXMemory(16 << 20); + sys::Memory::AllocateRWX(MemBlock,(16 << 20)); + MemBase = reinterpret_cast<unsigned char*>(MemBlock.base()); FunctionBase = MemBase + 512*1024; // Use 512k for stubs // Allocate stubs backwards from the function base, allocate functions forward |

