mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
restrict dyn_cast_or_null to pointer types, just like cast_or_null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -232,8 +232,8 @@ inline typename cast_retty<X, Y>::ret_type dyn_cast(const Y &Val) {
|
|||||||
// value is accepted.
|
// value is accepted.
|
||||||
//
|
//
|
||||||
template <class X, class Y>
|
template <class X, class Y>
|
||||||
inline typename cast_retty<X, Y>::ret_type dyn_cast_or_null(const Y &Val) {
|
inline typename cast_retty<X, Y*>::ret_type dyn_cast_or_null(Y *Val) {
|
||||||
return (Val && isa<X>(Val)) ? cast<X, Y>(Val) : 0;
|
return (Val && isa<X>(Val)) ? cast<X>(Val) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
Reference in New Issue
Block a user