[PATCH] D154092: Monospace font for control flow dot graphs

Marek Sedláček via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 08:33:06 PDT 2023


mark-sed created this revision.
mark-sed added reviewers: cdevadas, rcorcs, knaumov, sfertile.
Herald added a project: All.
mark-sed requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is 1/3 changes to the CFG pass that aims to make graphs more readable and contain more information.

This change sets the font to monospace font since almost all programmers are used to these fonts being used for code and makes it thus more readable than the current sans font.

If all 3 changes will be accepted the final graphs should look as in the attached image:
F28074492: new_cfg.png <https://reviews.llvm.org/F28074492>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154092

Files:
  llvm/include/llvm/Analysis/CFGPrinter.h


Index: llvm/include/llvm/Analysis/CFGPrinter.h
===================================================================
--- llvm/include/llvm/Analysis/CFGPrinter.h
+++ llvm/include/llvm/Analysis/CFGPrinter.h
@@ -308,7 +308,8 @@
                                 : (getHeatColor(1));
 
     std::string Attrs = "color=\"" + EdgeColor + "ff\", style=filled," +
-                        " fillcolor=\"" + Color + "70\"";
+                        " fillcolor=\"" + Color + "70\"" +
+                        " fontname=\"Courier\"";
     return Attrs;
   }
   bool isNodeHidden(const BasicBlock *Node, const DOTFuncInfo *CFGInfo);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154092.535813.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230629/06f73079/attachment.bin>


More information about the llvm-commits mailing list