diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index de3dfb0754de..dd85a174f945 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -736,9 +736,7 @@ uint64_t DataLayout::getIndexedOffsetInType(Type *ElemTy, for (; GTI != GTE; ++GTI) { Value *Idx = GTI.getOperand(); if (StructType *STy = dyn_cast(*GTI)) { - assert(Idx->getType() == - Type::getInt32Ty(ElemTy->getContext()) && - "Illegal struct idx"); + assert(Idx->getType()->isIntegerTy(32) && "Illegal struct idx"); unsigned FieldNo = cast(Idx)->getZExtValue(); // Get structure layout information...