119 Commits
Author SHA1 Message Date
ds5678 b0d6fa2276 Add support for array initialization based on RuntimeHelpers.CreateSpan<T> 2025-02-22 11:12:49 +01:00
Siegfried Pammer 2ca5b5affe Rewrite AssignVariableNames algorithm to use variable usages instead of the list of variables. 2024-07-27 13:35:20 +02:00
Siegfried Pammer 28aa88bfb8 Make NullableLiftingTransform handle the case where ExpressionTransforms.VisitComp already lifted a nullable comparison with constant. 2024-07-20 11:58:00 +02:00
Siegfried Pammer 9d22e3ab41 NullableLiftingTransform: Undo new compiler optimization (omitting get_HasValue for comparisions with constants) 2024-07-20 10:40:31 +02:00
Siegfried Pammer 9ba47db69b Add new a.GetValueOrDefault(b) -> a ?? b transform for side-effect-free default values. 2024-03-29 21:14:18 +01:00
Siegfried Pammer e193b838da Move TransformDecimalCtorToConstant to EarlyExpressionTransforms 2023-08-05 15:33:55 +02:00
Siegfried Pammer 688474facd Add missing DecompilerSettings for new language features 2023-08-05 14:33:47 +02:00
Daniel Grunwald f568123704 Add support for UTF8 string literals 2023-05-30 11:20:20 +02:00
ElektroKill 01fd6e97f3 Fixed overflow exception and added tests 2023-04-07 12:20:07 +02:00
ElektroKill bf0fe3aa15 Consider constructor type when lifting decimal constants 2023-04-06 22:00:10 +02:00
Daniel Grunwald d3919aa99a Support native ints in "Combine bit.and into shift" transform 2022-11-10 21:16:14 +01:00
Siegfried Pammer dbbcbb87fe Make pattern matching transform a simple ILTransform for both reference and value types. Check that the true branch dominates all uses of the pattern variable. 2021-09-05 18:46:03 +02:00
Siegfried Pammer cd0c76d7b1 Support leave instructions in RemoveInfeasiblePathTransform and transform match(x) ? true : false to match(x). 2021-07-25 15:52:37 +02:00
Siegfried Pammer 76227af89d Fix #1749, fix #2339, fix #2353: Add support for rethrow in async exception handlers, fix await catch/finally patterns for complex methods. 2021-04-07 13:12:49 +02:00
Daniel Grunwald 80cf72e498 #2182: Move "Transform call to struct constructor" from EarlyExpressionTransforms to ILReader.
This fixes the evaluation order for such calls (and an assertion in StObj.CheckTargetSlot).
2020-10-07 23:59:22 +02:00
dotnet format 0d9f871a4f #2128: Reformat the whole code base. 2020-08-28 01:05:38 +02:00
Siegfried Pammer 7ed4a736f3 Fix #2103: Support for Stackalloc initializers not working for byte 2020-08-22 23:00:48 +02:00
Daniel Grunwald abb9d49a0f Add support for C# 8 switch expressions. 2020-08-02 11:57:33 +02:00
Siegfried Pammer 2e5a597300 Merge branch 'master' into ranges 2020-05-01 18:55:32 +02:00
Siegfried Pammer 9c8df1d949 Fix assignment of ILRanges in ExpressionTransforms.TransformCatchVariable 2020-04-29 21:14:09 +02:00
Daniel Grunwald dc6e094a30 Add support for indexing arrays using System.Index 2020-04-19 08:26:18 +02:00
Siegfried Pammer 4db41f69db Fix #1919: Use unmapped IL offsets at the start of a catch-block for the 'exception specifier' sequence point. 2020-04-08 12:13:21 +02:00
Siegfried Pammer ba5c645257 Add TryCatchHandler annotation to CatchClause 2020-04-08 09:56:27 +02:00
SilverFox 5914d5b96b Fix #1854 2019-12-09 18:26:03 +08:00
Daniel Grunwald 93806b46fa Fix compound assignments with type bool.
This required removing the "Replace bit.and with logic.and" transform, as it interfered with the compound assignment transform.
2019-11-30 23:19:18 +01:00
Daniel Grunwald a1c211f326 Fix #1794: Avoid extra cast to double for ulong -> float conversion 2019-11-08 23:16:51 +01:00
Daniel Grunwald f1021cb300 Fix #1643: Handle unbox.any in TransformCatchVariable. 2019-08-17 23:54:49 +02:00
Siegfried Pammer 03151bf37b Remove redundant code in ExpressionTransforms.VisitBlockContainer 2019-08-17 23:11:07 +02:00
Siegfried Pammer 9c06d5c924 Fix #1642: Allow StackTypes I, I4, I8 and Unknown as switch value, convert Unknown and I to I8. 2019-08-17 20:05:08 +02:00
Siegfried Pammer 7502e521c1 Improve documentation of ExpressionTransforms.TransformCatchVariable 2019-08-15 12:10:59 +02:00
Siegfried Pammer 72c3e828f3 Check IsPure before Match. 2019-08-05 22:11:09 +02:00
Siegfried Pammer c477ccf68e Add SemanticHelper.IsPure check as per code-review. 2019-08-05 22:01:13 +02:00
Siegfried Pammer ec18094c65 Implement transformation of delegate construction with ldvirtftn. 2019-08-03 21:49:01 +02:00
Daniel Grunwald 752f0de978 Further adjustments to transforms now that copy propagation no longer runs. 2019-07-27 22:17:15 +02:00
Siegfried Pammer adc443e4e2 Fix dynamic compound assignments 2019-07-27 19:23:46 +02:00
Daniel Grunwald 539e3a906d Fix #1552: user-defined and decimal increments
For user-defined increments, there were problems with Roslyn was optimizing out one of the stores.
The new transform FixRemainingIncrements now takes increments/decrements that were not detected by TransformAssignment and introduces a temporary variable that can be incremented.
This sometimes requires un-inlining via the new ILInstruction.Extract() operation.
Extract() is not supported in all possible contexts, so it is possible but unlikely that some op_Increment calls remain.

