forked from OSchip/llvm-project
restrict dyn_cast_or_null to pointer types, just like cast_or_null
llvm-svn: 114279
This commit is contained in:
parent
a06741b356
commit
d1d99c8483
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue