diff --git a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp index be68d46a876db..0e064d7227cea 100644 --- a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp +++ b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp @@ -1390,16 +1390,16 @@ void DXILBitcodeWriter::writeDISubrange(const DISubrange *N, // TODO: Do we need to handle DIExpression here? What about cases where Count // isn't specified but UpperBound and such are? - ConstantInt *Count = N->getCount().dyn_cast(); + ConstantInt *Count = dyn_cast(N->getCount()); assert(Count && "Count is missing or not ConstantInt"); Record.push_back(Count->getValue().getSExtValue()); // TODO: Similarly, DIExpression is allowed here now DISubrange::BoundType LowerBound = N->getLowerBound(); - assert((LowerBound.isNull() || LowerBound.is()) && + assert((LowerBound.isNull() || isa(LowerBound)) && "Lower bound provided but not ConstantInt"); Record.push_back( - LowerBound ? rotateSign(LowerBound.get()->getValue()) : 0); + LowerBound ? rotateSign(cast(LowerBound)->getValue()) : 0); Stream.EmitRecord(bitc::METADATA_SUBRANGE, Record, Abbrev); Record.clear();