summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Casting.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-29 15:07:48 +0000
committerChris Lattner <sabre@nondot.org>2003-05-29 15:07:48 +0000
commit1ff1da7ac9bff43ba24445ff30ba2fd79bd95cd7 (patch)
treeb83566a75237d2ec9410e15c965ffa421374efc6 /include/llvm/Support/Casting.h
parentaa101c3147debcba3f0441c80b477782e456a03b (diff)
downloadllvm-1ff1da7ac9bff43ba24445ff30ba2fd79bd95cd7.tar.gz
llvm-1ff1da7ac9bff43ba24445ff30ba2fd79bd95cd7.tar.bz2
llvm-1ff1da7ac9bff43ba24445ff30ba2fd79bd95cd7.tar.xz
dyn_cast_or_null should work just the same as dyn_cast does
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Casting.h')
-rw-r--r--include/llvm/Support/Casting.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h
index ba0a99a559..491d165083 100644
--- a/include/llvm/Support/Casting.h
+++ b/include/llvm/Support/Casting.h
@@ -207,7 +207,7 @@ inline typename cast_retty<X, Y*>::ret_type cast_or_null(Y *Val) {
// be used to test for a type as well as cast if successful. This should be
// used in the context of an if statement like this:
//
-// if (const Instruction *I = dyn_cast<const Instruction>(myVal)) { ... }
+// if (const Instruction *I = dyn_cast<Instruction>(myVal)) { ... }
//
template <class X, class Y>
@@ -219,8 +219,8 @@ inline typename cast_retty<X, Y>::ret_type dyn_cast(Y Val) {
// value is accepted.
//
template <class X, class Y>
-inline typename cast_retty<X, Y*>::ret_type dyn_cast_or_null(Y *Val) {
- return (Val && isa<X>(Val)) ? cast<X, Y*>(Val) : 0;
+inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(Y Val) {
+ return (Val && isa<X>(Val)) ? cast<X, Y>(Val) : 0;
}