[llvm] [CFGPrinter] Added command line option to change DOT font (PR #148403)

PysKa Ratzinger via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 13 04:06:25 PDT 2025


PysKa-Ratzinger wrote:

As an aside, the motivation for doing this patch is because "opt view-cfg" by default open KGraphViewer, which is fine, but zooming into the individual blocks, or zooming out, makes the font very ugly. I'm assuming the font is bitmap on my system?

(zoom out)
<img width="651" height="288" alt="image" src="https://github.com/user-attachments/assets/6d44ab73-f141-4e99-86c4-dc651538d13a" />

(zoom in)
<img width="1161" height="512" alt="image" src="https://github.com/user-attachments/assets/32a432e5-13fe-4b66-874d-98401c4a348b" />

I could make a script to run "opt dot-cfg" first, edit the file to use a ttf font, and then open the file again with KGraphViewer, but there is a secondary problem that I'm looking at heavily templated code, which sometimes explodes the names of the functions and prevents me from using the "dot-cfg" pass, since the name of the file would exceed the max filename allowed on Linux.

So I feel like this was really the only good option.

https://github.com/llvm/llvm-project/pull/148403


More information about the llvm-commits mailing list