[llvm] r258480 - Replace Type::getInt32Ty() and comparison by isIntegerTy(32). NFC.

Manuel Jacob via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 19:30:28 PST 2016


Author: mjacob
Date: Thu Jan 21 21:30:27 2016
New Revision: 258480

URL: http://llvm.org/viewvc/llvm-project?rev=258480&view=rev
Log:
Replace Type::getInt32Ty() and comparison by isIntegerTy(32).  NFC.

Modified:
    llvm/trunk/lib/IR/DataLayout.cpp

Modified: llvm/trunk/lib/IR/DataLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DataLayout.cpp?rev=258480&r1=258479&r2=258480&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DataLayout.cpp (original)
+++ llvm/trunk/lib/IR/DataLayout.cpp Thu Jan 21 21:30:27 2016
@@ -736,9 +736,7 @@ uint64_t DataLayout::getIndexedOffsetInT
   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...




More information about the llvm-commits mailing list