mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-05 13:09:10 +00:00
Casting: assert that pointer arguments to isa<> are non-null.
This silences several analyzer warnings within LLVM, and provides a slightly nicer crash experience when someone calls isa<>, cast<>, or dyn_cast<> with a null pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164439 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3bbdddf527
commit
f5091b476c
@ -65,18 +65,21 @@ template <typename To, typename From> struct isa_impl_cl<To, const From> {
|
||||
|
||||
template <typename To, typename From> struct isa_impl_cl<To, From*> {
|
||||
static inline bool doit(const From *Val) {
|
||||
assert(Val && "isa<> used on a null pointer");
|
||||
return isa_impl<To, From>::doit(*Val);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename To, typename From> struct isa_impl_cl<To, const From*> {
|
||||
static inline bool doit(const From *Val) {
|
||||
assert(Val && "isa<> used on a null pointer");
|
||||
return isa_impl<To, From>::doit(*Val);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename To, typename From> struct isa_impl_cl<To, const From*const> {
|
||||
static inline bool doit(const From *Val) {
|
||||
assert(Val && "isa<> used on a null pointer");
|
||||
return isa_impl<To, From>::doit(*Val);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user