- 14 7月, 2017 3 次提交
- 11 7月, 2017 2 次提交
-
-
由 vsadov 提交于
-
由 vsadov 提交于
Retaining temporary IL slots allocated for passing rvalues as lvalues for the duration of the whole encompassing expression. Passing rvalues to "in" parameters require allocation of temporary IL slots. ```C# var result M1(42).ToString(); // where M is declared as ref readonly int M1(in int x) {...} // needs to be emitted as: int temp = 42; var result M1(ref temp) .ToString(); // passed by reference ``` This pattern bring an issue of the lifetime of such temporaries. Note that `M1` can return its argument back by reference, so the variable must exist as long as the return variable exists. - longer then the call to M1 itself. The situation where we would have to pass an rvalue by reference via a copy was possible before, but it was very rare, so the solution was to just "leak" the temp. I.E - do not release such temps back to the temp pool. This is not a good solution when the situation becomes more common. In this change we introduce a mechanism that collects temps of this kind and keeps them as for the duration of the most encompassing expression. We will use the same mechanism for the preexisting cases as well. Why "encompassing expression" is a sufficient extent for the temps. Consider the following concerns - 1) It is not possible to store a result of a `ref readonly` call, so the temp does not need to be retained at block level. - we do not allow `ref readonly` locals in source. 2) Internally compiler can create long-lived `ref readonly` temps for the purpose of returning from exception regions. This is not causing a concern since rvalues are not returnable and can never be stored insuch refs. 3) We sometimes call struct methods on a temp, there is no concern with the life time of such temps since struct `this` it cannot be ref-returned. 4) Sometimes short-term ref temps become mapped to long-term temps as a result of async spilling. We do not need to handle that specially here since those already have appropriate life times when extracted into block variables in lowering.
-
- 20 6月, 2017 2 次提交
-
-
由 Julien Couvreur 提交于
-
由 Andy Gocke 提交于
-
- 17 6月, 2017 1 次提交
-
-
由 Julien Couvreur 提交于
-
- 16 6月, 2017 1 次提交
-
-
由 Andy Gocke 提交于
By design, when data flow analyzes local functions it does so devoid of surrounding context and records possibly unassigned variables rather than reporting a diagnostic. Thus, all captured variables are expected to be marked unassigned during data flow analysis without reporting a diagnostic. However, reporting a diagnostic is not the only side effect of running data flow analysis. By calling virtual methods data flow analysis informs derived types of unassigned variables. While the diagnostic is suppressed and recorded, currently the virtual method is still called. This has negative consequences for region analysis, which considers these calls as indications of variables flowing out of the given region, which may not be the case for local functions. This PR changes data flow analysis to only call the ReportUnassigned virtual method if not inside a local function, excluding local functions from all unassignment reporting. Fixes #17165, #18347
-
- 09 6月, 2017 2 次提交
-
-
由 vsadov 提交于
In a scenario where the target variable is passed to the constructor by reference, the constructor would be able to observe its own actions indirectly before the construction is "done". The in-place optimization should not be observable. Fixes:#16364
- 08 6月, 2017 1 次提交
-
-
由 Julien Couvreur 提交于
-
- 07 6月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 06 6月, 2017 1 次提交
-
-
由 Neal Gafter 提交于
* Fix code gen for pattern switch with constant expression Fixes #19731 * Add instrumentation for pattern switch with constant expression Fixes #17090 * Incorrect code for generic pattern switch on a constant expression Fixes #19734
-
- 01 6月, 2017 2 次提交
-
-
-
由 Julien Couvreur 提交于
Failed tuple assignment gets a NoConversion node, and semantic model should handle BoundTupleLiteral (#19679)
-
- 31 5月, 2017 5 次提交
-
-
由 vsadov 提交于
-
由 Stefan Nikolei 提交于
Merging on behalf of @reaction1989 Thanks for the contribution
-
由 Ty Overby 提交于
-
由 Ty Overby 提交于
-
- 27 5月, 2017 2 次提交
- 26 5月, 2017 2 次提交
- 25 5月, 2017 3 次提交
-
-
由 vsadov 提交于
-
由 Julien Couvreur 提交于
-
由 Julien Couvreur 提交于
Ignore tuple name and dynamicness differences in computing constant value for as operator on nullable tuple (#19697)
-
- 24 5月, 2017 1 次提交
-
-
由 vsadov 提交于
-
- 23 5月, 2017 4 次提交
-
-
由 vsadov 提交于
-
由 Neal Gafter 提交于
Relates to #19038, #16195
-
由 vsadov 提交于
-
由 Ty Overby 提交于
-
- 22 5月, 2017 1 次提交
-
- 20 5月, 2017 2 次提交
-
-
由 Neal Gafter 提交于
* Fixes crash in `is` operator used with tuples Fixes #19310 * Matching an expression of type `byte?` with a pattern of type `int` should not be allowed * Add documentation for the breaking change matching `int?` against the pattern `long x` Fixes #19151 * Unify subsumption implementations Fixes #19273 * Greatly improved code gen for value type pattern match Fixes #16129 Fixes #18944 Fixes #14252 * Add test confirming that #19122 is fixed. Fixes #19122
-
由 Alireza Habibi 提交于
Fix for deconstruction-assignment to write-only property.
-
- 19 5月, 2017 4 次提交
-
-
由 Tomas Matousek 提交于
-
由 Charles Stoner 提交于
-
由 Charles Stoner 提交于
Include overflow checks in tuple conversions
-
由 Omar Tawfik 提交于
* Call this.DeclaringCompilation.EnsureReadOnlyAttributeExists() when needed * Promote EmbeddedAttribute to be used by both compilers * Generate Embedded attributes on PE Module Builder * Thread PEModuleBuilder through Symbol.AddSynthesizedAttributes() * Fix failing tests * Base case passing * Refactor ReadOnlyAttribute to IsReadOnlyAttribute * Fix build break * More Tests * Clean up * PR Comments #1 PR Comments #3 PR Comments #4 PR Comments #5 PR Comments #6 PR Comments # 7 * Handle NoPIA Added more tests * Lambdas and Local functions no longer generate attributes in symbols Added tests for constructors and operators Signal need for synthesized attributes in local rewriter for lambdas an local functions Clean up * Clean up * More PR Feedback * Adding more tests * More PR Comments * More tests for explicit interface implementations * Latest PR Comments * Moved EnsureIsReadOnlyAttributeExists to AfterAddingTypeMembersChecks * Fix failing tests
-