def is_config_header(h):
- return os.path.basename(h) in ['__config', '__libcpp_version']
+ return os.path.basename(h) in ['__config', '__libcpp_version', '__undef_macros']
def is_experimental_header(h):
result = []
for root, _, files in os.walk(root):
for fname in files:
- if '__support' in root:
+ if os.path.basename(root).startswith('__') or fname.startswith('__'):
pass
elif ('.' in fname and not fname.endswith('.h')):
pass
if __name__ == '__main__':
- parser = argparse.ArgumentParser(description='Produce a dependency graph of libc++ headers, in GraphViz dot format.')
+ parser = argparse.ArgumentParser(
+ description='Produce a dependency graph of libc++ headers, in GraphViz dot format.\n' +
+ 'For example, ./graph_header_deps.py | dot -Tpng > graph.png',
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
parser.add_argument('--root', default=None, metavar='FILE', help='File or directory to be the root of the dependency graph')
parser.add_argument('-I', dest='search_dirs', default=[], action='append', metavar='DIR', help='Path(s) to search for local includes')
parser.add_argument('--show-transitive-edges', action='store_true', help='Show edges to headers that are transitively included anyway')
- parser.add_argument('--show-config-headers', action='store_true', help='Show headers named __config')
+ parser.add_argument('--show-config-headers', action='store_true', help='Show universally included headers, such as __config')
parser.add_argument('--show-experimental-headers', action='store_true', help='Show headers in the experimental/ and ext/ directories')
parser.add_argument('--show-support-headers', action='store_true', help='Show headers in the __support/ directory')
parser.add_argument('--show-individual-line-counts', action='store_true', help='Include an individual line count in each node')