diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-09-05 09:13:25 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2008-09-05 09:13:25 +0000 |
commit | 80379f51e394a368d43b3c1c4aa7c608b09ac90d (patch) | |
tree | 3fa38c098461e2a3c76e46cd455d0e583e176313 /gcc/emit-rtl.c | |
parent | 0cf9dcf8059f11070bd77445ae399c994bbee410 (diff) | |
download | gcc-80379f51e394a368d43b3c1c4aa7c608b09ac90d.tar.gz |
emit-rtl.c (gen_rtvec): Rewrite not using gen_rtvec_v.
2008-09-05 Paolo Bonzini <bonzini@gnu.org>
* emit-rtl.c (gen_rtvec): Rewrite not using gen_rtvec_v.
(gen_rtvec_v): Fix coding standards.
From-SVN: r140031
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 9a887f6d6df..0efce7e2434 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -793,35 +793,29 @@ gen_lowpart_SUBREG (enum machine_mode mode, rtx reg) subreg_lowpart_offset (mode, inmode)); } -/* gen_rtvec (n, [rt1, ..., rtn]) -** -** This routine creates an rtvec and stores within it the -** pointers to rtx's which are its arguments. -*/ -/*VARARGS1*/ +/* Create an rtvec and stores within it the RTXen passed in the arguments. */ + rtvec gen_rtvec (int n, ...) { - int i, save_n; - rtx *vector; + int i; + rtvec rt_val; va_list p; va_start (p, n); + /* Don't allocate an empty rtvec... */ if (n == 0) - return NULL_RTVEC; /* Don't allocate an empty rtvec... */ + return NULL_RTVEC; - vector = XALLOCAVEC (rtx, n); + rt_val = rtvec_alloc (n); for (i = 0; i < n; i++) - vector[i] = va_arg (p, rtx); + rt_val->elem[i] = va_arg (p, rtx); - /* The definition of VA_* in K&R C causes `n' to go out of scope. */ - save_n = n; va_end (p); - - return gen_rtvec_v (save_n, vector); + return rt_val; } rtvec @@ -830,10 +824,11 @@ gen_rtvec_v (int n, rtx *argp) int i; rtvec rt_val; + /* Don't allocate an empty rtvec... */ if (n == 0) - return NULL_RTVEC; /* Don't allocate an empty rtvec... */ + return NULL_RTVEC; - rt_val = rtvec_alloc (n); /* Allocate an rtvec... */ + rt_val = rtvec_alloc (n); for (i = 0; i < n; i++) rt_val->elem[i] = *argp++; |