[llvm] Fix mistake in comment regarding dyn_cast_or_null (PR #108026)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 10 06:38:39 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: ofri frishman (ofri-frishman)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/108026.diff
1 Files Affected:
- (modified) llvm/include/llvm/Support/Casting.h (+1-1)
``````````diff
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);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/108026
More information about the llvm-commits
mailing list