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 # ===----------------------------------------------------------------------===##
13 if __name__
== "__main__":
14 """Converts a header dependency CSV file to Graphviz dot file.
16 The header dependency CSV files are found on the directory
17 libcxx/test/libcxx/transitive_includes
20 parser
= argparse
.ArgumentParser(
21 description
="""Converts a libc++ dependency CSV file to a Graphviz dot file.
23 libcxx/utils/graph_header_deps.py libcxx/test/libcxx/transitive_includes/cxx20.csv | dot -Tsvg > graph.svg
25 formatter_class
=argparse
.RawDescriptionHelpFormatter
,
31 help="The header dependency CSV file.",
33 options
= parser
.parse_args()
37 graph [nodesep=0.5, ranksep=1];
38 node [shape=box, width=4];"""
40 with
open(options
.input, "r") as f
:
41 for line
in f
.readlines():
42 elements
= line
.rstrip().split(" ")
43 assert len(elements
) == 2
45 print(f
'\t"{elements[0]}" -> "{elements[1]}"')