summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JITLink
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-05-20 20:53:05 +0000
committerLang Hames <lhames@gmail.com>2019-05-20 20:53:05 +0000
commit93d2bdda6bfe287de7825cfac9224dcfe051b1c5 (patch)
tree7b876090b9f6357dc81e5c09f63addfe0993e528 /llvm/lib/ExecutionEngine/JITLink
parent52fa90a348c1bed5ecbcc0965c57d67e5ec45d5a (diff)
downloadbcm5719-llvm-93d2bdda6bfe287de7825cfac9224dcfe051b1c5.tar.gz
bcm5719-llvm-93d2bdda6bfe287de7825cfac9224dcfe051b1c5.zip
[Support] Renamed member 'Size' to 'AllocatedSize' in MemoryBlock and OwningMemoryBlock.
Rename member 'Size' to 'AllocatedSize' in order to provide a hint that the allocated size may be different than the requested size. Comments are added to clarify this point. Updated the InMemoryBuffer in FileOutputBuffer.cpp to track the requested buffer size. Patch by Machiel van Hooren. Thanks Machiel! https://reviews.llvm.org/D61599 llvm-svn: 361195
Diffstat (limited to 'llvm/lib/ExecutionEngine/JITLink')
-rw-r--r--llvm/lib/ExecutionEngine/JITLink/JITLink.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
index 1cea043f761..16ef4c603ce 100644
--- a/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
@@ -154,7 +154,7 @@ InProcessMemoryManager::allocate(const SegmentsRequestMap &Request) {
MutableArrayRef<char> getWorkingMemory(ProtectionFlags Seg) override {
assert(SegBlocks.count(Seg) && "No allocation for segment");
return {static_cast<char *>(SegBlocks[Seg].base()),
- SegBlocks[Seg].size()};
+ SegBlocks[Seg].allocatedSize()};
}
JITTargetAddress getTargetMemory(ProtectionFlags Seg) override {
assert(SegBlocks.count(Seg) && "No allocation for segment");
@@ -178,7 +178,8 @@ InProcessMemoryManager::allocate(const SegmentsRequestMap &Request) {
if (auto EC = sys::Memory::protectMappedMemory(Block, Prot))
return errorCodeToError(EC);
if (Prot & sys::Memory::MF_EXEC)
- sys::Memory::InvalidateInstructionCache(Block.base(), Block.size());
+ sys::Memory::InvalidateInstructionCache(Block.base(),
+ Block.allocatedSize());
}
return Error::success();
}
OpenPOWER on IntegriCloud