diff options
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/go/go-lang.c | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index f9bb910..9a90247 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,9 @@ +2012-11-17 Diego Novillo <dnovillo@google.com> + + Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) + + * go-lang.c: Use new vec API in vec.h. + 2012-11-16 Ian Lance Taylor <iant@google.com> * Make-lang.in (gccgo$(exeext)): Add + at start of command. diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index f5229bb..8e7b8ba 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; |