From c473d8e431a219a3c46cf5b469506b5f6d3d4e79 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 10 Feb 2007 19:55:17 +0000 Subject: Privatize StructLayout::MemberOffsets, adding an accessor llvm-svn: 34156 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 2 +- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ExecutionEngine') diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 0fd6d461e1f..6878f89fffb 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -716,7 +716,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) { const StructLayout *SL = getTargetData()->getStructLayout(cast(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; } diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index fe80dfddd63..936d64f4441 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1082,7 +1082,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I, const ConstantInt *CPU = cast(I.getOperand()); unsigned Index = unsigned(CPU->getZExtValue()); - Total += (PointerTy)SLO->MemberOffsets[Index]; + Total += (PointerTy)SLO->getElementOffset(Index); } else { const SequentialType *ST = cast(*I); // Get the index number for the array... which must be long type... -- cgit v1.2.3