void Verifier::visitMDLocation(const MDLocation &N) {
Assert1(N.getScope(), "location requires a valid scope", &N);
- if (N.getInlinedAt())
- Assert2(isa<MDLocation>(N.getInlinedAt()),
- "inlined-at should be a location", &N, N.getInlinedAt());
+ if (auto *IA = N.getInlinedAt())
+ Assert2(isa<MDLocation>(IA), "inlined-at should be a location", &N, IA);
}
void Verifier::visitGenericDebugNode(const GenericDebugNode &N) {
const MDNode *N = Idents->getOperand(i);
Assert1(N->getNumOperands() == 1,
"incorrect number of operands in llvm.ident metadata", N);
- Assert1(isa<MDString>(N->getOperand(0)),
+ Assert1(dyn_cast_or_null<MDString>(N->getOperand(0)),
("invalid value for llvm.ident metadata entry operand"
"(the operand should be a string)"),
N->getOperand(0));
Module::ModFlagBehavior MFB;
if (!Module::isValidModFlagBehavior(Op->getOperand(0), MFB)) {
Assert1(
- mdconst::dyn_extract<ConstantInt>(Op->getOperand(0)),
+ mdconst::dyn_extract_or_null<ConstantInt>(Op->getOperand(0)),
"invalid behavior operand in module flag (expected constant integer)",
Op->getOperand(0));
Assert1(false,