} else if (const SequentialType *ST = cast<SequentialType>(Ty)) {
// Get the index number for the array... which must be uint type...
- assert((*I)->getType() == Type::UIntTy);
+ assert((*I)->getType() == Type::LongTy);
unsigned Idx = getOperandValue(*I, SF).UIntVal;
if (const ArrayType *AT = dyn_cast<ArrayType>(ST))
if (Idx >= AT->getNumElements() && ArrayChecksEnabled) {
#include <math.h>
using std::vector;
-//************************* Forward Declarations ***************************/
-
-
//************************ Internal Functions ******************************/
}
-
-// Check for a constant (uint) 0.
-inline bool
-IsZero(Value* idx)
-{
- return (isa<ConstantInt>(idx) && cast<ConstantInt>(idx)->isNullValue());
-}
-
-
//------------------------------------------------------------------------
// Function SetOperandsForMemInstr
//
// offset. (An extra leading zero offset, if any, can be ignored.)
// Generate code sequence to compute address from index.
//
- bool firstIdxIsZero = IsZero(idxVec[0]);
+ bool firstIdxIsZero =
+ (idxVec[0] == Constant::getNullValue(idxVec[0]->getType()));
assert(idxVec.size() == 1U + firstIdxIsZero
&& "Array refs must be lowered before Instruction Selection");