[PATCH] D115128: [TableGen][CodeEmitter] Introducing the VarLenCodeEmitterGen infrastructure

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 11 20:33:13 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:272
+  std::map<std::string, std::vector<std::string>>::iterator IE, EE;
+  for (IE = CaseMap.begin(), EE = CaseMap.end(); IE != EE; ++IE) {
+    const std::string &Case = IE->first;
----------------
Can this be a range for loop? Or can we use `auto` to move the declaration of IE/EE into the for statement?


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:274
+    const std::string &Case = IE->first;
+    std::vector<std::string> &InstList = IE->second;
+
----------------
const reference?


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:276
+
+    for (int i = 0, N = InstList.size(); i < N; i++) {
+      if (i)
----------------
Use a range for loop and `ListSeparator` to manage the new line?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115128/new/

https://reviews.llvm.org/D115128



More information about the llvm-commits mailing list