to do this unconditionally, given that the indices will always be small
constant integers anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288440
91177308-0d34-0410-b5e6-
96231b3b80d8
// Otherwise, add an index to drill into the first level of pointer.
} else {
assert(indices.empty());
- indices.push_back(llvm::ConstantInt::get(Builder.CGM.SizeTy, 0));
+ indices.push_back(llvm::ConstantInt::get(Builder.CGM.Int32Ty, 0));
}
assert(position >= Begin);
- indices.push_back(llvm::ConstantInt::get(Builder.CGM.SizeTy,
+ // We have to use i32 here because struct GEPs demand i32 indices.
+ // It's rather unlikely to matter in practice.
+ indices.push_back(llvm::ConstantInt::get(Builder.CGM.Int32Ty,
position - Begin));
}
};