[llvm] r245712 - Remove an unnecessary use of pointee types introduced in r194220

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 10:37:41 PDT 2015


Author: dblaikie
Date: Fri Aug 21 12:37:41 2015
New Revision: 245712

URL: http://llvm.org/viewvc/llvm-project?rev=245712&view=rev
Log:
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.

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

Modified: llvm/trunk/lib/IR/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantFold.cpp?rev=245712&r1=245711&r2=245712&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantFold.cpp (original)
+++ llvm/trunk/lib/IR/ConstantFold.cpp Fri Aug 21 12:37:41 2015
@@ -1999,9 +1999,8 @@ static bool isInBoundsIndices(ArrayRef<I
 /// \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.




More information about the llvm-commits mailing list