mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Privatize StructLayout::MemberOffsets, adding an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -716,7 +716,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
|
||||
const StructLayout *SL =
|
||||
getTargetData()->getStructLayout(cast<StructType>(CPS->getType()));
|
||||
for (unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i)
|
||||
InitializeMemory(CPS->getOperand(i), (char*)Addr+SL->MemberOffsets[i]);
|
||||
InitializeMemory(CPS->getOperand(i), (char*)Addr+SL->getElementOffset(i));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1082,7 +1082,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
|
||||
const ConstantInt *CPU = cast<ConstantInt>(I.getOperand());
|
||||
unsigned Index = unsigned(CPU->getZExtValue());
|
||||
|
||||
Total += (PointerTy)SLO->MemberOffsets[Index];
|
||||
Total += (PointerTy)SLO->getElementOffset(Index);
|
||||
} else {
|
||||
const SequentialType *ST = cast<SequentialType>(*I);
|
||||
// Get the index number for the array... which must be long type...
|
||||
|
Reference in New Issue
Block a user