diff options
| author | Lang Hames <lhames@gmail.com> | 2014-02-12 21:30:07 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2014-02-12 21:30:07 +0000 |
| commit | 937ec549512552422ebe5a2ed7f4e677285a3c1e (patch) | |
| tree | 466ba85b5abbb6155dfd7c3871f91614ad7e0268 /llvm/lib/ExecutionEngine/MCJIT | |
| parent | d59e2faae15d1f25bb591520ea3e790475de8e4a (diff) | |
| download | bcm5719-llvm-937ec549512552422ebe5a2ed7f4e677285a3c1e.tar.gz bcm5719-llvm-937ec549512552422ebe5a2ed7f4e677285a3c1e.zip | |
Extend RTDyld API to enable optionally precomputing the total amount of memory
required for all sections in a module. This can be useful when targets or
code-models place strict requirements on how sections must be laid out
in memory.
If RTDyldMemoryManger::needsToReserveAllocationSpace() is overridden to return
true then the JIT will call the following method on the memory manager, which
can be used to preallocate the necessary memory.
void RTDyldMemoryManager::reserveAllocationSpace(uintptr_t CodeSize,
uintptr_t DataSizeRO,
uintptr_t DataSizeRW)
Patch by Vaidas Gasiunas. Thanks very much Viadas!
llvm-svn: 201259
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT')
| -rw-r--r-- | llvm/lib/ExecutionEngine/MCJIT/MCJIT.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h index a458356fe4b..09c1bae24e3 100644 --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h @@ -45,6 +45,15 @@ public: return ClientMM->allocateDataSection(Size, Alignment, SectionID, SectionName, IsReadOnly); } + + virtual void reserveAllocationSpace( + uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) { + return ClientMM->reserveAllocationSpace(CodeSize, DataSizeRO, DataSizeRW); + } + + virtual bool needsToReserveAllocationSpace() { + return ClientMM->needsToReserveAllocationSpace(); + } virtual void notifyObjectLoaded(ExecutionEngine *EE, const ObjectImage *Obj) { |

