This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH v2 10/18] Use CONST_STRING_P macro. Autogenerated patch by running ../contrib/rtl-pred.sh CONST_STRING
2019-08-05 Arvind Sankar <nivedita@alum.mit.edu>
gcc/ChangeLog:
* config/avr/avr.c: Convert GET_CODE (..) == CONST_STRING to
CONST_STRING_P (..).
* dwarf2out.c: Likewise.
* genattrtab.c: Likewise.
* gensupport.c: Likewise.
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 760e9371a01..015d36728a3 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -2965,7 +2965,7 @@ avr_print_operand (FILE *file, rtx x, int code)
REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (x), val);
fprintf (file, "0x%lx", val);
}
- else if (GET_CODE (x) == CONST_STRING)
+ else if (CONST_STRING_P (x))
fputs (XSTR (x, 0), file);
else if (code == 'j')
fputs (cond_string (GET_CODE (x)), file);
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index c84885a24bb..7417551b120 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -18421,7 +18421,7 @@ loc_list_from_tree_1 (tree loc, int want_address,
val &= GET_MODE_MASK (DECL_MODE (loc));
ret = int_loc_descriptor (val);
}
- else if (GET_CODE (rtl) == CONST_STRING)
+ else if (CONST_STRING_P (rtl))
{
expansion_failed (loc, NULL_RTX, "CONST_STRING");
return 0;
@@ -19687,7 +19687,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
return false;
case MEM:
- if (GET_CODE (XEXP (rtl, 0)) == CONST_STRING
+ if (CONST_STRING_P (XEXP (rtl, 0))
&& MEM_READONLY_P (rtl)
&& GET_MODE (rtl) == BLKmode)
{
@@ -20165,7 +20165,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p)
the location. */
rtl = rtl_for_decl_location (decl);
- if (rtl && (CONSTANT_P (rtl) || GET_CODE (rtl) == CONST_STRING)
+ if (rtl && (CONSTANT_P (rtl) || CONST_STRING_P (rtl))
&& add_const_value_attribute (die, rtl))
return true;
@@ -20186,7 +20186,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, bool cache_p)
rtl = NOTE_VAR_LOCATION_LOC (node->loc);
if (GET_CODE (rtl) == EXPR_LIST)
rtl = XEXP (rtl, 0);
- if ((CONSTANT_P (rtl) || GET_CODE (rtl) == CONST_STRING)
+ if ((CONSTANT_P (rtl) || CONST_STRING_P (rtl))
&& add_const_value_attribute (die, rtl))
return true;
}
@@ -29855,7 +29855,7 @@ resolve_one_addr (rtx *addr)
{
rtx rtl = *addr;
- if (GET_CODE (rtl) == CONST_STRING)
+ if (CONST_STRING_P (rtl))
{
size_t len = strlen (XSTR (rtl, 0)) + 1;
tree t = build_string (len, XSTR (rtl, 0));
@@ -29960,7 +29960,7 @@ optimize_one_addr_into_implicit_ptr (dw_loc_descr_ref loc)
offset = INTVAL (XEXP (XEXP (rtl, 0), 1));
rtl = XEXP (XEXP (rtl, 0), 0);
}
- if (GET_CODE (rtl) == CONST_STRING)
+ if (CONST_STRING_P (rtl))
{
size_t len = strlen (XSTR (rtl, 0)) + 1;
tree t = build_string (len, XSTR (rtl, 0));
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index cdf0b5c12dc..6b24323f112 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -739,7 +739,7 @@ check_attr_test (file_location loc, rtx exp, attr_desc *attr)
else
{
for (av = attr2->first_value; av; av = av->next)
- if (GET_CODE (av->value) == CONST_STRING
+ if (CONST_STRING_P (av->value)
&& ! strcmp (XSTR (exp, 1), XSTR (av->value, 0)))
break;
@@ -892,7 +892,7 @@ check_attr_value (file_location loc, rtx exp, class attr_desc *attr)
}
for (av = attr->first_value; av; av = av->next)
- if (GET_CODE (av->value) == CONST_STRING
+ if (CONST_STRING_P (av->value)
&& ! strcmp (XSTR (av->value, 0), XSTR (exp, 0)))
break;
@@ -5000,7 +5000,7 @@ make_automaton_attrs (void)
{
if (val == tune_attr->default_val)
continue;
- gcc_assert (GET_CODE (val->value) == CONST_STRING);
+ gcc_assert (CONST_STRING_P (val->value));
fprintf (dfa_file,
"extern int internal_dfa_insn_code_%s (rtx_insn *);\n",
XSTR (val->value, 0));
@@ -5012,7 +5012,7 @@ make_automaton_attrs (void)
{
if (val == tune_attr->default_val)
continue;
- gcc_assert (GET_CODE (val->value) == CONST_STRING);
+ gcc_assert (CONST_STRING_P (val->value));
fprintf (latency_file,
"extern int insn_default_latency_%s (rtx_insn *);\n",
XSTR (val->value, 0));
@@ -5024,7 +5024,7 @@ make_automaton_attrs (void)
{
if (val == tune_attr->default_val)
continue;
- gcc_assert (GET_CODE (val->value) == CONST_STRING);
+ gcc_assert (CONST_STRING_P (val->value));
fprintf (attr_file,
"extern int internal_dfa_insn_code_%s (rtx_insn *);\n"
"extern int insn_default_latency_%s (rtx_insn *);\n",
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 1aab7119901..c26057079fd 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -683,7 +683,7 @@ is_predicable (class queue_elem *elem)
|| strcmp (XSTR (SET_DEST (sub), 0), "predicable") != 0)
break;
sub = SET_SRC (sub);
- if (GET_CODE (sub) == CONST_STRING)
+ if (CONST_STRING_P (sub))
{
value = XSTR (sub, 0);
goto found;
@@ -775,7 +775,7 @@ has_subst_attribute (class queue_elem *elem, class queue_elem *subst_elem)
|| strcmp (XSTR (SET_DEST (cur_attr), 0), subst_name) != 0)
break;
cur_attr = SET_SRC (cur_attr);
- if (GET_CODE (cur_attr) == CONST_STRING)
+ if (CONST_STRING_P (cur_attr))
{
value = XSTR (cur_attr, 0);
goto found;
@@ -1415,7 +1415,7 @@ alter_attrs_for_insn (rtx insn)
if (strcmp (XSTR (SET_DEST (sub), 0), "predicable") == 0)
{
sub = SET_SRC (sub);
- if (GET_CODE (sub) == CONST_STRING)
+ if (CONST_STRING_P (sub))
{
predicable_idx = i;
XSTR (sub, 0) = "ce_enabled";
--
2.21.0