For decimals, the situation is different: legacy csc actually was optimizing "d + 1m" to "op_Increment(d)", so we can get rid of any left-over increments by undoing this optimization. This now happens in ReplaceMethodCallsWithOperators.
2019-07-24 17:55:28 +02:00
Siegfried Pammer 19a7898786 Add addressof(ldloc) => ldloca transform to EarlyExpressionTransforms 2019-07-15 23:34:23 +02:00
Siegfried Pammer 8af609e7df Merge branch 'master' of https://github.com/icsharpcode/ILSpy into local-functions 2019-07-15 11:49:23 +02:00
Siegfried Pammer 119c679fad Add addressof(ldloc V) => ldloca V transform for read access on value types. 2019-07-13 20:32:00 +02:00
Daniel Grunwald 3314f3f37a Fix #1571: Expression transforms not running for values of inline assignments. 2019-07-13 19:13:40 +02:00
Siegfried Pammer 6a1229028c Only try to inline stackalloc Span<T> if the next statement is a plain assignment. 2019-07-07 07:48:58 +02:00
Siegfried Pammer 9590cfbf59 Update tests to latest Roslyn implementation. 2019-07-06 22:57:30 +02:00
Daniel Grunwald 961923f4fd #1499, #1240: Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics 2019-04-28 20:22:48 +02:00
Siegfried Pammer d42cf99a8c Fix dynamic transforms because https://github.com/dotnet/roslyn/issues/27800 was fixed. 2019-02-26 00:50:46 +01:00
Siegfried Pammer 94cd891609 Add support for ReadOnlySpan<T> initialization pattern. 2019-02-23 23:01:35 +01:00
Siegfried Pammer c1fca21e8a Make ILRange field private - introduce public API for IL range manipulation. 2019-02-16 20:36:17 +01:00
Daniel Grunwald 47ca51a769 Clarify the meaning of ILVariable.Index 2019-02-15 11:42:16 +01:00
Siegfried Pammer 112719efaf Extend safety-checks in TransformSpanTCtorContainingStackAlloc. 2018-12-08 23:08:14 +01:00
Siegfried Pammer 0dac55d584 Add transformation for stackalloc to Span<T>. 2018-12-08 22:31:17 +01:00
Daniel Grunwald ef866040b4 Update to SRM 1.6.0 and Roslyn 2.9. Adjust decompiler to new code pattern used for lifted nullable comparisons. 2018-10-14 20:46:29 +02:00