aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-10 19:55:17 +0000
committerChris Lattner <sabre@nondot.org>2007-02-10 19:55:17 +0000
commitb1919e2f08ecb37140af676fd2916f8d5ed7df3d (patch)
treec9373916caa20f1b69a6b4a5aa81c7c698c05d6f /lib/Target/TargetData.cpp
parent68ce9ba666a7eb8c7eb3fb7888e4418fffd2e716 (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/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 41288ec671..1ebe5b5711 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -466,8 +466,7 @@ uint64_t TargetData::getIndexedOffset(const Type *ptrTy, Value* const* Indices,
const StructLayout *Layout = getStructLayout(STy);
// Add in the offset, as calculated by the structure layout info...
- assert(FieldNo < Layout->MemberOffsets.size() &&"FieldNo out of range!");
- Result += Layout->MemberOffsets[FieldNo];
+ Result += Layout->getElementOffset(FieldNo);
// Update Ty to refer to current element
Ty = STy->getElementType(FieldNo);