[PATCH] D52366: [tblgen][disasm] Separate encodings from instructions

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 10:24:54 PDT 2018


bogner added inline comments.


================
Comment at: utils/TableGen/FixedLenDecoderEmitter.cpp:94-95
+
+  EncodingAndInst(const Record *EncodingDef, const CodeGenInstruction *Inst)
+      : EncodingDef(EncodingDef), Inst(Inst) {}
+};
----------------
Would simplifying by omitting this and just using brace-initialization be better?


================
Comment at: utils/TableGen/FixedLenDecoderEmitter.cpp:420-422
+    if (EncodingDef != InstDef)
+      OS << EncodingDef->getName() << ":";
+    OS << InstDef->getName();
----------------
Why not use the operator<< here if you're going to define it above anyway?


================
Comment at: utils/TableGen/FixedLenDecoderEmitter.cpp:851-853
+        if (EncodingDef != Def)
+          OS << EncodingDef->getName() << " => ";
+        OS << Def->getName() << "\n";
----------------
Same here (unless using => instead of : is important for some reason?)


Repository:
  rL LLVM

https://reviews.llvm.org/D52366





More information about the llvm-commits mailing list