summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/IR/AsmWriter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 823916e7690..9018180ad75 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -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 << ", ";
}
OpenPOWER on IntegriCloud