aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2025-01-14 14:37:15 -0700
committerGitHub <noreply@github.com>2025-01-14 14:37:15 -0700
commit31249e27f0f8be16e80b2b574c1f2ce70853ed31 (patch)
treef4a8cbb69a077b36fd40cb13a6f45637cc91b73e /llvm/lib
parent6e14f9b40e15600ae7832826b47a7f0c0503a1d7 (diff)
downloadllvm-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.cpp6
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();