Commit 0815445
[_fe_analyzer_shared] Use TypeAnalyzerOptions to configure flow analysis.
Previously, flow analysis was configured by passing a set of named
booleans to its constructor, each to enable or disable a separate
language feature.
This change merges the flow analysis configuration with the
`TypeAnalyzerOptions` class (which was already being used for
configuring the shared `TypeAnalyzer` class). This should make it
easier to add language features to the shared code base in the future,
since there will be one common place where all features will be
configured.
To avoid duplicating the logic that creates `TypeAnalyzerOptions`,
I've had to do a bit of minor surgery to the clients:
- In the test harness in `_fe_analyzer_shared`, there is a common
method (`Harness.computeTypeAnalyzerOptions`) that constructs
`TypeAnalyzerOptions` based on the harness configuration. It is
called from a few different tests.
- In `pkg/analyzer`, there is a common method
(`computeTypeAnalyzerOptions`) that constructs `TypeAnalyzerOptions`
based on a `FeatureSet`. It is used by
`LibraryAnalyzer.analyzeForCompletion`,
`LibraryAnalyzer._resolveFile`, and the late variable
`AstResolver._typeAnalyzerOptions`.
- In `pkg/front_end`, I've moved computation of `TypeAnalyzerOptions`
from the `InferenceVisitorImpl` constructor to the
`TypeInferrerImpl` constructor; the options are then passed to the
`InferenceVisitorImpl` by `_createInferenceVisitor`.
I'm doing this work now as preparation for adding support for sound
flow analysis (#60438), so that
I can add the logic to enable it in a clean way.
Bug: #60438
Change-Id: Ib845194adb404b4c0a3feeff17a14ae641d515eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419940
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Paul Berry <[email protected]>1 parent 437bf92 commit 0815445
File tree
11 files changed
+139
-137
lines changed- pkg
- analyzer/lib/src
- dart
- analysis
- resolver
- generated
- summary2
- front_end/lib/src/type_inference
11 files changed
+139
-137
lines changedLines changed: 24 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 199 | + | |
201 | 200 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 201 | + | |
| 202 | + | |
210 | 203 | | |
211 | 204 | | |
212 | 205 | | |
| |||
1204 | 1197 | | |
1205 | 1198 | | |
1206 | 1199 | | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1200 | + | |
1210 | 1201 | | |
1211 | 1202 | | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
| 1203 | + | |
| 1204 | + | |
1219 | 1205 | | |
1220 | 1206 | | |
1221 | 1207 | | |
| |||
4304 | 4290 | | |
4305 | 4291 | | |
4306 | 4292 | | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
4307 | 4296 | | |
4308 | 4297 | | |
4309 | 4298 | | |
| |||
4387 | 4376 | | |
4388 | 4377 | | |
4389 | 4378 | | |
4390 | | - | |
4391 | | - | |
4392 | | - | |
4393 | | - | |
4394 | | - | |
4395 | | - | |
4396 | | - | |
4397 | | - | |
4398 | | - | |
4399 | | - | |
4400 | | - | |
4401 | 4379 | | |
4402 | 4380 | | |
4403 | 4381 | | |
| |||
4417 | 4395 | | |
4418 | 4396 | | |
4419 | 4397 | | |
4420 | | - | |
4421 | | - | |
4422 | | - | |
4423 | | - | |
4424 | | - | |
4425 | | - | |
4426 | | - | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
4427 | 4401 | | |
4428 | 4402 | | |
4429 | 4403 | | |
| |||
4994 | 4968 | | |
4995 | 4969 | | |
4996 | 4970 | | |
4997 | | - | |
| 4971 | + | |
4998 | 4972 | | |
4999 | 4973 | | |
5000 | 4974 | | |
| |||
5899 | 5873 | | |
5900 | 5874 | | |
5901 | 5875 | | |
5902 | | - | |
| 5876 | + | |
| 5877 | + | |
5903 | 5878 | | |
5904 | 5879 | | |
5905 | 5880 | | |
5906 | 5881 | | |
5907 | | - | |
| 5882 | + | |
| 5883 | + | |
5908 | 5884 | | |
5909 | 5885 | | |
5910 | 5886 | | |
| |||
6032 | 6008 | | |
6033 | 6009 | | |
6034 | 6010 | | |
6035 | | - | |
| 6011 | + | |
6036 | 6012 | | |
6037 | 6013 | | |
6038 | 6014 | | |
| |||
6063 | 6039 | | |
6064 | 6040 | | |
6065 | 6041 | | |
6066 | | - | |
| 6042 | + | |
| 6043 | + | |
6067 | 6044 | | |
6068 | 6045 | | |
6069 | 6046 | | |
| |||
6285 | 6262 | | |
6286 | 6263 | | |
6287 | 6264 | | |
6288 | | - | |
| 6265 | + | |
| 6266 | + | |
| 6267 | + | |
6289 | 6268 | | |
6290 | 6269 | | |
6291 | 6270 | | |
| |||
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| |||
1848 | 1848 | | |
1849 | 1849 | | |
1850 | 1850 | | |
1851 | | - | |
| 1851 | + | |
1852 | 1852 | | |
1853 | 1853 | | |
1854 | 1854 | | |
| |||
1975 | 1975 | | |
1976 | 1976 | | |
1977 | 1977 | | |
1978 | | - | |
| 1978 | + | |
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
| |||
1990 | 1990 | | |
1991 | 1991 | | |
1992 | 1992 | | |
1993 | | - | |
| 1993 | + | |
1994 | 1994 | | |
1995 | 1995 | | |
1996 | 1996 | | |
| |||
2733 | 2733 | | |
2734 | 2734 | | |
2735 | 2735 | | |
2736 | | - | |
2737 | | - | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
2738 | 2754 | | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
641 | | - | |
642 | | - | |
| 640 | + | |
643 | 641 | | |
644 | 642 | | |
645 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1611 | 1611 | | |
1612 | 1612 | | |
1613 | 1613 | | |
1614 | | - | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
| 1614 | + | |
| 1615 | + | |
1619 | 1616 | | |
1620 | 1617 | | |
1621 | 1618 | | |
| |||
1704 | 1701 | | |
1705 | 1702 | | |
1706 | 1703 | | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
1707 | 1713 | | |
1708 | 1714 | | |
1709 | 1715 | | |
| |||
1798 | 1804 | | |
1799 | 1805 | | |
1800 | 1806 | | |
1801 | | - | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
| 1807 | + | |
| 1808 | + | |
1808 | 1809 | | |
1809 | 1810 | | |
1810 | 1811 | | |
| |||
5413 | 5414 | | |
5414 | 5415 | | |
5415 | 5416 | | |
5416 | | - | |
| 5417 | + | |
5417 | 5418 | | |
5418 | 5419 | | |
5419 | 5420 | | |
| |||
5425 | 5426 | | |
5426 | 5427 | | |
5427 | 5428 | | |
5428 | | - | |
| 5429 | + | |
5429 | 5430 | | |
5430 | 5431 | | |
5431 | 5432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
| 201 | + | |
199 | 202 | | |
200 | | - | |
201 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| |||
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
| |||
864 | 869 | | |
865 | 870 | | |
866 | 871 | | |
| 872 | + | |
867 | 873 | | |
868 | | - | |
869 | | - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
870 | 877 | | |
871 | 878 | | |
872 | 879 | | |
| |||
881 | 888 | | |
882 | 889 | | |
883 | 890 | | |
| 891 | + | |
884 | 892 | | |
885 | 893 | | |
886 | 894 | | |
| |||
0 commit comments