summaryrefslogtreecommitdiff
path: root/gcc/go/go-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/go-lang.c')
-rw-r--r--gcc/go/go-lang.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index f5229bbc451..8e7b8ba09d4 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -157,16 +157,14 @@ go_langhook_init_options_struct (struct gcc_options *opts)
opts->x_flag_non_call_exceptions = 1;
}
-/* Infrastructure for a VEC of char * pointers. */
+/* Infrastructure for a vector of char * pointers. */
typedef const char *go_char_p;
-DEF_VEC_P(go_char_p);
-DEF_VEC_ALLOC_P(go_char_p, heap);
/* The list of directories to search after all the Go specific
directories have been searched. */
-static VEC(go_char_p, heap) *go_search_dirs;
+static vec<go_char_p> go_search_dirs;
/* Handle Go specific options. Return 0 if we didn't do anything. */
@@ -222,7 +220,7 @@ go_langhook_handle_option (
/* Search ARG too, but only after we've searched to Go
specific directories for all -L arguments. */
- VEC_safe_push (go_char_p, heap, go_search_dirs, arg);
+ go_search_dirs.safe_push (arg);
}
break;
@@ -264,10 +262,9 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
gcc_assert (num_in_fnames > 0);
- FOR_EACH_VEC_ELT (go_char_p, go_search_dirs, ix, dir)
+ FOR_EACH_VEC_ELT (go_search_dirs, ix, dir)
go_add_search_path (dir);
- VEC_free (go_char_p, heap, go_search_dirs);
- go_search_dirs = NULL;
+ go_search_dirs.release ();
if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;