[PATCH] D154102: Headers for basic blocks in control flow dot graphs

Marek Sedláček via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 01:29:21 PDT 2023


mark-sed added inline comments.


================
Comment at: llvm/include/llvm/Analysis/CFGPrinter.h:149
   raw_string_ostream OS(Str);
-
-  if (Node->getName().empty()) {
-    Node->printAsOperand(OS, false);
-    OS << ':';
-  }
-
   HandleBasicBlock(OS, *Node);
   std::string OutStr = OS.str();
----------------
knaumov wrote:
> Haven't you changed the logic of the OS argument here? It seems that now it is always empty.
So the previous code was a cause for a bug, where basic blocks with numbered label got their label displayed twice in the CFG. getName() will be empty in case of implicit and also explicit numbered name, but the explicit will get it inserted in the HandleBasicBlock. So the solution here is to prepend the name only if the HandleBasicBlock did not already do it.


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

https://reviews.llvm.org/D154102



More information about the llvm-commits mailing list