summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2013-01-14 21:04:44 +0000
committerDavid Greene <greened@obbligato.org>2013-01-14 21:04:44 +0000
commitfe1215ef935f182cdca28b4af655fa0bfa0f47e6 (patch)
treebfda5ecafdedbf828a463def8a98b116b8c77d6e /lib/ExecutionEngine
parentef44c353599e0e2fd5b2ec2ae5d9bc0e2a355cad (diff)
Fix More Casts
Properly cast some more code that triggered cast-away-const errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/JITMemoryManager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index 353bebf84ab..66aeb772ddc 100644
--- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
@@ -72,15 +72,20 @@ namespace {
/// getBlockAfter - Return the memory block immediately after this one.
///
MemoryRangeHeader &getBlockAfter() const {
- return *(MemoryRangeHeader*)((char*)this+BlockSize);
+ return *reinterpret_cast<MemoryRangeHeader *>(
+ reinterpret_cast<char*>(
+ const_cast<MemoryRangeHeader *>(this))+BlockSize);
}
/// getFreeBlockBefore - If the block before this one is free, return it,
/// otherwise return null.
FreeRangeHeader *getFreeBlockBefore() const {
if (PrevAllocated) return 0;
- intptr_t PrevSize = ((intptr_t *)this)[-1];
- return (FreeRangeHeader*)((char*)this-PrevSize);
+ intptr_t PrevSize = reinterpret_cast<intptr_t *>(
+ const_cast<MemoryRangeHeader *>(this))[-1];
+ return reinterpret_cast<FreeRangeHeader *>(
+ reinterpret_cast<char*>(
+ const_cast<MemoryRangeHeader *>(this))-PrevSize);
}
/// FreeBlock - Turn an allocated block into a free block, adjusting