Commit 97ea0ab
authored
[TableGen] Do not exit in template argument check (#121636)
The signature of `CheckTemplateArgValues` implements error handling via
the `bool` return type, yet always returned false. The single possible
error case instead used `PrintFatalError,` which exits the program
afterward.
This behavior is undesirable: It prevents any further errors from being
printed and makes TableGen less usable as a library as it crashes the
entire process (e.g. `tblgen-lsp-server`).
This PR therefore fixes the issue by using `Error` instead and returning
true if an error occurred. All callers already perform proper error
handling.
As `llvm-tblgen` exits on error, a test was also added to the LSP to
ensure it exits normally despite the error.1 parent ce831a2 commit 97ea0ab
File tree
4 files changed
+56
-21
lines changed- llvm
- lib/TableGen
- test/TableGen
- mlir/test/tblgen-lsp-server
4 files changed
+56
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
779 | | - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
780 | 782 | | |
781 | 783 | | |
782 | 784 | | |
783 | 785 | | |
784 | | - | |
785 | | - | |
| 786 | + | |
786 | 787 | | |
787 | 788 | | |
788 | 789 | | |
| |||
812 | 813 | | |
813 | 814 | | |
814 | 815 | | |
815 | | - | |
| 816 | + | |
| 817 | + | |
816 | 818 | | |
817 | 819 | | |
818 | 820 | | |
| |||
2722 | 2724 | | |
2723 | 2725 | | |
2724 | 2726 | | |
| 2727 | + | |
2725 | 2728 | | |
2726 | | - | |
| 2729 | + | |
2727 | 2730 | | |
2728 | 2731 | | |
2729 | | - | |
| 2732 | + | |
2730 | 2733 | | |
2731 | 2734 | | |
2732 | 2735 | | |
| |||
3201 | 3204 | | |
3202 | 3205 | | |
3203 | 3206 | | |
3204 | | - | |
3205 | | - | |
| 3207 | + | |
| 3208 | + | |
3206 | 3209 | | |
3207 | 3210 | | |
3208 | 3211 | | |
| |||
3217 | 3220 | | |
3218 | 3221 | | |
3219 | 3222 | | |
3220 | | - | |
| 3223 | + | |
3221 | 3224 | | |
3222 | 3225 | | |
3223 | 3226 | | |
| |||
4417 | 4420 | | |
4418 | 4421 | | |
4419 | 4422 | | |
4420 | | - | |
| 4423 | + | |
4421 | 4424 | | |
| 4425 | + | |
| 4426 | + | |
| 4427 | + | |
4422 | 4428 | | |
4423 | 4429 | | |
4424 | | - | |
| 4430 | + | |
| 4431 | + | |
4425 | 4432 | | |
4426 | 4433 | | |
4427 | 4434 | | |
| |||
4439 | 4446 | | |
4440 | 4447 | | |
4441 | 4448 | | |
4442 | | - | |
4443 | | - | |
4444 | | - | |
4445 | | - | |
4446 | | - | |
| 4449 | + | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
| 4453 | + | |
4447 | 4454 | | |
4448 | 4455 | | |
4449 | 4456 | | |
4450 | 4457 | | |
4451 | | - | |
| 4458 | + | |
4452 | 4459 | | |
4453 | 4460 | | |
4454 | 4461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| |||
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
324 | | - | |
| 325 | + | |
| 326 | + | |
325 | 327 | | |
326 | 328 | | |
327 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | | - | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments