diff --git a/lib/Transforms/IPO/Attributor.cpp b/lib/Transforms/IPO/Attributor.cpp index c882f8ccf01..dff7011061a 100644 --- a/lib/Transforms/IPO/Attributor.cpp +++ b/lib/Transforms/IPO/Attributor.cpp @@ -428,16 +428,16 @@ void IRPosition::verify() { assert(KindOrArgNo >= 0 && "Expected argument or call site argument!"); assert((isa(AnchorVal) || isa(AnchorVal)) && "Expected call base or argument for positive attribute index!"); - if (auto *Arg = dyn_cast(AnchorVal)) { - assert(Arg->getArgNo() == unsigned(getArgNo()) && + if (isa(AnchorVal)) { + assert(cast(AnchorVal)->getArgNo() == unsigned(getArgNo()) && "Argument number mismatch!"); - assert(Arg == &getAssociatedValue() && "Associated value mismatch!"); + assert(cast(AnchorVal) == &getAssociatedValue() && + "Associated value mismatch!"); } else { - auto &CB = cast(*AnchorVal); - (void)CB; - assert(CB.arg_size() > unsigned(getArgNo()) && + assert(cast(*AnchorVal).arg_size() > unsigned(getArgNo()) && "Call site argument number mismatch!"); - assert(CB.getArgOperand(getArgNo()) == &getAssociatedValue() && + assert(cast(*AnchorVal).getArgOperand(getArgNo()) == + &getAssociatedValue() && "Associated value mismatch!"); } break;