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:
Chris Lattner
2007-02-10 19:55:17 +00:00
parent 68ce9ba666
commit b1919e2f08
10 changed files with 20 additions and 14 deletions

View File

@ -70,7 +70,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
if (const StructType *ST = dyn_cast<StructType>(*GTI)) {
// N = N + Offset
Offset += TD.getStructLayout(ST)->MemberOffsets[CI->getZExtValue()];
Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue());
} else {
const SequentialType *ST = cast<SequentialType>(*GTI);
Offset += TD.getTypeSize(ST->getElementType())*CI->getSExtValue();