llvm-project/clang/test/Frontend/Inputs
Hans Wennborg f29dcbdde1 Add flag for showing skipped headers in -H / --show-includes output
Consider the following set of files:

  a.cc:
  #include "a.h"

  a.h:
  #ifndef A_H
  #define A_H

  #include "b.h"
  #include "c.h"  // This gets "skipped".

  #endif

  b.h:
  #ifndef B_H
  #define B_H

  #include "c.h"

  #endif

  c.h:
  #ifndef C_H
  #define C_H

  void c();

  #endif

And the output of the -H option:

  $ clang -c -H a.cc
  . ./a.h
  .. ./b.h
  ... ./c.h

Note that the include of c.h in a.h is not shown in the output (GCC does the
same). This is because of the include guard optimization: clang knows c.h is
covered by an include guard which is already defined, so when it sees the
include in a.h, it skips it. The same would have happened if #pragma once were
used instead of include guards.

However, a.h *does* include c.h, and it may be useful to show that in the -H
output. This patch adds a flag for doing that.

Differential revision: https://reviews.llvm.org/D100480
2021-04-14 17:01:51 +02:00
..
NextIncludes actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
SystemHeaderPrefix
TestFramework.framework/Headers
resource_dir_with_sanitizer_blacklist/share [clang][test][NFC] Use more widely supported sanitizer for file dependency tests 2020-01-14 12:55:11 -08:00
sysroot_x86_64_cross_linux_tree Reland r371785: Add -Wpoison-system-directories warning 2019-09-13 18:00:51 +00:00
absolute-paths.h
empty.h
line-directive.h
optimization-remark-with-hotness-sample.proftext
optimization-remark-with-hotness.proftext
profile-sample-use-loc-tracking.prof
remarks-hotness.prof [Remarks][2/2] Expand remarks hotness threshold option support in more tools 2020-11-30 21:55:50 -08:00
rewrite-includes-bom.h
rewrite-includes-messages.h
rewrite-includes1.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes2.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes3.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes4.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes5.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes6.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes7.h actually also compile output in tests for -frewrite-includes 2019-09-18 19:12:14 +00:00
rewrite-includes8.h
rewrite-includes9.h
test.h Add flag for showing skipped headers in -H / --show-includes output 2021-04-14 17:01:51 +02:00
test2.h Add flag for showing skipped headers in -H / --show-includes output 2021-04-14 17:01:51 +02:00
test3.h