[llvm] [TableGen] DecoderEmitter clean-ups and modernization. (PR #84832)
Jason Eckhardt via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 13:44:42 PDT 2024
================
@@ -2025,29 +2023,26 @@ populateInstruction(CodeGenTarget &Target, const Record &EncodingDef,
// Gather the outputs/inputs of the instruction, so we can find their
// positions in the encoding. This assumes for now that they appear in the
// MCInst in the order that they're listed.
- std::vector<std::pair<Init *, StringRef>> InOutOperands;
+ std::vector<std::tuple<Init *, StringInit *>> InOutOperands;
DagInit *Out = Def.getValueAsDag("OutOperandList");
DagInit *In = Def.getValueAsDag("InOperandList");
- for (unsigned i = 0; i < Out->getNumArgs(); ++i)
- InOutOperands.push_back(std::pair(Out->getArg(i), Out->getArgNameStr(i)));
- for (unsigned i = 0; i < In->getNumArgs(); ++i)
- InOutOperands.push_back(std::pair(In->getArg(i), In->getArgNameStr(i)));
+ for (const auto &ArgPair :
----------------
nvjle wrote:
Fair enough. I've restored the two previous loops-- although I did at least use `enumerate` which is more concise (also eliminating the non-conforming variable name).
https://github.com/llvm/llvm-project/pull/84832
More information about the llvm-commits
mailing list