diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-11-30 01:55:24 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-11-30 01:55:24 +0000 |
commit | 0d35f155c06d1d273c1ff2810f6f2bc45b839035 (patch) | |
tree | 8578ac0f112a186a00b9a785bd39a4d19db3f4d6 /gcc | |
parent | 45b677bc9e532a1f201f98ed6d5acab03ab06e10 (diff) | |
download | gcc-0d35f155c06d1d273c1ff2810f6f2bc45b839035.zip gcc-0d35f155c06d1d273c1ff2810f6f2bc45b839035.tar.gz gcc-0d35f155c06d1d273c1ff2810f6f2bc45b839035.tar.bz2 |
genattrtab.c (attr_rtx_1): New function containing the majority of `attr_rtx'.
* genattrtab.c (attr_rtx_1): New function containing the
majority of `attr_rtx'. Move variable declarations into the
scope where they are used. Eliminate unnecessary gotos.
(attr_rtx): Now just a wrapper for `attr_rtx_1' using VA_OPEN,
VA_FIXEDARG, and VA_CLOSE.
From-SVN: r47465
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/genattrtab.c | 60 |
2 files changed, 34 insertions, 34 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8593a75..af7ef49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-11-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * genattrtab.c (attr_rtx_1): New function containing the + majority of `attr_rtx'. Move variable declarations into the + scope where they are used. Eliminate unnecessary gotos. + (attr_rtx): Now just a wrapper for `attr_rtx_1' using VA_OPEN, + VA_FIXEDARG, and VA_CLOSE. + 2001-11-30 Hans-Peter Nilsson <hp@axis.com> * config/cris/cris.c (cris_notice_update_cc): Check first diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 8b65fc8..1c75b2d 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -365,6 +365,7 @@ rtx pic_offset_table_rtx; static void attr_hash_add_rtx PARAMS ((int, rtx)); static void attr_hash_add_string PARAMS ((int, char *)); static rtx attr_rtx PARAMS ((enum rtx_code, ...)); +static rtx attr_rtx_1 PARAMS ((enum rtx_code, va_list)); static char *attr_printf PARAMS ((unsigned int, const char *, ...)) ATTRIBUTE_PRINTF_2; static char *attr_string PARAMS ((const char *, int)); @@ -541,25 +542,15 @@ attr_hash_add_string (hashcode, str) rtx attr_rtx (code, [element1, ..., elementn]) */ static rtx -attr_rtx VPARAMS ((enum rtx_code code, ...)) +attr_rtx_1 (code, p) + enum rtx_code code; + va_list p; { -#ifndef ANSI_PROTOTYPES - enum rtx_code code; -#endif - va_list p; - int i; /* Array indices... */ - const char *fmt; /* Current rtx's format... */ rtx rt_val = NULL_RTX;/* RTX to return to caller... */ int hashcode; struct attr_hash *h; struct obstack *old_obstack = rtl_obstack; - VA_START (p, code); - -#ifndef ANSI_PROTOTYPES - code = va_arg (p, enum rtx_code); -#endif - /* For each of several cases, search the hash table for an existing entry. Use that entry if one is found; otherwise create a new RTL and add it to the table. */ @@ -573,7 +564,6 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) { rt_val = rtx_alloc (code); XEXP (rt_val, 0) = arg0; - va_end (p); return rt_val; } @@ -582,7 +572,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) if (h->hashcode == hashcode && GET_CODE (h->u.rtl) == code && XEXP (h->u.rtl, 0) == arg0) - goto found; + return h->u.rtl; if (h == 0) { @@ -604,7 +594,6 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) rt_val = rtx_alloc (code); XEXP (rt_val, 0) = arg0; XEXP (rt_val, 1) = arg1; - va_end (p); return rt_val; } @@ -614,7 +603,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) && GET_CODE (h->u.rtl) == code && XEXP (h->u.rtl, 0) == arg0 && XEXP (h->u.rtl, 1) == arg1) - goto found; + return h->u.rtl; if (h == 0) { @@ -637,7 +626,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) if (h->hashcode == hashcode && GET_CODE (h->u.rtl) == code && XSTR (h->u.rtl, 0) == arg0) - goto found; + return h->u.rtl; if (h == 0) { @@ -659,7 +648,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) && GET_CODE (h->u.rtl) == code && XSTR (h->u.rtl, 0) == arg0 && XSTR (h->u.rtl, 1) == arg1) - goto found; + return h->u.rtl; if (h == 0) { @@ -673,19 +662,16 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) { HOST_WIDE_INT arg0 = va_arg (p, HOST_WIDE_INT); if (arg0 == 0) - { - va_end (p); - return false_rtx; - } - if (arg0 == 1) - { - va_end (p); - return true_rtx; - } - goto nohash; + return false_rtx; + else if (arg0 == 1) + return true_rtx; + else + goto nohash; } else { + int i; /* Array indices... */ + const char *fmt; /* Current rtx's format... */ nohash: rt_val = rtx_alloc (code); /* Allocate the storage space. */ @@ -722,19 +708,25 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) abort (); } } - va_end (p); return rt_val; } rtl_obstack = old_obstack; - va_end (p); attr_hash_add_rtx (hashcode, rt_val); RTX_INTEGRATED_P (rt_val) = 1; return rt_val; +} - found: - va_end (p); - return h->u.rtl; +static rtx +attr_rtx VPARAMS ((enum rtx_code code, ...)) +{ + rtx result; + + VA_OPEN (p, code); + VA_FIXEDARG (p, enum rtx_code, code); + result = attr_rtx_1 (code, p); + VA_CLOSE (p); + return result; } /* Create a new string printed with the printf line arguments into a space |