restrict dyn_cast_or_null to pointer types, just like cast_or_null; re-commit of r114279, backed out in r114280

llvm-svn: 114282
This commit is contained in:
Gabor Greif 2010-09-18 13:03:32 +00:00
parent bf98608a3d
commit aaa6badd05
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