[llvm] Fix mistake in comment regarding dyn_cast_or_null (PR #108026)
ofri frishman via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 10 06:37:45 PDT 2024
https://github.com/ofri-frishman created https://github.com/llvm/llvm-project/pull/108026
There was a mistake in a comment regarding dyn_cast_or_null deprication.
It was suggested to use cast_if_present instead of dyn_cast_or_null, but that was probably a copy paste mistake, and dyn_cast_if_present is the function that should be used instead of dyn_cast_or_null.
>From 0703557e544b5c78a98ba5edd3b75a9e3548eedf Mon Sep 17 00:00:00 2001
From: Ofri Frishman <ofri.frishman at mobileye.com>
Date: Thu, 5 Sep 2024 16:47:47 +0300
Subject: [PATCH] Fix mistake in comment regarding dyn_cast_or_null
There was a mistake in a comment regarding dyn_cast_or_null
deprication.
It was suggested to use cast_if_present instead of dyn_cast_or_null,
but that was probably a copy paste mistake, and dyn_cast_if_present
is the function that should be used instead of dyn_cast_or_null.
---
llvm/include/llvm/Support/Casting.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h
index 14a32ccd0e0dc9..66fdcb44ea2c00 100644
--- a/llvm/include/llvm/Support/Casting.h
+++ b/llvm/include/llvm/Support/Casting.h
@@ -755,7 +755,7 @@ template <class X, class Y> auto dyn_cast_if_present(Y *Val) {
// Forwards to dyn_cast_if_present to avoid breaking current users. This is
// deprecated and will be removed in a future patch, use
-// cast_if_present instead.
+// dyn_cast_if_present instead.
template <class X, class Y> auto dyn_cast_or_null(const Y &Val) {
return dyn_cast_if_present<X>(Val);
}
More information about the llvm-commits
mailing list