[libc++] Simpler Python script for generating a graph of libc++'s header dependencies
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Mon, 22 Mar 2021 21:38:28 +0000 (17:38 -0400)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 23 Mar 2021 18:12:05 +0000 (14:12 -0400)
commita644920a02bfa30337c936afcdc04c9c7970b206
tree70ff68b03239daa7c7de6079545e28adaf53b82e
parentfdf97bc73891d6480bffc7bcfe4e2a55d61e8d9e
[libc++] Simpler Python script for generating a graph of libc++'s header dependencies

My attempts to play around with the old graph_header_deps.py were mostly fruitless;
I needed to modify it in various ways to make it work, and then even when I got it
working, it generated pretty ugly graphs.

Old graph_header_deps.py (after my local changes to simplify the usage)
(producing https://i.imgur.com/zATrsaP.jpg )

    mkdir foo
    time ./graph_header_deps.py --libcxx-only -o foo --clang-command ~/llvm-project/build/bin/clang++
    dot -Tpng < foo/all_headers.dot > old.png
    file old.png

    real    0m37.453s
    old.png: PNG image data, 25882 x 3035, 8-bit/color RGBA, non-interlaced

New graph_header_deps.py
(producing https://i.imgur.com/ZU0G52U.png )

    time ./graph_header_deps.py | dot -Tpng > new.png
    file new.png

    real    0m1.063s
    new.png: PNG image data, 6162 x 1344, 8-bit/color RGBA, non-interlaced

Differential Revision: https://reviews.llvm.org/D99124
libcxx/utils/graph_header_deps.py
libcxx/utils/libcxx/graph.py [deleted file]