Skip to content

Commit 31249e2

Browse files
authored
[DirectX] Avoid deprecated PointerUnion methods (llvm#122972)
PointerUnion's `is`, `get`, and `dyn_cast` have been deprecated in favour of using `isa`, `cast`, and `dyn_cast` directly. Migrate these uses over.
1 parent 6e14f9b commit 31249e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,16 +1390,16 @@ void DXILBitcodeWriter::writeDISubrange(const DISubrange *N,
13901390

13911391
// TODO: Do we need to handle DIExpression here? What about cases where Count
13921392
// isn't specified but UpperBound and such are?
1393-
ConstantInt *Count = N->getCount().dyn_cast<ConstantInt *>();
1393+
ConstantInt *Count = dyn_cast<ConstantInt *>(N->getCount());
13941394
assert(Count && "Count is missing or not ConstantInt");
13951395
Record.push_back(Count->getValue().getSExtValue());
13961396

13971397
// TODO: Similarly, DIExpression is allowed here now
13981398
DISubrange::BoundType LowerBound = N->getLowerBound();
1399-
assert((LowerBound.isNull() || LowerBound.is<ConstantInt *>()) &&
1399+
assert((LowerBound.isNull() || isa<ConstantInt *>(LowerBound)) &&
14001400
"Lower bound provided but not ConstantInt");
14011401
Record.push_back(
1402-
LowerBound ? rotateSign(LowerBound.get<ConstantInt *>()->getValue()) : 0);
1402+
LowerBound ? rotateSign(cast<ConstantInt *>(LowerBound)->getValue()) : 0);
14031403

14041404
Stream.EmitRecord(bitc::METADATA_SUBRANGE, Record, Abbrev);
14051405
Record.clear();

0 commit comments

Comments
 (0)