This should trigger a dereference before null-check warning,
but I don't see it when building with clang. In any case, the
current and known future users of this helper require non-null
args, so I'm converting the 'if' to an assert.
}
Constant *Constant::replaceUndefsWith(Constant *C, Constant *Replacement) {
+ assert(C && Replacement && "Expected non-nullptr constant arguments");
Type *Ty = C->getType();
- if (C && match(C, m_Undef())) {
+ if (match(C, m_Undef())) {
assert(Ty == Replacement->getType() && "Expected matching types");
return Replacement;
}