[preprocessor] Include stacking
authorNathan Sidwell <nathan@acm.org>
Thu, 29 Aug 2019 14:06:32 +0000 (14:06 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 29 Aug 2019 14:06:32 +0000 (14:06 +0000)
commitb0d11f1ed68727a85280e0ceb83bf77b5385902a
treed343c7483c9b5485fe33ff454c466a9d24d4f765
parentd02a0412422b144f6e84605997302a1c36e81600
[preprocessor] Include stacking

https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01971.html
* internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
IT_HEADER_HWM.
(_cpp_stack_file): Take include_type, not a bool.
* files.c (_cpp_find_file): Refactor to not hide an if inside a
for conditional.
(should_stack_file): Break apart to ...
(is_known_idempotent_file, has_unique_contents): ... these.
(_cpp_stack_file): Replace IMPORT boolean with include_type enum.
Refactor to use new predicates.  Do linemap compensation here ...
(_cpp_stack_include): ... not here.
* init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.

From-SVN: r275034
libcpp/ChangeLog
libcpp/files.c
libcpp/init.c
libcpp/internal.h