diff options
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 10 | ||||
-rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 4 | ||||
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 4 | ||||
-rw-r--r-- | lib/ExecutionEngine/JIT/JITEmitter.cpp | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 9cd03dac27..29a05bbbdb 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -55,7 +55,7 @@ ExecutionEngine::~ExecutionEngine() { char* ExecutionEngine::getMemoryForGV(const GlobalVariable* GV) { const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy); + size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy); return new char[GVSize]; } @@ -848,16 +848,16 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) { return; } else if (const ConstantVector *CP = dyn_cast<ConstantVector>(Init)) { unsigned ElementSize = - getTargetData()->getTypePaddedSize(CP->getType()->getElementType()); + getTargetData()->getTypeAllocSize(CP->getType()->getElementType()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize); return; } else if (isa<ConstantAggregateZero>(Init)) { - memset(Addr, 0, (size_t)getTargetData()->getTypePaddedSize(Init->getType())); + memset(Addr, 0, (size_t)getTargetData()->getTypeAllocSize(Init->getType())); return; } else if (const ConstantArray *CPA = dyn_cast<ConstantArray>(Init)) { unsigned ElementSize = - getTargetData()->getTypePaddedSize(CPA->getType()->getElementType()); + getTargetData()->getTypeAllocSize(CPA->getType()->getElementType()); for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i) InitializeMemory(CPA->getOperand(i), (char*)Addr+i*ElementSize); return; @@ -1004,7 +1004,7 @@ void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) { InitializeMemory(GV->getInitializer(), GA); const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy); + size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy); NumInitBytes += (unsigned)GVSize; ++NumGlobals; } diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index a79bcc2803..765fed248f 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -750,7 +750,7 @@ void Interpreter::visitAllocationInst(AllocationInst &I) { unsigned NumElements = getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue(); - unsigned TypeSize = (size_t)TD.getTypePaddedSize(Ty); + unsigned TypeSize = (size_t)TD.getTypeAllocSize(Ty); // Avoid malloc-ing zero bytes, use max()... unsigned MemToAlloc = std::max(1U, NumElements * TypeSize); @@ -810,7 +810,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I, assert(BitWidth == 64 && "Invalid index type for getelementptr"); Idx = (int64_t)IdxGV.IntVal.getZExtValue(); } - Total += TD.getTypePaddedSize(ST->getElementType())*Idx; + Total += TD.getTypeAllocSize(ST->getElementType())*Idx; } } diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 28ff253c37..21e670aadc 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -632,7 +632,7 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) { // emit it into memory. It goes in the same array as the generated // code, jump tables, etc. const Type *GlobalType = GV->getType()->getElementType(); - size_t S = getTargetData()->getTypePaddedSize(GlobalType); + size_t S = getTargetData()->getTypeAllocSize(GlobalType); size_t A = getTargetData()->getPreferredAlignment(GV); if (GV->isThreadLocal()) { MutexGuard locked(lock); @@ -687,7 +687,7 @@ void *JIT::recompileAndRelinkFunction(Function *F) { /// char* JIT::getMemoryForGV(const GlobalVariable* GV) { const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy); + size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy); if (GV->isThreadLocal()) { MutexGuard locked(lock); return TJI.allocateThreadLocalMemory(GVSize); diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index 7356df4e4f..5856356388 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -809,7 +809,7 @@ static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP, unsigned AlignMask = CPE.getAlignment() - 1; Size = (Size + AlignMask) & ~AlignMask; const Type *Ty = CPE.getType(); - Size += TD->getTypePaddedSize(Ty); + Size += TD->getTypeAllocSize(Ty); } return Size; } @@ -838,7 +838,7 @@ static uintptr_t RoundUpToAlign(uintptr_t Size, unsigned Alignment) { unsigned JITEmitter::addSizeOfGlobal(const GlobalVariable *GV, unsigned Size) { const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)TheJIT->getTargetData()->getTypePaddedSize(ElTy); + size_t GVSize = (size_t)TheJIT->getTargetData()->getTypeAllocSize(ElTy); size_t GVAlign = (size_t)TheJIT->getTargetData()->getPreferredAlignment(GV); DOUT << "JIT: Adding in size " << GVSize << " alignment " << GVAlign; @@ -1322,7 +1322,7 @@ void JITEmitter::emitConstantPool(MachineConstantPool *MCP) { << std::hex << CAddr << std::dec << "]\n"; const Type *Ty = CPE.Val.ConstVal->getType(); - Offset += TheJIT->getTargetData()->getTypePaddedSize(Ty); + Offset += TheJIT->getTargetData()->getTypeAllocSize(Ty); } } |