Jane Doe
446ac06e38
candiate -> candidate
6 years ago
Daniel Grunwald
c4cb9df687
Fix switch in loops sometimes detecting an invalid switch body.
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
Daniel Grunwald
ccdabf2325
Fix a bunch of XmlDoc compiler warnings.
6 years ago
Siegfried Pammer
29527b804e
Fix #1392 : LoopDetection should take switch block containers into account in IncludeNestedContainers.
6 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
6 years ago
Chicken-Bones
e9b766d708
Improve persistence of IL offsets through various transforms.
7 years ago
Chicken-Bones
d8244e347b
Select outer-loop continue branches as break targets for switches in nested loops
7 years ago
Chicken-Bones
7017d998d0
Improve switch decompilation in loops via early detection of continue blocks.
7 years ago
Daniel Grunwald
542e088ceb
Fix #1185 : assertion with unreachable code in loop detection
7 years ago
Daniel Grunwald
c16817ab4e
Fix #1186 : LoopDetection assertion with unreachable code
7 years ago
Daniel Grunwald
d6bc1ca762
#915 : Fix LoopDetection.FindExitPoint() incorrectly returning null (=multiple exit points; use heuristic) when there was only a single exit point that wasn't dominated by the loop head.
8 years ago
Daniel Grunwald
e6afe4bf98
Fix #915 : ensure that loops are nested correctly
8 years ago
Daniel Grunwald
7af15d27cd
Fix #905 : improve exit point detection for foreach loops.
8 years ago
Siegfried Pammer
154833b06c
Add ContainerKind
8 years ago
Siegfried Pammer
12e39cf63c
Fix switch exit points.
8 years ago
Daniel Grunwald
953c6a0929
Keep code dominated by a single switch section within the switch.
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
a6c6ddcea1
Fix #861 : Improved loop exit point heuristic.
8 years ago
Daniel Grunwald
fe84ea9730
WIP: yield return decompiler
9 years ago
Daniel Grunwald
66dee6c6f9
LoopDetection: find appropriate exit points
9 years ago
Daniel Grunwald
e871f7c05a
Convert LoopDetection into a block transform.
9 years ago
Daniel Grunwald
ed3d4aba9d
Run IntroduceExitPoints before loop detection, and let loop detection introduce its own exit points.
...
Warning: this commit creates broken branches that enter blocks.
9 years ago
Siegfried Pammer
840ec04fde
Namespace adjustments for Syntax classes
9 years ago
Christoph Wille
1ce8349dd9
Adjust namespaces
9 years ago
Daniel Grunwald
9dec6c80a7
LoopDetection: use post-dominance to find better loop exit points
9 years ago
Daniel Grunwald
0e118f0977
LoopDetection: in loops without any exit points, exclude the largest possible code block from the loop
9 years ago
Daniel Grunwald
449bbe2043
Move transforms to transforms namespace
9 years ago
Daniel Grunwald
b10feca78b
Add 'InlineCompilerGeneratedVariables' transform, hopefully this is sufficient to replace the 'variable splitting' in the old decompiler.
10 years ago
Daniel Grunwald
2509f27223
* Rename ControlFlowSimplification to ConditionDetection
...
* Rename OptimizingTransform to ControlFlowSimplification
* Move control flow transforms to separate namespace.
10 years ago
Daniel Grunwald
0d6424bd12
IntroduceExitPoints
10 years ago
Daniel Grunwald
d6b9d39f38
First attempt at loop extension.
10 years ago
Daniel Grunwald
3a03415be4
Add ControlFlowSimplification pass
10 years ago
Daniel Grunwald
4dec7abb63
Replace 'endfinally' with 'leave'
10 years ago
Daniel Grunwald
0cae30cce2
ILInstruction.Clone()
10 years ago
Daniel Grunwald
6b4ea94a2e
Introduce 'leave' instruction for leaving block containers.
10 years ago
Daniel Grunwald
f37655a573
Add void-visitor and make Descendants use post-order.
10 years ago
Daniel Grunwald
bcfe1b0813
Add ILInstruction.ReplaceWith() method and make ILInstruction.Children an IReadOnlyList.
10 years ago
Daniel Grunwald
eedcfebb0f
Remove 'loop' instruction; just use a block container.
10 years ago
Daniel Grunwald
b2dfdea68e
Add loop detection.
10 years ago