[PATCH] D133709: -dot-machine-cfg for printing MachineFunction to a dot file

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 08:52:51 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachineCFGPrinter.h:89
+      Node->printAsOperand(OS, false);
+      OS << ":";
+    }
----------------
Single quotes


================
Comment at: llvm/include/llvm/CodeGen/MachineCFGPrinter.h:97-122
+    unsigned ColNum = 0;
+    unsigned LastSpace = 0;
+    for (unsigned i = 0; i != OutStr.length(); ++i) {
+      if (OutStr[i] == '\n') { // Left justify
+        OutStr[i] = '\\';
+        OutStr.insert(OutStr.begin() + i + 1, 'l');
+        ColNum = 0;
----------------
This is duplicating the code in CFGPrinter. Can you templatify it to work on MachineBasicBlocks, similar to how the dominator tree does it?


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

https://reviews.llvm.org/D133709



More information about the llvm-commits mailing list