index by using I.getOperand() here. This was failing an assertion on
basically every struct access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10426
91177308-0d34-0410-b5e6-
96231b3b80d8
if (const StructType *STy = dyn_cast<StructType>(*I)) {
const StructLayout *SLO = TD.getStructLayout(STy);
- // Indices must be ubyte constants...
- const ConstantUInt *CPU = cast<ConstantUInt>(*I);
+ const ConstantUInt *CPU = cast<ConstantUInt>(I.getOperand());
unsigned Index = CPU->getValue();
Total += SLO->MemberOffsets[Index];