diff options
author | Justin Bogner <mail@justinbogner.com> | 2025-01-14 14:37:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 14:37:15 -0700 |
commit | 31249e27f0f8be16e80b2b574c1f2ce70853ed31 (patch) | |
tree | f4a8cbb69a077b36fd40cb13a6f45637cc91b73e /llvm/lib | |
parent | 6e14f9b40e15600ae7832826b47a7f0c0503a1d7 (diff) | |
download | llvm-31249e27f0f8be16e80b2b574c1f2ce70853ed31.zip llvm-31249e27f0f8be16e80b2b574c1f2ce70853ed31.tar.gz llvm-31249e27f0f8be16e80b2b574c1f2ce70853ed31.tar.bz2 |
[DirectX] Avoid deprecated PointerUnion methods (#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.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp index be68d46..0e064d72 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 *>(); + 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(); |