Skip to content

[DirectX] Avoid deprecated PointerUnion methods #122972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
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