Fix GlobalISel build.

llvm-svn: 288460
This commit is contained in:
Peter Collingbourne 2016-12-02 02:55:30 +00:00
parent 47a4b39646
commit 25a40759c1
1 changed files with 1 additions and 1 deletions

View File

@ -336,7 +336,7 @@ bool IRTranslator::translateGetElementPtr(const User &U) {
for (gep_type_iterator GTI = gep_type_begin(&U), E = gep_type_end(&U);
GTI != E; ++GTI) {
const Value *Idx = GTI.getOperand();
if (StructType *StTy = dyn_cast<StructType>(*GTI)) {
if (StructType *StTy = GTI.getStructTypeOrNull()) {
unsigned Field = cast<Constant>(Idx)->getUniqueInteger().getZExtValue();
Offset += DL->getStructLayout(StTy)->getElementOffset(Field);
continue;