Remove an unnecessary use of pointee types introduced in r194220
David Majnemer (the original author) believes this to be an impossible
condition to reach anyway, and no test cases cover this so we'll go with
that.
llvm-svn: 245712
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 5dd075a..131c5c5 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -1999,9 +1999,8 @@
/// \brief Test whether a given ConstantInt is in-range for a SequentialType.
static bool isIndexInRangeOfSequentialType(SequentialType *STy,
const ConstantInt *CI) {
- if (auto *PTy = dyn_cast<PointerType>(STy))
- // Only handle pointers to sized types, not pointers to functions.
- return PTy->getElementType()->isSized();
+ if (isa<PointerType>(STy))
+ return true;
uint64_t NumElements = 0;
// Determine the number of elements in our sequential type.