diff options
author | Kazu Hirata <kazu@google.com> | 2024-12-12 07:54:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 07:54:48 -0800 |
commit | 2f8238f849c4836b333082f387d91408234ea73b (patch) | |
tree | 61a07fab288e27d94d83aa2c31f8c1086d85e559 /llvm/unittests | |
parent | a8e66d7f17bc648865cebf6b1e58c7a9071c6a84 (diff) | |
download | llvm-2f8238f849c4836b333082f387d91408234ea73b.zip llvm-2f8238f849c4836b333082f387d91408234ea73b.tar.gz llvm-2f8238f849c4836b333082f387d91408234ea73b.tar.bz2 |
[llvm] Migrate away from PointerUnion::{is,get} (NFC) (#119679)
Note that PointerUnion::{is,get} have been soft deprecated in
PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa<T>, cast<T> and the llvm::dyn_cast<T>
I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.
Diffstat (limited to 'llvm/unittests')
-rw-r--r-- | llvm/unittests/IR/IRBuilderTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp index 690af62..2fd5286 100644 --- a/llvm/unittests/IR/IRBuilderTest.cpp +++ b/llvm/unittests/IR/IRBuilderTest.cpp @@ -881,12 +881,12 @@ TEST_F(IRBuilderTest, DIBuilder) { auto ExpectOrder = [&](DbgInstPtr First, BasicBlock::iterator Second) { if (M->IsNewDbgInfoFormat) { - EXPECT_TRUE(First.is<DbgRecord *>()); + EXPECT_TRUE(isa<DbgRecord *>(First)); EXPECT_FALSE(Second->getDbgRecordRange().empty()); - EXPECT_EQ(GetLastDbgRecord(&*Second), First.get<DbgRecord *>()); + EXPECT_EQ(GetLastDbgRecord(&*Second), cast<DbgRecord *>(First)); } else { - EXPECT_TRUE(First.is<Instruction *>()); - EXPECT_EQ(&*std::prev(Second), First.get<Instruction *>()); + EXPECT_TRUE(isa<Instruction *>(First)); + EXPECT_EQ(&*std::prev(Second), cast<Instruction *>(First)); } }; |