[clang] 5dfacb1 - [clang][Interp][NFC] Replace dyn_cast_or_null with _if_present
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 7 00:43:00 PST 2022
Author: Timm Bäder
Date: 2022-11-07T09:42:41+01:00
New Revision: 5dfacb12452026eb9492d046e816fafa0ff5915c
URL: https://github.com/llvm/llvm-project/commit/5dfacb12452026eb9492d046e816fafa0ff5915c
DIFF: https://github.com/llvm/llvm-project/commit/5dfacb12452026eb9492d046e816fafa0ff5915c.diff
LOG: [clang][Interp][NFC] Replace dyn_cast_or_null with _if_present
... in Descriptor.h
Added:
Modified:
clang/lib/AST/Interp/Descriptor.h
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/Descriptor.h b/clang/lib/AST/Interp/Descriptor.h
index dacec6be89c7..b2f50815fe84 100644
--- a/clang/lib/AST/Interp/Descriptor.h
+++ b/clang/lib/AST/Interp/Descriptor.h
@@ -113,15 +113,15 @@ struct Descriptor final {
const Expr *asExpr() const { return Source.dyn_cast<const Expr *>(); }
const ValueDecl *asValueDecl() const {
- return dyn_cast_or_null<ValueDecl>(asDecl());
+ return dyn_cast_if_present<ValueDecl>(asDecl());
}
const FieldDecl *asFieldDecl() const {
- return dyn_cast_or_null<FieldDecl>(asDecl());
+ return dyn_cast_if_present<FieldDecl>(asDecl());
}
const RecordDecl *asRecordDecl() const {
- return dyn_cast_or_null<RecordDecl>(asDecl());
+ return dyn_cast_if_present<RecordDecl>(asDecl());
}
/// Returns the size of the object without metadata.
More information about the cfe-commits
mailing list