Commit f372b6e
authored
Add RuntimeAsyncMethodGenerationAttribute (#77543)
Adds control for whether to use runtime async. The flowchart is as follows:
1. The flag `System.Runtime.CompilerServices.RuntimeFeature.Async` must be present.
2. Assuming that flag is present, we look for the presence of `System.Runtime.CompilerServices.RuntimeAsyncMethodGenerationAttribute` on the method. If that attribute is present, we use the preference expressed in the attribute. The preference does not carry to nested contexts, such as local functions or lambdas.
3. If the attribute is not present, we look for `features:runtime-async=on` on the command line. If that is present, then the feature is on by default. Otherwise, the feature is off.1 parent c641c52 commit f372b6e
File tree
6 files changed
+484
-14
lines changed- src/Compilers
- CSharp
- Portable
- Compilation
- Symbols
- Attributes/WellKnownAttributeData
- Source
- Test/Emit/CodeGen
- Core/Portable/Symbols/Attributes
- Test/Utilities/CSharp
6 files changed
+484
-14
lines changedLines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | 319 | | |
321 | | - | |
322 | 320 | | |
323 | 321 | | |
324 | 322 | | |
| |||
327 | 325 | | |
328 | 326 | | |
329 | 327 | | |
330 | | - | |
331 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
152 | 168 | | |
153 | 169 | | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
654 | 662 | | |
655 | 663 | | |
656 | 664 | | |
| |||
661 | 669 | | |
662 | 670 | | |
663 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
664 | 675 | | |
665 | 676 | | |
666 | 677 | | |
| |||
0 commit comments