[opaque pointers] Remove use of PointerType::getElementType in favor of GEPOperator...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 29 Jul 2015 20:26:23 +0000 (20:26 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 29 Jul 2015 20:26:23 +0000 (20:26 +0000)
llvm-svn: 243566

llvm/lib/IR/AsmWriter.cpp

index 823916e..9018180 100644 (file)
@@ -1340,10 +1340,7 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
     Out << " (";
 
     if (const GEPOperator *GEP = dyn_cast<GEPOperator>(CE)) {
-      TypePrinter.print(
-          cast<PointerType>(GEP->getPointerOperandType()->getScalarType())
-              ->getElementType(),
-          Out);
+      TypePrinter.print(GEP->getSourceElementType(), Out);
       Out << ", ";
     }