[PATCH] D35998: [TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true
Nirav Dave via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 28 08:07:45 PDT 2017
niravd added inline comments.
================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2001
<< "->" << Op.Class->RenderMethod << "(Inst, "
<< OpInfo.MINumOperands << ");\n"
<< " } else {\n"
----------------
It looks like you're only using the final DefaultOffset value in OpIdx calculation and NumDefault isn't used elsewhere so it seems like we don't need the array at all.
Does replacing the ++NumDefaults line with
if (OptionalOperandsMask[i]) ++NumDefaults;
work?
https://reviews.llvm.org/D35998
More information about the llvm-commits
mailing list