diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-10 19:55:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-10 19:55:17 +0000 |
commit | b1919e2f08ecb37140af676fd2916f8d5ed7df3d (patch) | |
tree | c9373916caa20f1b69a6b4a5aa81c7c698c05d6f /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 68ce9ba666a7eb8c7eb3fb7888e4418fffd2e716 (diff) |
Privatize StructLayout::MemberOffsets, adding an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ae7a495bf4..16d25ee225 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1678,7 +1678,7 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) { unsigned Field = cast<ConstantInt>(Idx)->getZExtValue(); if (Field) { // N = N + Offset - uint64_t Offset = TD->getStructLayout(StTy)->MemberOffsets[Field]; + uint64_t Offset = TD->getStructLayout(StTy)->getElementOffset(Field); N = DAG.getNode(ISD::ADD, N.getValueType(), N, getIntPtrConstant(Offset)); } @@ -3702,7 +3702,7 @@ static bool OptimizeGEPExpression(GetElementPtrInst *GEPI, if (const StructType *StTy = dyn_cast<StructType>(Ty)) { unsigned Field = cast<ConstantInt>(Idx)->getZExtValue(); if (Field) - ConstantOffset += TD->getStructLayout(StTy)->MemberOffsets[Field]; + ConstantOffset += TD->getStructLayout(StTy)->getElementOffset(Field); Ty = StTy->getElementType(Field); } else { Ty = cast<SequentialType>(Ty)->getElementType(); |