diff --git a/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp --- a/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp @@ -968,6 +968,7 @@ } const StringInit *Code = dyn_cast(Apply.getArg(0)); + assert(Code && "Expected 1 StringInit argument in 'apply'"); auto Pat = std::make_unique(*Code, makeAnonPatName("apply"), /*IsApply*/ true); ApplyPats[Pat->getName()] = std::move(Pat);