Siegfried Pammer
04505bbdf2
Highlight and scroll to the changed instruction in the ILAst view
...
The C# debug-steps view highlights and centers the exact AST node a
transform changed; the ILAst view already had the step tree and
replay-at-step but produced no highlight. Bring it to parity.
IL rendering has no token-writer seam like the C# output visitor, so
per-instruction text spans are recorded by bracketing
ILInstruction.WriteTo via a new INodeTrackingOutput. The dominant
inst.ReplaceWith(newInst) transform pattern detaches the instruction
passed to Step, so ILTransformContext gains EndStep to record the
produced instruction; Stepper additionally records the position's
ancestor chain as fallback candidates before the step-limit throw, so
the "show state before" view -- which halts at the selected step --
still resolves to a surviving ancestor (ultimately the ILFunction).
The highlight-range resolver is shared with the C# language.
Assisted-by: Claude:claude-opus-4-8:Claude Code
6 days ago
Siegfried Pammer
9f77f8a919
Prevent inlining of call arguments when doing so would change order of evaluation with regards to the implicit ldobj performed by a constrained.callvirt.
1 year ago
Siegfried Pammer
5b90dbdabf
Fix #3385 : Allow address uses of structs in using transform, if the reference is passed to an in parameter.
1 year ago
Siegfried Pammer
427fbcd8c0
Fix general using statement pattern
2 years ago
Siegfried Pammer
a5ed5ec5cb
Support types that provide DisposeAsync without implementing IAsyncDisposable.
2 years ago
Siegfried Pammer
0a2037ae1f
#3075 : Avoid processing already-transformed blocks by introducing BlockTransformContext.IndexOfFirstAlreadyTransformedInstruction, which allows us to track already transformed instructions after a block has been merged into another by ConditionDetection.
3 years ago
Daniel Grunwald
f568123704
Add support for UTF8 string literals
3 years ago
Daniel Grunwald
b823955ad6
Fix mcs-5 foreach/using pattern when C# 7 (pattern matching) is not enabled.
3 years ago
ElektroKill
c8fd044706
Fix `UsingTranform` for inlined `isinst` variation (refs #2199 )
4 years ago
Daniel Grunwald
08ceffc3ad
Upgrade dotnet-format from version 5 to the version included with the .NET (6) SDK.
4 years ago
Siegfried Pammer
96db0a5472
Add support for pattern matching in UsingTransform.
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Siegfried Pammer
562699fc94
Add support for C# 8.0 await foreach
6 years ago
Siegfried Pammer
dab70964a5
Add support for C# 8.0 disposable ref structs
6 years ago
Daniel Grunwald
2acc4339df
#2058 : Mark most transforms as public to help users that use the ILAst directly without decompiling to C#.
6 years ago
Siegfried Pammer
c7f98a4db7
Add support for await using statements.
7 years ago
Daniel Grunwald
57b725df79
Fix #1655 : Incorrect pointer cast when calling method on integer constant
7 years ago
Daniel Grunwald
856cedc95e
#1456 : add test case; add additional checks to ensure we only transform normal locals into using/foreach-locals
7 years ago
Daniel Grunwald
beed6b5e24
Remove MarkGeneratedVariables() step in AsyncAwaitDecompiler.
...
This was left-over from earlier versions; but ILSpy stopped caring so much about variable vs. stack slot since Roslyn started to optimize more aggressively.
The change of variable type caused problems for debug information and could even cause an assertion.
Closes #1456 , closes #1562 .
7 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Siegfried Pammer
dd2a2af31d
Extend UsingTransform.CheckResourceType to support non-generic System.Collections.IDictionaryEnumerator.
8 years ago
Siegfried Pammer
2ac532b470
Fix MatchDisposeCheck
8 years ago
Siegfried Pammer
4b7c82957a
Fix UsingTransform
8 years ago
Siegfried Pammer
3b31930b85
Fix #1071 : Sometimes uses Enumarator instead of Foreach
8 years ago
Daniel Grunwald
aa9f2e7797
Fix interaction of using-transform with ?. operator.
8 years ago
Daniel Grunwald
228419b4f0
Fix interaction of ?. with using-transform.
9 years ago
Siegfried Pammer
2169d44c81
Implement sequence points for using statement.
9 years ago
Daniel Grunwald
6272c21ece
Simplify SwitchOnNullableTransform.
9 years ago
Siegfried Pammer
eaf6163215
UsingTransform: Simplify check for other Store-Instructions
9 years ago
Siegfried Pammer
23bca3713f
Fix #646 : VB-compilers 'For Each In' is not recognized as foreach during decompilation
9 years ago
Siegfried Pammer
a62e13a035
Improve detection of foreach-using in UsingTransform:
...
The C# compiler only expects:
- EnumeratorType GetEnumerator(); on the type of the in-expression.
- EnumeratorType must implement the following members:
* bool MoveNext();
* T Current { get; }
9 years ago
Siegfried Pammer
9bdfdd09ff
Add special case for non-generic foreach and add more tests.
9 years ago
Siegfried Pammer
48f344ed03
Add another pattern for generics/nullable using.
9 years ago
Siegfried Pammer
2c40b45717
Add support for using on nullables.
9 years ago
Siegfried Pammer
98e4e3418d
[using] check variable type and variable usage more strictly.
9 years ago
Siegfried Pammer
e2dab8699f
Fix generic using patterns.
9 years ago
Siegfried Pammer
d1a514b451
Redesign of UsingInstruction.
9 years ago
Siegfried Pammer
dfeb39f6ee
TransformForeach: handle optional return statement after loop.
9 years ago
Siegfried Pammer
44687a01e2
Fix bug in UsingTransform: Do not transform to using, if disposable instance is used after the finally block.
9 years ago
Siegfried Pammer
86d3101b22
Add UnwrapNestedContainerIfPossible to reduce block container nesting in foreach pattern.
9 years ago
Siegfried Pammer
d067f0cb6c
Add support for pattern with as-cast to IDisposable.
9 years ago
Siegfried Pammer
31469c8ef1
Implement UsingTransform in ILAst.
9 years ago