-H displays a tree of included header files, but that tree is supposed
to omit two categories of header files:
- Any header files pulled in via -include, which the code refers to as the "predefines".
- Any header files whose inclusion was skipped because they'd already been included (assuming header guards or #pragma once).
-fshow-skipped-includes was intended to make -H display the second
category of files. It wasn't checking for the first category, however,
so you could end up with only the middle of the -include hierarchy
displayed, e.g. the added test would previously output:
... /data/users/smeenai/llvm-project/clang/test/Frontend/Inputs/test2.h . /data/users/smeenai/llvm-project/clang/test/Frontend/Inputs/test.h
This diff adds a check to prevent that and correctly omit headers from
-include even when -fshow-skipped-includes is passed. While I'm
here, add tests for the interaction between -fshow-skipped-includes
and -sys-header-deps as well.