restrict dyn_cast_or_null to pointer types, just like cast_or_null

llvm-svn: 114279
This commit is contained in:
Gabor Greif 2010-09-18 12:30:15 +00:00
parent a06741b356
commit d1d99c8483
1 changed files with 2 additions and 2 deletions

View File

@ -232,8 +232,8 @@ inline typename cast_retty<X, Y>::ret_type dyn_cast(const Y &Val) {
// value is accepted.
//
template <class X, class Y>
inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(const 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>(Val) : 0;
}
} // End llvm namespace