[llvm] 2a4992e - Fix mistake in comment regarding dyn_cast_or_null (#108026)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 08:02:25 PDT 2024


Author: ofri frishman
Date: 2024-09-11T08:02:14-07:00
New Revision: 2a4992e9e34de6b74aa8c254fea867d1271b3e97

URL: https://github.com/llvm/llvm-project/commit/2a4992e9e34de6b74aa8c254fea867d1271b3e97
DIFF: https://github.com/llvm/llvm-project/commit/2a4992e9e34de6b74aa8c254fea867d1271b3e97.diff

LOG: Fix mistake in comment regarding dyn_cast_or_null (#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.

Authored-by: Ofri Frishman <ofri.frishman at mobileye.com>

Added: 
    

Modified: 
    llvm/include/llvm/Support/Casting.h

Removed: 
    


################################################################################
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