diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2005-03-04 11:10:35 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2005-03-04 11:10:35 +0000 |
commit | 7445392c29b2b16391e41bee61cfbe32d492ddf5 (patch) | |
tree | 023da1eca2bd7656ce3641b1d6d446908d801399 /gcc/gensupport.c | |
parent | 935167332d4ee2b0bb173e40a6cf36db53b67d16 (diff) | |
download | gcc-7445392c29b2b16391e41bee61cfbe32d492ddf5.zip gcc-7445392c29b2b16391e41bee61cfbe32d492ddf5.tar.gz gcc-7445392c29b2b16391e41bee61cfbe32d492ddf5.tar.bz2 |
* rtl.h (copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions)
(print_c_condition): Declare.
* read-rtl.c (ptr_loc): New structure.
(ptr_locs, ptr_loc_obstack, joined_conditions)
(joined_conditions_obstack): New variables.
(leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc)
(get_rtx_ptr_loc, copy_rtx_ptr_loc, print_rtx_ptr_loc)
(join_c_conditions, print_c_condition): New functions.
(apply_macro_to_string): Associate the new string with the same
source location as the old one.
(add_condition_to_string): Use join_c_conditions.
(read_string): Use set_rtx_ptr_loc to record a filename and line
number for the string.
(read_rtx): Initialize the new variables above.
* genattrtab.c (write_test_expr, write_attr_value): Use
print_c_condition.
* genconditions.c (write_header): Don't define MAYBE_EVAL. Move its
comment above the GCC_VERSION check.
(write_one_condition): Use print_rtx_ptr_loc and print_c_condition.
Inline the definition of MAYBE_EVAL.
* genemit.c (gen_expand, gen_split): Use print_rtx_ptr_loc.
* genoutput.c (process_template): Likewise.
* genpreds.c (write_predicate_subfunction): Likewise.
(write_predicate_expr): Use print_c_condition.
* genrecog.c (write_cond): Likewise.
* gensupport.c (process_rtx): Use join_c_conditions to join the
conditions of a define_insn_and_split. Record a source location
for the string after the "&&".
(alter_test_for_insn): Use join_c_conditions.
From-SVN: r95883
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r-- | gcc/gensupport.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c index a0b3faa..f13700a 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -317,7 +317,10 @@ process_rtx (rtx desc, int lineno) insn condition to create the new split condition. */ split_cond = XSTR (desc, 4); if (split_cond[0] == '&' && split_cond[1] == '&') - split_cond = concat (XSTR (desc, 2), split_cond, NULL); + { + copy_rtx_ptr_loc (split_cond + 2, split_cond); + split_cond = join_c_conditions (XSTR (desc, 2), split_cond + 2); + } XSTR (split, 1) = split_cond; XVEC (split, 2) = XVEC (desc, 5); XSTR (split, 3) = XSTR (desc, 6); @@ -663,16 +666,8 @@ static const char * alter_test_for_insn (struct queue_elem *ce_elem, struct queue_elem *insn_elem) { - const char *ce_test, *insn_test; - - ce_test = XSTR (ce_elem->data, 1); - insn_test = XSTR (insn_elem->data, 2); - if (!ce_test || *ce_test == '\0') - return insn_test; - if (!insn_test || *insn_test == '\0') - return ce_test; - - return concat ("(", ce_test, ") && (", insn_test, ")", NULL); + return join_c_conditions (XSTR (ce_elem->data, 1), + XSTR (insn_elem->data, 2)); } /* Adjust all of the operand numbers in SRC to match the shift they'll |