aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2020-07-20 14:31:48 -0700
committerLang Hames <lhames@gmail.com>2020-07-20 14:40:54 -0700
commit574713c3076c11a5677f554ab132d1324be9cb00 (patch)
tree47f01b88b10eea3d2c3f4d811163d1dcff37a515 /llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
parent8b6179f48c6c6701447b68615fdd3b0345f241a4 (diff)
downloadllvm-574713c3076c11a5677f554ab132d1324be9cb00.zip
llvm-574713c3076c11a5677f554ab132d1324be9cb00.tar.gz
llvm-574713c3076c11a5677f554ab132d1324be9cb00.tar.bz2
[ExecutionEngine] Initialize near block hint in SectionMemoryManager.
When allocating a new memory block in SectionMemoryManager, initialize the Near hint for the other memory groups if they have not been set already. Patch by Dana Koch. Thanks Dana!
Diffstat (limited to 'llvm/lib/ExecutionEngine/SectionMemoryManager.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/SectionMemoryManager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
index 925049b2..febcabf 100644
--- a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
@@ -112,6 +112,15 @@ uint8_t *SectionMemoryManager::allocateSection(
// Save this address as the basis for our next request
MemGroup.Near = MB;
+ // Copy the address to all the other groups, if they have not
+ // been initialized.
+ if (CodeMem.Near.base() == 0)
+ CodeMem.Near = MB;
+ if (RODataMem.Near.base() == 0)
+ RODataMem.Near = MB;
+ if (RWDataMem.Near.base() == 0)
+ RWDataMem.Near = MB;
+
// Remember that we allocated this memory
MemGroup.AllocatedMem.push_back(MB);
Addr = (uintptr_t)MB.base();