aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-10-11 18:09:59 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-10-11 18:09:59 +0000
commitb90c93381261e3c7fff0bf25fad4c22407ab9b73 (patch)
tree9ea0969a69bf3e506dfd77d4a35fb7ef8c761a34 /gcc/c-family
parent42851ff81dbe1ccaa16dbcc070513c181ff61eb7 (diff)
downloadgcc-b90c93381261e3c7fff0bf25fad4c22407ab9b73.zip
gcc-b90c93381261e3c7fff0bf25fad4c22407ab9b73.tar.gz
gcc-b90c93381261e3c7fff0bf25fad4c22407ab9b73.tar.bz2
[PATCH] Include path enumeration
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00693.html gcc/ * incpath.h (enum incpath_kind): Name enum, prefix values. (add_path, add_cpp_dir_path, get_added_cpp_dirs): Use incpath_kind. * incpath.c (heads, tails): Use INC_MAX. (add_env_var_paths, add_standard_paths): Use incpath_kind. (merge_include_chains, split_quote_chain, register_include_chains): Update incpath_kind names. (add_cpp_dir_path, add_path, get_added_cpp_dirs): Use incpath_kind. * config/darwin-c.c (add_system_framework_path): Update incpath_kind names. (add_framework_path, darwin_register_objc_includes): Likewise. * config/vms/vms-c.c (vms_c_register_includes): Likewise. gcc/c-family/ * c-opts.c (add_prefixed_path): Change chain to incpath_kind. (c_common_handle_option): Update incpath_kind names. gcc/fortran/ * cpp.c (gfc_cpp_add_include_path): Update incpath_e names. (gfc_cpp_add_include_path_after): Likewise. From-SVN: r253654
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-opts.c16
2 files changed, 13 insertions, 8 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 51e1b77..da40ab3 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-11 Nathan Sidwell <nathan@acm.org>
+
+ * c-opts.c (add_prefixed_path): Change chain to incpath_kind.
+ (c_common_handle_option): Update incpath_kind names.
+
2017-10-11 Martin Liska <mliska@suse.cz>
PR sanitizer/82490
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 3662aa3..6bd5355 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -118,7 +118,7 @@ static void set_std_c11 (int);
static void check_deps_environment_vars (void);
static void handle_deferred_opts (void);
static void sanitize_cpp_opts (void);
-static void add_prefixed_path (const char *, size_t);
+static void add_prefixed_path (const char *, incpath_kind);
static void push_command_line_include (void);
static void cb_file_change (cpp_reader *, const line_map_ordinary *);
static void cb_dir_change (cpp_reader *, const char *);
@@ -316,7 +316,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
case OPT_I:
if (strcmp (arg, "-"))
- add_path (xstrdup (arg), BRACKET, 0, true);
+ add_path (xstrdup (arg), INC_BRACKET, 0, true);
else
{
if (quote_chain_split)
@@ -550,7 +550,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_idirafter:
- add_path (xstrdup (arg), AFTER, 0, true);
+ add_path (xstrdup (arg), INC_AFTER, 0, true);
break;
case OPT_imacros:
@@ -567,7 +567,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_iquote:
- add_path (xstrdup (arg), QUOTE, 0, true);
+ add_path (xstrdup (arg), INC_QUOTE, 0, true);
break;
case OPT_isysroot:
@@ -575,15 +575,15 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_isystem:
- add_path (xstrdup (arg), SYSTEM, 0, true);
+ add_path (xstrdup (arg), INC_SYSTEM, 0, true);
break;
case OPT_iwithprefix:
- add_prefixed_path (arg, SYSTEM);
+ add_prefixed_path (arg, INC_SYSTEM);
break;
case OPT_iwithprefixbefore:
- add_prefixed_path (arg, BRACKET);
+ add_prefixed_path (arg, INC_BRACKET);
break;
case OPT_lang_asm:
@@ -1326,7 +1326,7 @@ sanitize_cpp_opts (void)
/* Add include path with a prefix at the front of its name. */
static void
-add_prefixed_path (const char *suffix, size_t chain)
+add_prefixed_path (const char *suffix, incpath_kind chain)
{
char *path;
const char *prefix;