Commit cd301a3
committed
[AArch64][MC] Improve
With the change in #126653, it became clear that there was an implicit
coercion from DiagnosticPredicate bool in `isSimm`, which is then undone
in the TableGen'd code that uses the predicate, converting from a bool
back to a DiagnosticPredicate.
This roundtrip conversion loses information - if `isSImmScaled` returns
`DiagnosticPredicate::NoMatch` then it is converted to
`DiagnosticPredicate::NearMatch`, which both will cause an error, but
have different behaviour for which diagnostic is used.
This change removes the boolean conversions and directly returns the
DiagnosticPredicate. This causes some changes to error messages, most of
which are that when a register provided but a specific immediate was
expected, now the error is "invalid operand for instruction" and not an
indication that the immediate was out of range.
The only change not like this is to LDR (Register), which seems to just
choose a different immediate-related diagnostic when a 64-bit register
is used - which was equally inaccurate as the previous error. This is
because there are many other places in the parser that do not (yet?) use
DiagnosticPredicate, in this case the issue seems to be
`isUImm12Offset`, which still returns a `bool`.isSImm Diagnostic Fidelity1 parent 4b3c644 commit cd301a3
File tree
9 files changed
+11
-11
lines changed- llvm
- lib/Target/AArch64/AsmParser
- test/MC/AArch64
- SME
- SVE
9 files changed
+11
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
818 | | - | |
| 817 | + | |
| 818 | + | |
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments