aboutsummaryrefslogtreecommitdiff
path: root/libcpp/internal.h
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-05-20 06:21:10 -0700
committerNathan Sidwell <nathan@acm.org>2020-05-20 06:23:24 -0700
commit4623a6f2d026b6b6dcd4c9b6f26e96cf5e52b4ac (patch)
tree802098af1ee0bf4645320883d7675976d0dbfac4 /libcpp/internal.h
parent610ae2dbbf98a291782cb05c0fb31e056193e5e2 (diff)
downloadgcc-4623a6f2d026b6b6dcd4c9b6f26e96cf5e52b4ac.zip
gcc-4623a6f2d026b6b6dcd4c9b6f26e96cf5e52b4ac.tar.gz
gcc-4623a6f2d026b6b6dcd4c9b6f26e96cf5e52b4ac.tar.bz2
preprocessor: Replace some flags with a single enum
_cpp_find_file has 3 bool arguments, at most one of which is ever set. Ripe for replacing with a 4-state enum. Also, this is C++, so 'typedef struct Foo Foo' is unnecessary. * internal.h (typedef _cpp_file): Delete, unnecessary in C++. (enum _cpp_find_file_kind): New. (_cpp_find_file): Use it, not 3 bools. * files.c (_cpp_find_file): Use _cpp_find_file_kind enum, not bools. (cpp_make_system_header): Break overly long line. (_cpp_stack_include, _cpp_fake_include) (_cpp_do_file_change, _cpp_compare_file_date, _cpp_has_header): Adjust. * init.c (cpp_read_main): Adjust _cpp_find_file call.
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r--libcpp/internal.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 765ff9d..049ee175 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -677,10 +677,10 @@ extern void _cpp_init_hashtable (cpp_reader *, cpp_hash_table *);
extern void _cpp_destroy_hashtable (cpp_reader *);
/* In files.c */
-typedef struct _cpp_file _cpp_file;
+enum _cpp_find_file_kind
+ { _cpp_FFK_NORMAL, _cpp_FFK_FAKE, _cpp_FFK_PRE_INCLUDE, _cpp_FFK_HAS_INCLUDE };
extern _cpp_file *_cpp_find_file (cpp_reader *, const char *, cpp_dir *,
- int angle, bool fake, bool preinclude,
- bool has_include, location_t);
+ int angle, _cpp_find_file_kind, location_t);
extern bool _cpp_find_failed (_cpp_file *);
extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
extern void _cpp_fake_include (cpp_reader *, const char *);