From: Chris Lattner Date: Thu, 29 May 2003 15:07:48 +0000 (+0000) Subject: dyn_cast_or_null should work just the same as dyn_cast does X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=1ff1da7ac9bff43ba24445ff30ba2fd79bd95cd7;p=oota-llvm.git 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 --- diff --git a/include/Support/Casting.h b/include/Support/Casting.h index ba0a99a5598..491d1650837 100644 --- a/include/Support/Casting.h +++ b/include/Support/Casting.h @@ -207,7 +207,7 @@ inline typename cast_retty::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(myVal)) { ... } +// if (const Instruction *I = dyn_cast(myVal)) { ... } // template @@ -219,8 +219,8 @@ inline typename cast_retty::ret_type dyn_cast(Y Val) { // value is accepted. // template -inline typename cast_retty::ret_type dyn_cast_or_null(Y *Val) { - return (Val && isa(Val)) ? cast(Val) : 0; +inline typename cast_retty::ret_type dyn_cast_or_null(Y Val) { + return (Val && isa(Val)) ? cast(Val) : 0; } diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index ba0a99a5598..491d1650837 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -207,7 +207,7 @@ inline typename cast_retty::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(myVal)) { ... } +// if (const Instruction *I = dyn_cast(myVal)) { ... } // template @@ -219,8 +219,8 @@ inline typename cast_retty::ret_type dyn_cast(Y Val) { // value is accepted. // template -inline typename cast_retty::ret_type dyn_cast_or_null(Y *Val) { - return (Val && isa(Val)) ? cast(Val) : 0; +inline typename cast_retty::ret_type dyn_cast_or_null(Y Val) { + return (Val && isa(Val)) ? cast(Val) : 0; }