[clang][Interp][NFC] Replace dyn_cast_or_null with _if_present
authorTimm Bäder <tbaeder@redhat.com>
Mon, 31 Oct 2022 08:08:20 +0000 (09:08 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Mon, 7 Nov 2022 08:42:41 +0000 (09:42 +0100)
... in Descriptor.h

clang/lib/AST/Interp/Descriptor.h

index dacec6b..b2f5081 100644 (file)
@@ -113,15 +113,15 @@ public:
   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.