mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Revert "Make ExecutionEngine owning a DataLayout"
Reverting to fix buildbot breakage. This reverts commit r242387. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242394 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -968,7 +968,7 @@ void Interpreter::visitAllocaInst(AllocaInst &I) {
|
||||
unsigned NumElements =
|
||||
getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue();
|
||||
|
||||
unsigned TypeSize = (size_t)getDataLayout().getTypeAllocSize(Ty);
|
||||
unsigned TypeSize = (size_t)TD.getTypeAllocSize(Ty);
|
||||
|
||||
// Avoid malloc-ing zero bytes, use max()...
|
||||
unsigned MemToAlloc = std::max(1U, NumElements * TypeSize);
|
||||
@@ -1000,7 +1000,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
|
||||
|
||||
for (; I != E; ++I) {
|
||||
if (StructType *STy = dyn_cast<StructType>(*I)) {
|
||||
const StructLayout *SLO = getDataLayout().getStructLayout(STy);
|
||||
const StructLayout *SLO = TD.getStructLayout(STy);
|
||||
|
||||
const ConstantInt *CPU = cast<ConstantInt>(I.getOperand());
|
||||
unsigned Index = unsigned(CPU->getZExtValue());
|
||||
@@ -1020,7 +1020,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 += getDataLayout().getTypeAllocSize(ST->getElementType()) * Idx;
|
||||
Total += TD.getTypeAllocSize(ST->getElementType())*Idx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1477,7 +1477,7 @@ GenericValue Interpreter::executeIntToPtrInst(Value *SrcVal, Type *DstTy,
|
||||
GenericValue Dest, Src = getOperandValue(SrcVal, SF);
|
||||
assert(DstTy->isPointerTy() && "Invalid PtrToInt instruction");
|
||||
|
||||
uint32_t PtrSize = getDataLayout().getPointerSizeInBits();
|
||||
uint32_t PtrSize = TD.getPointerSizeInBits();
|
||||
if (PtrSize != Src.IntVal.getBitWidth())
|
||||
Src.IntVal = Src.IntVal.zextOrTrunc(PtrSize);
|
||||
|
||||
@@ -1497,7 +1497,7 @@ GenericValue Interpreter::executeBitCastInst(Value *SrcVal, Type *DstTy,
|
||||
(DstTy->getTypeID() == Type::VectorTyID)) {
|
||||
// vector src bitcast to vector dst or vector src bitcast to scalar dst or
|
||||
// scalar src bitcast to vector dst
|
||||
bool isLittleEndian = getDataLayout().isLittleEndian();
|
||||
bool isLittleEndian = TD.isLittleEndian();
|
||||
GenericValue TempDst, TempSrc, SrcVec;
|
||||
const Type *SrcElemTy;
|
||||
const Type *DstElemTy;
|
||||
|
||||
Reference in New Issue
Block a user