Use type helper functions.
[oota-llvm.git] / lib / Transforms / Utils / SimplifyCFG.cpp
index c4c142301bf29d3b1389ddfa6f94e810b2fa28e5..0dea844aeb9f6223796b8cb2f8cba15b1b0fd719 100644 (file)
@@ -3160,7 +3160,7 @@ static bool TurnSwitchRangeIntoICmp(SwitchInst *SI, IRBuilder<> &Builder) {
 /// and use it to remove dead cases.
 static bool EliminateDeadSwitchCases(SwitchInst *SI) {
   Value *Cond = SI->getCondition();
-  unsigned Bits = cast<IntegerType>(Cond->getType())->getBitWidth();
+  unsigned Bits = Cond->getType()->getIntegerBitWidth();
   APInt KnownZero(Bits, 0), KnownOne(Bits, 0);
   ComputeMaskedBits(Cond, KnownZero, KnownOne);