Skip to content

Commit 2b961b0

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#122854)
Note that PointerUnion::dyn_cast has 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> Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect Source to be nonnull.
1 parent 7aec7ca commit 2b961b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ByteCode/Disasm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@ LLVM_DUMP_METHOD void EvaluationResult::dump() const {
368368
case LValue: {
369369
assert(Source);
370370
QualType SourceType;
371-
if (const auto *D = Source.dyn_cast<const Decl *>()) {
371+
if (const auto *D = dyn_cast<const Decl *>(Source)) {
372372
if (const auto *VD = dyn_cast<ValueDecl>(D))
373373
SourceType = VD->getType();
374-
} else if (const auto *E = Source.dyn_cast<const Expr *>()) {
374+
} else if (const auto *E = dyn_cast<const Expr *>(Source)) {
375375
SourceType = E->getType();
376376
}
377377

0 commit comments

Comments
 (0)