Siegfried Pammer
e33a010cc7
Remove compiler-generated variable in while (true) loops.
8 years ago
Siegfried Pammer
12e39cf63c
Fix switch exit points.
8 years ago
Siegfried Pammer
f7f583056a
Fix order of switch blocks.
8 years ago
Daniel Grunwald
87b350e4eb
Fix SwitchAnalysis not recursing into the default-block of IL switches.
8 years ago
Daniel Grunwald
953c6a0929
Keep code dominated by a single switch section within the switch.
8 years ago
Daniel Grunwald
c7490ff2fe
[switch] Sort switch sections
8 years ago
Daniel Grunwald
de2c647114
Revert "Fix bug that could cause nodes reachable from the exit point to be moved into the loop/switch."
...
This reverts commit 105ff744b3 .
A correctly chosen single exit point should dominate all other code that
is dominated by the loop but not included in the body -- otherwise there
would be multiple exit points.
So this "bugfix" was only covering up for us not properly validating the
exit points from post-dominance.
8 years ago
Daniel Grunwald
cd993ad074
Property validate exit points determined using post-dominance.
8 years ago
Daniel Grunwald
9ef97703cd
[switch] consider loop back-edges to be exit points when looking for the switch body
8 years ago
Daniel Grunwald
105ff744b3
Fix bug that could cause nodes reachable from the exit point to be moved into the loop/switch.
8 years ago
Daniel Grunwald
102729cfde
Put switch instructions into their own BlockContainer.
...
This removes the need for "goto case" in the ILAst as we can just branch to the appropriate block.
It also means we can support "break;" within switch using the "leave" instruction (otherwise we'd have to introduce yet another special kind of jump).
8 years ago
Daniel Grunwald
f42d1a4b34
Fix crash in SwitchDetection.
8 years ago
Daniel Grunwald
8a68a94d35
Simplify use of SwitchInstruction in ILAst
...
* the default case is now handled as a normal case
* when dealing with basic blocks, SwitchInstruction will be the last instruction in the block
* introduced ILAst instruction for 'goto case'
8 years ago
Daniel Grunwald
66dc52c33c
Fix handling of 'leave' instruction in SwitchAnalysis.
...
This is necessary for detecting a sparse switch when the default case consists of "return;".
8 years ago
Daniel Grunwald
39bb6856b7
Fix various bugs with compound assignments.
8 years ago
Daniel Grunwald
846c8613b0
[async] Delete dead ldloc(cachedStateVar).
8 years ago
Daniel Grunwald
a6c6ddcea1
Fix #861 : Improved loop exit point heuristic.
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
0008deb021
Fix handling of try-finally blocks in ReachingDefinitionsVisitor.
...
This was causing variables to get split incorrectly.
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
Daniel Grunwald
e266c634de
[nullables] Add support for lifted binary operators where one of the inputs is nullable.
8 years ago
Daniel Grunwald
6b3ab66300
Fix ExpectedResultType of main BlockContainer.
8 years ago
Daniel Grunwald
259e322e26
Fix typo in IsBranchOrLeave()
8 years ago
Siegfried Pammer
2d1692c72f
Add value parameter to Leave ctor.
8 years ago
Daniel Grunwald
513a01e4dd
Ignore non-void leave in ConditionDetection.
...
This fixes a slight regression in control flow prettyness introduced in 206cdecf30
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
f5d907e0ce
[async] Allow splitting awaiter variables.
8 years ago
Daniel Grunwald
d5e41a91e6
[async] Fix await decompilation when GetResult call got inlined into another instruction.
8 years ago
Daniel Grunwald
e024641a5f
[async] Fix bug when async method uses this pointer.
8 years ago
Daniel Grunwald
fac340965f
return statements are no longer forcibly moved into loops when the loops are within exception handling blocks.
8 years ago
Daniel Grunwald
4bfdcdd8a2
[async] Fix handling of doFinallyBodies.
...
async/await decompilation is now enabled by default and in the testcases.
8 years ago
Daniel Grunwald
098d1152ff
[async] Handle pre-roslyn stack saving during await.
8 years ago
Daniel Grunwald
6c7e2efa6c
[async] Fix await decompiler for pre-roslyn csc, at least in cases where the stack is empty during the await.
8 years ago
Daniel Grunwald
123a7f4a62
[async] small improvements to await decompilation
8 years ago
Daniel Grunwald
04215ebcfa
[async] Add copy propagation so that state machine field accesses can be reliably detected.
8 years ago
Daniel Grunwald
7d6122cfaf
[async] Decompile await operator.
8 years ago
Daniel Grunwald
3ff3b34be9
[async]: control flow reconstruction: fixes for legacy csc
8 years ago
Daniel Grunwald
40212685b6
[async]: control flow reconstruction
8 years ago
Daniel Grunwald
2396a7449b
[async] Support state machine classes.
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
f411d15fc6
Fix generating switch sections without any case labels.
8 years ago
Daniel Grunwald
3e8ab77d52
Perform even less aggressive inlining of return blocks.
8 years ago
Daniel Grunwald
c239204c7f
Perform less aggressive inlining of return blocks. This tends to reconstruct control flow closer to the original code.
8 years ago
Daniel Grunwald
4c77022988
Improve decompiler performance.
8 years ago
Daniel Grunwald
a5a98ae9f1
Adjust labels of simple switch instructions.
8 years ago
Daniel Grunwald
2207ab40f7
Check the CancellationToken a bit more frequently.
8 years ago
Daniel Grunwald
69c77d75a5
Try to get rid of some more gotos.
8 years ago