Commit 0181af2
authored
[MLIR] Imporve location tracking for
This commit improves line location tracking in case of error reporting
to the user in `parseElementsLiteralType`. There are two cases: the type
is already parsed [1] or not yet parsed [2]. With these changes we print
the error at the attribute's location in both cases to ensure
consistency.
Case 1)
```mlir
memref<i32> = dense<[3]>
^
```
Case 2)
```mlir
dense<[3]> : memref<i32>
^
```
Note that today for a simple:
```mlir
func.func @main() {
%0 = arith.constant dense<[3]> : i32
return
}
```
we print the error after the constant:
```
./bin/c.mlir:3:3: error: elements literal must be a shaped type
return
^
```parseElementsLiteralType (llvm#127992)1 parent ad0c7da commit 0181af2
File tree
3 files changed
+46
-13
lines changed- mlir
- lib/AsmParser
- test/IR
3 files changed
+46
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
| 954 | + | |
959 | 955 | | |
960 | 956 | | |
961 | | - | |
| 957 | + | |
962 | 958 | | |
963 | 959 | | |
964 | 960 | | |
| |||
999 | 995 | | |
1000 | 996 | | |
1001 | 997 | | |
1002 | | - | |
| 998 | + | |
1003 | 999 | | |
1004 | 1000 | | |
1005 | 1001 | | |
| |||
1010 | 1006 | | |
1011 | 1007 | | |
1012 | 1008 | | |
1013 | | - | |
| 1009 | + | |
1014 | 1010 | | |
1015 | 1011 | | |
1016 | 1012 | | |
1017 | | - | |
1018 | | - | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
1019 | 1017 | | |
1020 | 1018 | | |
1021 | 1019 | | |
| |||
1032 | 1030 | | |
1033 | 1031 | | |
1034 | 1032 | | |
1035 | | - | |
| 1033 | + | |
1036 | 1034 | | |
1037 | 1035 | | |
1038 | 1036 | | |
| |||
1065 | 1063 | | |
1066 | 1064 | | |
1067 | 1065 | | |
1068 | | - | |
| 1066 | + | |
1069 | 1067 | | |
1070 | 1068 | | |
1071 | 1069 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
0 commit comments