From: Richard Sandiford Date: Thu, 7 Dec 2017 18:42:14 +0000 (+0000) Subject: Make build_vector static X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44e1aae4dbd8198a26ab0ec5958e073e2c9cc772;p=gcc.git Make build_vector static The only remaining uses of build_vector are in the selftests in tree.c. This patch makes it static and moves it to the selftest part of the file. 2017-12-07 Richard Sandiford gcc/ * tree.c (build_vector): Delete. * tree.h (build_vector): Make static and move into the self-testing block. From-SVN: r255479 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d7954ff8fc6..7fb0d5656e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-07 Richard Sandiford + + * tree.c (build_vector): Delete. + * tree.h (build_vector): Make static and move into the self-testing + block. + 2017-12-07 Richard Sandiford * vector-builder.h (vector_builder::derived): New const overload. diff --git a/gcc/tree.c b/gcc/tree.c index e696d03ac06..13ae1c978e3 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1735,18 +1735,6 @@ make_vector (unsigned log2_npatterns, return t; } -/* Return a new VECTOR_CST node whose type is TYPE and whose values - are given by VALS. */ - -tree -build_vector (tree type, vec vals MEM_STAT_DECL) -{ - gcc_assert (vals.length () == TYPE_VECTOR_SUBPARTS (type)); - tree_vector_builder builder (type, vals.length (), 1); - builder.splice (vals); - return builder.build (); -} - /* Return a new VECTOR_CST node whose type is TYPE and whose values are extracted from V, a vector of CONSTRUCTOR_ELT. */ @@ -14066,6 +14054,18 @@ test_labels () ASSERT_FALSE (FORCED_LABEL (label_decl)); } +/* Return a new VECTOR_CST node whose type is TYPE and whose values + are given by VALS. */ + +static tree +build_vector (tree type, vec vals MEM_STAT_DECL) +{ + gcc_assert (vals.length () == TYPE_VECTOR_SUBPARTS (type)); + tree_vector_builder builder (type, vals.length (), 1); + builder.splice (vals); + return builder.build (); +} + /* Check that VECTOR_CST ACTUAL contains the elements in EXPECTED. */ static void diff --git a/gcc/tree.h b/gcc/tree.h index b3cf74779ba..306ff090408 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4044,7 +4044,6 @@ extern tree build_int_cst (tree, HOST_WIDE_INT); extern tree build_int_cstu (tree type, unsigned HOST_WIDE_INT cst); extern tree build_int_cst_type (tree, HOST_WIDE_INT); extern tree make_vector (unsigned, unsigned CXX_MEM_STAT_INFO); -extern tree build_vector (tree, vec CXX_MEM_STAT_INFO); extern tree build_vector_from_ctor (tree, vec *); extern tree build_vector_from_val (tree, tree); extern void recompute_constructor_flags (tree);