summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index de3dfb0754d..dd85a174f94 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<StructType>(*GTI)) {
- assert(Idx->getType() ==
- Type::getInt32Ty(ElemTy->getContext()) &&
- "Illegal struct idx");
+ assert(Idx->getType()->isIntegerTy(32) && "Illegal struct idx");
unsigned FieldNo = cast<ConstantInt>(Idx)->getZExtValue();
// Get structure layout information...
OpenPOWER on IntegriCloud