Commit 7ae56aa
committed
[sil] Add a new instruction ignored_use.
This is used for synthetic uses like _ = x that do not act as a true use but
instead only suppress unused variable warnings. This patch just adds the
instruction.
Eventually, we can use it to move the unused variable warning from Sema to SIL
slimmming the type checker down a little bit... but for now I am using it so
that other diagnostic passes can have a SIL instruction (with SIL location) so
that we can emit diagnostics on code like _ = x. Today we just do not emit
anything at all for that case so a diagnostic SIL pass would not see any
instruction that it could emit a diagnostic upon. In the next patch of this
series, I am going to add SILGen support to do that.1 parent bdfb609 commit 7ae56aa
File tree
20 files changed
+114
-3
lines changed- SwiftCompilerSources/Sources/SIL
- docs/SIL
- include/swift/SIL
- lib
- IRGen
- SILOptimizer
- Analysis
- UtilityPasses
- Utils
- SIL
- IR
- Parser
- Utils
- Serialization
- test/SIL
- Parser
- Serialization
20 files changed
+114
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
261 | 262 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5551 | 5551 | | |
5552 | 5552 | | |
5553 | 5553 | | |
| 5554 | + | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
| 5569 | + | |
| 5570 | + | |
| 5571 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3089 | 3089 | | |
3090 | 3090 | | |
3091 | 3091 | | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
3092 | 3101 | | |
3093 | 3102 | | |
3094 | 3103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3796 | 3796 | | |
3797 | 3797 | | |
3798 | 3798 | | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
3799 | 3807 | | |
3800 | 3808 | | |
3801 | 3809 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11725 | 11725 | | |
11726 | 11726 | | |
11727 | 11727 | | |
| 11728 | + | |
| 11729 | + | |
| 11730 | + | |
| 11731 | + | |
| 11732 | + | |
| 11733 | + | |
| 11734 | + | |
| 11735 | + | |
| 11736 | + | |
| 11737 | + | |
| 11738 | + | |
11728 | 11739 | | |
11729 | 11740 | | |
11730 | 11741 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
900 | 903 | | |
901 | 904 | | |
902 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1276 | 1279 | | |
1277 | 1280 | | |
1278 | 1281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2873 | 2873 | | |
2874 | 2874 | | |
2875 | 2875 | | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
2876 | 2880 | | |
2877 | 2881 | | |
2878 | 2882 | | |
| |||
0 commit comments