Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 *>();
ConstantInt *Count = dyn_cast<ConstantInt *>(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<ConstantInt *>()) &&
assert((LowerBound.isNull() || isa<ConstantInt *>(LowerBound)) &&
"Lower bound provided but not ConstantInt");
Record.push_back(
LowerBound ? rotateSign(LowerBound.get<ConstantInt *>()->getValue()) : 0);
LowerBound ? rotateSign(cast<ConstantInt *>(LowerBound)->getValue()) : 0);

Stream.EmitRecord(bitc::METADATA_SUBRANGE, Record, Abbrev);
Record.clear();
Expand Down
Loading