Extend RTDyld API to enable optionally precomputing the total amount of memory
authorLang Hames <lhames@gmail.com>
Wed, 12 Feb 2014 21:30:07 +0000 (21:30 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 12 Feb 2014 21:30:07 +0000 (21:30 +0000)
commit061a739395facc05c5e7dfb7b991dd6cd69ba503
tree725ac0d40f51f672a50c6ec0314d6442ddb1537a
parent29a60e6deba1f4f77d7f688017af66c90f5d6580
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201259 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ExecutionEngine/RTDyldMemoryManager.h
lib/ExecutionEngine/MCJIT/MCJIT.h
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp