llvm.org GIT mirror llvm / ea0f49e
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 Chris Lattner 17 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
210210 //
211211
212212 template
213 inline typename cast_retty::ret_type dyn_cast(Y *Val) {
214 return isa(Val) ? cast(Val) : 0;
213 inline typename cast_retty::ret_type dyn_cast(Y Val) {
214 return isa(Val) ? cast(Val) : 0;
215215 }
216216
217217 // dyn_cast_or_null - Functionally identical to dyn_cast, except that a null
210210 //
211211
212212 template
213 inline typename cast_retty::ret_type dyn_cast(Y *Val) {
214 return isa(Val) ? cast(Val) : 0;
213 inline typename cast_retty::ret_type dyn_cast(Y Val) {
214 return isa(Val) ? cast(Val) : 0;
215215 }
216216
217217 // dyn_cast_or_null - Functionally identical to dyn_cast, except that a null