[llvm] r286750 - Bitcode: More precise casting. NFCI.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 12 22:59:28 PST 2016


Author: pcc
Date: Sun Nov 13 00:59:28 2016
New Revision: 286750

URL: http://llvm.org/viewvc/llvm-project?rev=286750&view=rev
Log:
Bitcode: More precise casting. NFCI.

Modified:
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=286750&r1=286749&r2=286750&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Sun Nov 13 00:59:28 2016
@@ -3479,7 +3479,7 @@ Error BitcodeReader::parseConstants() {
 
       if (PointeeType &&
           PointeeType !=
-              cast<SequentialType>(Elts[0]->getType()->getScalarType())
+              cast<PointerType>(Elts[0]->getType()->getScalarType())
                   ->getElementType())
         return error("Explicit gep operator type does not match pointee type "
                      "of pointer operand");
@@ -4733,10 +4733,10 @@ Error BitcodeReader::parseFunctionBody(F
         return error("Invalid record");
 
       if (!Ty)
-        Ty = cast<SequentialType>(BasePtr->getType()->getScalarType())
+        Ty = cast<PointerType>(BasePtr->getType()->getScalarType())
                  ->getElementType();
       else if (Ty !=
-               cast<SequentialType>(BasePtr->getType()->getScalarType())
+               cast<PointerType>(BasePtr->getType()->getScalarType())
                    ->getElementType())
         return error(
             "Explicit gep type does not match pointee type of pointer operand");




More information about the llvm-commits mailing list