Siegfried Pammer
413c5b3baf
PortablePdbWriter: Add primitive support for state-machine hoisted local scopes. All variables are visible in the whole MoveNext method.
5 years ago
Shimon Magal
c06299b284
yield return moveNext
6 years ago
Daniel Grunwald
13ec574dbd
Fix YieldReturnDecompiler.
6 years ago
Daniel Grunwald
ef699c096b
Support parameters in IAsyncEnumerator methods
6 years ago
Daniel Grunwald
f8ee7c2bf3
Initial support for `async IAsyncEnumerator<T>` methods
6 years ago
Daniel Grunwald
8117dfff4a
Fix #1242 : Discard unreachable code.
...
Unreachable code is not part of the dominator tree, which most of our transforms are based on.
In particular, dominance-based loop detection runs into the problem where unreachable code might have jumps into two independent loops. In that case, it's impossible to place the unreachable code in a way that avoids assertions / generating invalid C#.
We establish the invariant that all blocks in a BlockContainer must be statically reachable from the entry point (-> every block is part of the dominator tree). This means transforms no longer have to deal with special cases for unreachable code.
The "Remove dead and side effect free code" option still has an effect on dead stores, but unreachable code is now always removed (previously this also was dependent on this option).
6 years ago
Siegfried Pammer
c51aea3601
Fix decompilation of yield return in local functions.
6 years ago
Daniel Grunwald
8cd8a90c22
Fix #1563 : `Unexpected return in MoveNext()` when mixed `using` and more than one `yield break`
...
Roslyn re-uses the same "this.Finally(); return v;" block for both "yield break;" instructions, so the yield break pattern needs to support multiple stores to the helper variable.
6 years ago
Daniel Grunwald
c56714c607
Fix assertion with async lambdas; fix async local functions.
6 years ago
Daniel Grunwald
ccdabf2325
Fix a bunch of XmlDoc compiler warnings.
6 years ago
Siegfried Pammer
bd77b8301f
Basic implementation of local functions.
6 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
6 years ago
Siegfried Pammer
17d19cd04a
Fix #1379 : Missing ILRange from yield return FSM.
6 years ago
Daniel Grunwald
e041454987
Add pretty tests for "yield return" and fix some minor bugs:
...
* remove redundant casts on yield-return-expression
* keep variable name from metadata for foreach loops
* fix 'yield break;' in nested try-finally sometimes causing a decompiler error
7 years ago
Daniel Grunwald
ed631cc7d3
Fix #1307 : some of the blocks made unreachable by the yield-return-transform were not deleted
...
This had the effect of leaving behind error comments despite the yield-return transform being successful.
7 years ago
Daniel Grunwald
5d394b7786
Refactor PR #1303 to make the ConvertBranchAfterYieldReturn logic easier to understand
7 years ago
Wenxuan Zhao
3e937cf7cb
Fix delegate in yield return issue for assembly compiled with Mono
7 years ago
Wenxuan Zhao
9228e0102c
Fix yield return for assembly compiled with Mono
7 years ago
Chicken-Bones
e9b766d708
Improve persistence of IL offsets through various transforms.
7 years ago
Siegfried Pammer
fc717be0d8
Fix typo in YieldReturnDecompiler
7 years ago
Siegfried Pammer
dbe29596de
Fix #1210 : v4.x: System.InvalidCastException: Specified cast is not valid
7 years ago
Daniel Grunwald
1f3916d554
Use the resolve methods in MetadataModule, and remove the wrappers in DecompilerTypeSystem.
7 years ago
Daniel Grunwald
107fe5eb1c
Eliminate SpecializingDecompilerTypeSystem and use GenericContext instead.
7 years ago
Daniel Grunwald
d166101387
Allow splitting variables that have their address taken.
...
This works if all addresses are immediately used in calls (as common with method calls on value-type,
which take 'this' by-reference); as long as the call doesn't return the reference again.
Closes #1136 .
7 years ago
Siegfried Pammer
bcfb3742eb
Clean up PEFile, move Pdb related types to DebugInfo namespace
7 years ago
Daniel Grunwald
385433aff4
Add MetadataMethod.
7 years ago
Siegfried Pammer
592935537a
Migrate AsyncAwaitDecompiler and YieldReturnDecompiler to SRM.
7 years ago
Siegfried Pammer
1a0052a345
Cache UsingScope during decompiler run.
7 years ago
Siegfried Pammer
a06a04d48b
#1080 : Add ILTransformContext.RequiredNamespacesSuperset
7 years ago
Daniel Grunwald
236c7c28b4
Remove redundant lambda casts.
8 years ago
Daniel Grunwald
7017c6f6e6
Replace LoopingBlockTransform with StatementTransform.
...
This transform interleaves statement-combining transforms so that nested structures can be detected better.
8 years ago
Daniel Grunwald
919219524b
Eliminate the dedicated logic.not instruction, and treat it as syntax sugar similar to logic.and/logic.or.
...
'logic.not(arg)' is now represented using 'comp(arg == ldc.i4 0)'.
8 years ago
Siegfried Pammer
206cdecf30
Merge Return instruction into Leave.
8 years ago
Daniel Grunwald
ec610a4422
Clean up mono yield-return decompilation.
8 years ago
Daniel Grunwald
d550390f4d
Initial support for yield-return decompilation in assemblies compiled with the mono compiler.
8 years ago
Daniel Grunwald
b36ae9df7e
Start on new async/await decompiler.
8 years ago
Daniel Grunwald
bcdd34a9d0
More aggressively duplicate return blocks in MoveNext() methods.
...
This fixes 'yield return' decompilation of debug builds using legacy csc.
8 years ago
Daniel Grunwald
4c77022988
Improve decompiler performance.
8 years ago
Daniel Grunwald
2207ab40f7
Check the CancellationToken a bit more frequently.
8 years ago
Daniel Grunwald
173c8d353f
Support 'state + c1 < c2' in state-range-analysis.
8 years ago
Daniel Grunwald
b9b510d225
yield return decompiler: fix yield return in structs; fix local variables in finally block
8 years ago
Daniel Grunwald
7277de6c08
More fixes for yield return decompilation.
8 years ago
Daniel Grunwald
9fa6009c44
Remove dead compiler-generated 'V = null;' assignments.
8 years ago
Daniel Grunwald
bddda342a1
Improve yield-return-decompiler.
8 years ago
Daniel Grunwald
1001ff5721
Fix 'yield break;' in try-catch blocks.
8 years ago
Daniel Grunwald
5621101436
Reconstruct try-finally blocks in yield return decompiler
9 years ago
Daniel Grunwald
fe84ea9730
WIP: yield return decompiler
9 years ago