Improve error reporting from genattrtab.c
commitc122b93bd9ebe5bd5232efa503221b77aa5bd525
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Dec 2015 09:31:02 +0000 (1 09:31 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Dec 2015 09:31:02 +0000 (1 09:31 +0000)
tree3ebb050975be4f6dc3a15b36bc3ffa2aaf960f09
parentd174bb0e93da083e201e8f6d58193fd8b7ba43ae
Improve error reporting from genattrtab.c

The errors reported by check_attr_value weren't very helpful because
they always used the location of the define(_enum)_attr, even if the
error was in a define_insn.  Also, the errors reported by
check_attr_test didn't say which attribute was faulty.

Although not technically a bug fix, it was really useful in writing
the patch for PR68432.

Tested on a variety of targets.

gcc/
* genattrtab.c (check_attr_test): Take an attr_desc instead of
an is_const flag.  Put the file_location argument first.
Update recursive calls.  Improve error messages.
(check_attr_value): Take a file location and use it instead
of attr->loc.  Improve error messages.  Update calls to
check_attr_test.
(check_defs): Update call to check_attr_value.
(make_canonical): Likewise.
(gen_attr): Likewise.
(main): Likewise.
(gen_insn_reserv): Update call to check_attr_test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231103 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/genattrtab.c