//
// The LLVM Compiler Infrastructure
//
-// This file was developed by Nick Lewycky and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
uint32_t typeToWidth(const Type *Ty) const {
if (TD)
return TD->getTypeSizeInBits(Ty);
-
- if (const IntegerType *ITy = dyn_cast<IntegerType>(Ty))
- return ITy->getBitWidth();
-
- return 0;
+ else
+ return Ty->getPrimitiveSizeInBits();
}
static bool isRelatedBy(const ConstantRange &CR1, const ConstantRange &CR2,
if (!isRelatedBy(Known, Zero, ICmpInst::ICMP_NE)) break;
// otherwise, fall-through.
case Instruction::Sub:
- if (Unknown == Op1) break;
+ if (Unknown == Op0) break;
// otherwise, fall-through.
case Instruction::Xor:
case Instruction::Add: