Report ambiguous uses of .md attributes
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 16 Jul 2019 08:41:21 +0000 (08:41 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 16 Jul 2019 08:41:21 +0000 (08:41 +0000)
commit10b04d1e0b3f4435a8f2e806fddf12ff8b864623
tree32e7d52153214e096034ab2c775e6956a2e86aa8
parent737eb76789cd454918a85983255a1f62efcbfdc9
Report ambiguous uses of .md attributes

This patch reports an error if the .md file has an unscoped
attribute that maps to more than one possible value.

2019-07-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* read-md.h (md_reader::record_potential_iterator_use): Add a
file_location parameter.
* read-rtl.c (attribute_use::loc): New field.
(map_attr_string): Take a file_location parameter.  Report cases
in which attributes map to multiple distinct values.
(apply_attribute_uses): Update call accordingly.
(md_reader::handle_overloaded_name): Likewise.
(md_reader::apply_iterator_to_string): Likewise.  Skip empty
nonnull strings.
(record_attribute_use): Take a file_location parameter.
Initialize attribute_use::loc.
(md_reader::record_potential_iterator_use): Take a file_location
parameter.  Update call to record_attribute_use.
(rtx_reader::rtx_alloc_for_name): Update call accordingly.
(rtx_reader::read_rtx_code): Likewise.
(rtx_reader::read_rtx_operand): Likewise.  Record a location
for implicitly-expanded empty strings.

From-SVN: r273511
gcc/ChangeLog
gcc/read-md.h
gcc/read-rtl.c