[GAS/ARM] Clarify relation between reg_expected_msgs and arm_reg_type
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Wed, 22 Nov 2017 14:02:49 +0000 (14:02 +0000)
committerThomas Preud'homme <thomas.preudhomme@arm.com>
Wed, 22 Nov 2017 14:02:49 +0000 (14:02 +0000)
commit5aa75429d0531ac6cfe59efd80f1ab01311865b3
tree782ce01aab43dad3a32daad856d5acd413e85998
parent2400729ecfd2c7be8b18aeaa822fef5a4b503f8a
[GAS/ARM] Clarify relation between reg_expected_msgs and arm_reg_type

Uses of reg_expected_msgs rely on each arm_reg_type enumerator to have a
message entry in the same order as the enumerator declaration. This is
not clearly stated in the definition of both the arm_reg_type enum and
the reg_expected_msgs. Worse, there is nothing to ensure both are kept
in sync.

As an attempt towards this, this patch uses C99 array designators to
ensure that each message is associated with the right arm_reg_type. A
comment is also added near the definition of arm_reg_type to point to
the reg_expected_msgs array. Finally, the array is synced with
arm_reg_type by adding the missing error message for REG_TYPE_RNB.

2017-11-22  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.c (arm_reg_type): Comment on the link with
reg_expected_msgs.
(reg_expected_msgs): Initialize using array designators with
arm_reg_type index.
gas/ChangeLog
gas/config/tc-arm.c
This page took 0.035587 seconds and 4 git commands to generate.