Daniel Grunwald
d388319cba
Add support for C# 9 init accessors.
5 years ago
Daniel Grunwald
d02fd09822
Explicitly create partitioners for `Parallel.ForEach` calls.
...
Apparently the default `Parallel.ForEach` logic checks whether the input enumerable is an array or `IList<T>`,
and if it is, creates whole chunks of sequential list/array indices and assigns those to the worker threads.
This is more efficient if the individual items are processed very quickly; but if they take varying amounts of time, a single chunk full of expensive items might keep a single CPU core busy for long after all other CPU cores have gone idle.
5 years ago
Siegfried Pammer
4b865c27e4
Fix #2076 : VS AddIn opens reference assembly.
5 years ago
Siegfried Pammer
8d72672e6c
Reimplement DecompilerSettings.StaticLocalFunctions (was lost in the refactoring in #2077 )
5 years ago
Siegfried Pammer
c9df069526
Add minimal test case + DecompilerSettings.Deconstruction setting
5 years ago
Siegfried Pammer
3f10294a72
Add DeconstructionTransform + implement DeconstructInstruction in ExpressionBuilder
5 years ago
Siegfried Pammer
b01e9484d5
Fix bugs in ILAst
5 years ago
Siegfried Pammer
eac0e2257e
Support MatchInstruction in DataFlowVisitor
5 years ago
Siegfried Pammer
6bb6097ad4
Extended DeconstructInstruction.CheckInvariant
5 years ago
Siegfried Pammer
33bc9fbef4
Fix display of generic type parameters of local functions in tooltips
5 years ago
Siegfried Pammer
67b2a45292
Improve tooltips and highlighting of local functions
5 years ago
Siegfried Pammer
acea95d0a1
Properly rename LocalFunctionMethod.Name on all instructions
5 years ago
Siegfried Pammer
18ace00266
Refactor LocalFunctionDeclarationStatement + LocalFunctionMethod
5 years ago
Siegfried Pammer
431bbaa489
RequiredNamespaceCollector: properly handle parts of methods
5 years ago
Daniel Grunwald
cda56e7f7e
#2048 : Pattern matching: documentation and invariants for MatchInstruction.
5 years ago
Daniel Grunwald
bdea1950a8
Add `#if !NETCORE` around extension methods that are included with .NET Core 3
5 years ago
Daniel Grunwald
fc51dd17a5
Remove outdated comment. The `PickExitPoint` heuristic is no longer using "amount of code" but the IL block order.
5 years ago
Siegfried Pammer
4f8c588c7b
Fix #2068 : ILSpy can't find referenced library even though it's open
5 years ago
Daniel Grunwald
c647016bfb
#2070 : Allow `PickExitPoint` heuristic to choose a `return;`/`yield break;` that is part of a condition block.
5 years ago
Daniel Grunwald
2acc4339df
#2058 : Mark most transforms as public to help users that use the ILAst directly without decompiling to C#.
5 years ago
Daniel Grunwald
bd059dfb59
Fix #2075 : IndexOutOfRange exception in PEFile.GetRuntime()
5 years ago
Daniel Grunwald
3409ffca25
Fix #2073 : Ensure the startOffsetVar actually appears in the expected instruction, not somewhere else.
5 years ago
Siegfried Pammer
95f2ae7aef
Add ILAst base for Deconstruction and Pattern Matching
5 years ago
Siegfried Pammer
3dc75b9366
Add additional C# AST nodes used for deconstruction.
5 years ago
Siegfried Pammer
5459d6b022
#2064 : Improve performance of RequiredNamespaceCollector by skipping repeated IType.GetAllBaseTypes() calls.
5 years ago
Daniel Grunwald
e0fd0bba32
Allow inlining constants into expression trees.
5 years ago
Daniel Grunwald
c63e14e805
Move some special cases from ILInlining.FindLoadInNext to the individual ILInstructions.
5 years ago
Daniel Grunwald
fe2143b41f
Validate code movement performed by IndexRangeTransform.
5 years ago
Daniel Grunwald
f93ea325d4
Remove redundant StatementTransform pass.
...
This duplicate pass only made sense back when we ran CopyPropagation as part of the BlockILTransform.
5 years ago
Daniel Grunwald
7d3dfc3b81
Remove the hack where IndexRangeTransform looks at instructions prior to startPos.
...
Instead we now perform a partial transformation which we can then later extend.
This means we no longer need to rely on the previous instruction (prior to startPos) being already inlined.
This way the IndexRangeTransform also works without the duplicate StatementTransform pass.
5 years ago
Daniel Grunwald
1b2874eb5d
Use `nint` type for local IntPtr variables if arithmetic is performed on them.
5 years ago
Siegfried Pammer
5da3b87845
Fix #2060 : Add support for alternate code patterns in TransformDisplayClassUsage.ValidateConstructor
5 years ago
Daniel Grunwald
1d684102ac
Support compound assignment for native integers.
5 years ago
Daniel Grunwald
59be020dea
Fix pointer arithmetic with `nint*`/`nuint*`.
5 years ago
Daniel Grunwald
8f6bf3b45b
Simplify TranslateArrayIndex.
5 years ago
Daniel Grunwald
dc3dd193c8
Support unary operators on native integers.
5 years ago
Daniel Grunwald
a7826e399e
Fix native integer shifts.
5 years ago
Daniel Grunwald
3a4db502bc
Add support for arithmetic using C# 9 native integer types.
5 years ago
Daniel Grunwald
5a8cfc25ba
Add some tests for native integers.
...
The conversion roundtrip tests are disabled due to https://github.com/dotnet/roslyn/issues/45929
5 years ago
Daniel Grunwald
156b1d0e75
Fix void*->IntPtr conversion in checked context. Also fix a stack overflow for certain forms of conversions involving `nint`.
5 years ago
Daniel Grunwald
2c9b84a1e1
If possible, use nint/nuint for conversions to/from IntPtr.
5 years ago
Daniel Grunwald
c9e41d0582
Add support for decoding `NativeIntegerAttribute`.
5 years ago
Daniel Grunwald
450fae49e3
Introduce nint/nuint types and their conversions in the type system
5 years ago
Daniel Grunwald
12094a8376
Support extraction out of control-flow IfInstruction even if it isn't using a Block as TrueInst/FalseInst.
5 years ago
Daniel Grunwald
417a2c3391
Revert the InvertIf change; it causes too many issues for the following transforms.
5 years ago
Daniel Grunwald
e083d43fb9
Fix ReduceNestingTransform
5 years ago
Daniel Grunwald
016d9f8f4d
Fix #1903 : un-inline argument of unsupported `isinst` instructions.
5 years ago
Daniel Grunwald
696fdca923
Always create a block when inverting an if.
...
This keeps the ILAst more uniform and ensures extraction is possible for the code in the then statement.
5 years ago
Daniel Grunwald
b18ed89b67
#2050 : Add assertion to check that no transform uses StObj.TargetSlot incorrectly.
5 years ago
Daniel Grunwald
81d9eda332
I just discovered that we do have un-inlining implemented... let's mention it where it's more likely to be found in the future.
5 years ago