2 # ===----------------------------------------------------------------------===##
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 # ===----------------------------------------------------------------------===##
12 if __name__
== "__main__":
13 """Converts a header dependency CSV file to Graphviz dot file.
15 The header dependency CSV files are found on the directory
16 libcxx/test/libcxx/transitive_includes
19 parser
= argparse
.ArgumentParser(
20 description
="""Converts a libc++ dependency CSV file to a Graphviz dot file.
22 libcxx/utils/graph_header_deps.py libcxx/test/libcxx/transitive_includes/cxx20.csv | dot -Tsvg > graph.svg
24 formatter_class
=argparse
.RawDescriptionHelpFormatter
,
30 help="The header dependency CSV file.",
32 options
= parser
.parse_args()
36 graph [nodesep=0.5, ranksep=1];
37 node [shape=box, width=4];"""
39 with
open(options
.input, "r") as f
:
40 for line
in f
.readlines():
41 elements
= line
.rstrip().split(" ")
42 assert len(elements
) == 2
44 print(f
'\t"{elements[0]}" -> "{elements[1]}"')