From b0d11f1ed68727a85280e0ceb83bf77b5385902a Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Thu, 29 Aug 2019 14:06:32 +0000 Subject: [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/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcpp/init.c') diff --git a/libcpp/init.c b/libcpp/init.c index 472f104cb5f..ccbfc96489d 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -651,7 +651,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname) if (_cpp_find_failed (pfile->main_file)) return NULL; - _cpp_stack_file (pfile, pfile->main_file, false, loc); + _cpp_stack_file (pfile, pfile->main_file, IT_MAIN, 0); /* For foo.i, read the original filename foo.c now, for the benefit of the front ends. */ -- cgit v1.2.1