From ea0f49e52436272c65b52fe1e83f5009aa191a21 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Apr 2003 16:17:28 +0000 Subject: [PATCH] Allow dyn_cast to operate on things that aren't OBVIOUSLY a pointer type. These things can be converted to a pointer, like ilist_iterators git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5861 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/Support/Casting.h | 4 ++-- include/llvm/Support/Casting.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/Support/Casting.h b/include/Support/Casting.h index e0d50fe5d55..ba0a99a5598 100644 --- a/include/Support/Casting.h +++ b/include/Support/Casting.h @@ -211,8 +211,8 @@ inline typename cast_retty::ret_type cast_or_null(Y *Val) { // template -inline typename cast_retty::ret_type dyn_cast(Y *Val) { - return isa(Val) ? cast(Val) : 0; +inline typename cast_retty::ret_type dyn_cast(Y Val) { + return isa(Val) ? cast(Val) : 0; } // dyn_cast_or_null - Functionally identical to dyn_cast, except that a null diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index e0d50fe5d55..ba0a99a5598 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -211,8 +211,8 @@ inline typename cast_retty::ret_type cast_or_null(Y *Val) { // template -inline typename cast_retty::ret_type dyn_cast(Y *Val) { - return isa(Val) ? cast(Val) : 0; +inline typename cast_retty::ret_type dyn_cast(Y Val) { + return isa(Val) ? cast(Val) : 0; } // dyn_cast_or_null - Functionally identical to dyn_cast, except that a null