Siegfried Pammer
2a3279d627
Keep ref iterator loops as while when live after loop
...
The loop-shape decision can use ILVariable use lists before AST lowering, so avoid creating a for-loop when its iterator updates a byref local that must remain usable after the loop.
Assisted-by: OpenAI:openai/gpt-5.5:OpenCode
2 days ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
10 months ago
Daniel Grunwald
5a5be026d0
Avoid reference count temporarily dropping to zero while ConditionDetection moves instructions to other blocks.
...
This avoids recursively un-registering e.g. all LdLocs from their ILVariable.LoadInstructions, etc. (all the ILInstruction.Disconnected logic). This speeds up the example from #1193 by another factor 2.
3 years ago
Daniel Grunwald
685a79dc31
DetectExitPoints: introduce exit points for loops+switch
...
This allows reverting the changes to HighLevelLoopTransform+ReduceNestingTransform from the previous commit, which fixes a bug in loop detection (the previous commit did not handle loops where the loop BlockContainer didn't have a Block as parent).
5 years ago
Daniel Grunwald
6757295b3b
Fix #2379 : Keep `return` statements around in original form for ConditionDetection, only transform to fall-through block-exit at the end of the transform pipeline.
...
This fixes an issue where `return` statements within try-blocks could turn into `goto` statements.
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Siegfried Pammer
407c337168
Add ForStatement, DoWhileStatement and SeparateLocalVariableDeclarations settings.
7 years ago
Daniel Grunwald
b32cae412a
Eliminate BlockKind.PostfixOperator.
...
We can now represent all compound assignments using the CompoundAssignInstruction, including those on local variables.
Closes #1583 .
7 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Siegfried Pammer
deeb603fd7
Fix #1395 : do-while loop missing entry-point label.
8 years ago
Chicken-Bones
52a279f861
Restore HighLevelLoopTransform pattern match for loop contents within if body
8 years ago
Chicken-Bones
7017d998d0
Improve switch decompilation in loops via early detection of continue blocks.
8 years ago
Daniel Grunwald
4b96f48d87
Cosmetic changes during review of PR #1176
8 years ago
Chicken-Bones
3fb7c71f8a
Improve control flow decompilation in ConditionDetection
8 years ago
Siegfried Pammer
845c620a9f
Implement UserDefinedCompoundAssign
...
rename CompoundAssignmentInstruction -> NumericCompoundAssign
8 years ago
Siegfried Pammer
ed8fc0de8c
Fix #968 : foreach loop with early return
9 years ago
Siegfried Pammer
69f2609bff
Fix #861 : Failure to decompile for loop with conditional early return
9 years ago
Siegfried Pammer
37474ae5e9
Fix #447 : second part ReturnFromDoWhileInTryFinally
9 years ago
Siegfried Pammer
300c9cc9a9
Do not convert while-true to while-condition loop or do-while loop, if the condition uses a variable that is captured inside the loop.
9 years ago
Siegfried Pammer
f91df96281
Improve for loop transform: split conditions
9 years ago
Siegfried Pammer
b3f5a8e089
Refactor MatchDoWhileLoop; add documentation
9 years ago
Siegfried Pammer
b24b749ec6
Add support for multiple conditions in do-while loops.
9 years ago
Siegfried Pammer
4daabf350a
Do not convert to for loop if increment variable is a parameter.
9 years ago
Siegfried Pammer
bcc574a6c0
Fix aggressive for-loop detection
9 years ago
Siegfried Pammer
86c3ab8314
Fix unit tests
9 years ago
Siegfried Pammer
b3370506ae
Fix small regressions
9 years ago
Siegfried Pammer
bfb310b4a3
Remove DetectedLoop
9 years ago
Siegfried Pammer
8da8a7f0c9
HighLevelLoopTransform: implement detection of for and do-while
9 years ago
Siegfried Pammer
af6274c5ae
HighLevelLoopTransform: Add support for while (condition) loops
9 years ago