Siegfried Pammer
0d1b6203df
#1981 : Refactor LocalFunctionDecompiler: Propagate closure parameter arguments, so that all arguments can be stripped from use-sites.
5 years ago
Siegfried Pammer
5711185832
Make sure that the code and the pattern described in the comment above are in sync.
5 years ago
Daniel Grunwald
7d8b9fee1e
Remove redundant code.
5 years ago
Siegfried Pammer
b114734128
Add Mode.UnconstrainedType and implement TransformNullPropagationOnUnconstrainedGenericExpression using TryNullPropagation.
5 years ago
Siegfried Pammer
9c8df1d949
Fix assignment of ILRanges in ExpressionTransforms.TransformCatchVariable
5 years ago
Siegfried Pammer
effc49c479
Move TransformNullPropagationOnUnconstrainedGenericExpression into NullPropagationTransform and make use of IsValidAccessChain
5 years ago
Siegfried Pammer
1303c54086
Exactly match load, store and address counts of defaultTemporary.
5 years ago
Siegfried Pammer
b92a4b956c
#1940 : Ignore nullability in ETs
5 years ago
Siegfried Pammer
c676665a61
#1940 : Refactor TransformExpressionTrees to support rolling back all changes if the transform fails.
5 years ago
Daniel Grunwald
1926756cfa
Handle the special cases where the range does not have a start or endpoint.
5 years ago
Daniel Grunwald
0dd75d6852
Add support for slicing using C# 8 ranges.
5 years ago
Daniel Grunwald
dd54dbc144
Disable IndexRangeTransform if the "C# 8 ranges" setting is disabled.
5 years ago
Daniel Grunwald
dc38355e12
Support `list[^idx]`.
...
Here the C# compiler does not actually create a `System.Index` instance, but instead compiles to `list[list.Count - idx]`.
5 years ago
Daniel Grunwald
060830dd64
Variable splitting: support cases where a ref is passed through a ref-returning method, and then used.
...
From `IndexRangeTest.UseIndexForRef`:
```
stloc V_4(call GetSpan())
stloc S_19(ldloca V_4)
stloc V_2(call get_Length(ldloc S_19))
stloc V_3(call GetOffset(addressof System.Index(call GetIndex(ldc.i4 0)), ldloc V_2))
call UseRef(call get_Item(ldloc S_19, ldloc V_3))
stloc V_4(call GetSpan())
stloc S_30(ldloca V_4)
stloc V_2(binary.sub.i4(call get_Length(ldloc S_30), call GetInt(ldc.i4 0)))
call UseRef(call get_Item(ldloc S_30, ldloc V_2))
```
Due to `Span.get_Item` being a ref-return, it's possible that `ref V_4` is returned and passed into the `UseRef` method (this can't actually happen given Span's implementation, but it's a possible implementation of the get_Item type signature).
But we still need to split `V_4` -- it's a compiler-generated variable and needs to be inlined.
I think we can do this relatively simply by continuing to go up the ancestor instructions when we hit a ref-returning call. The recursive `DetermineAddressUse` call will check that there are no stores to `V_4` between the `get_Item` call and the point where the returned reference is used. Thus we still ensure that we don't split a variable while there is a live reference to it.
5 years ago
Daniel Grunwald
12226c5f90
Add support for indexing a container with a System.Index instance.
5 years ago
Daniel Grunwald
dc6e094a30
Add support for indexing arrays using System.Index
5 years ago
Siegfried Pammer
8925b4ff7b
Inline variable declarations/modernize parts of our code base.
5 years ago
Siegfried Pammer
91e9573449
Fix #1976 : ProxyCallReplacer should honor selected language version/selected options
5 years ago
Siegfried Pammer
10e3da3d16
Add missing license headers to MIT licensed files in ICSharpCode.Decompiler
5 years ago
Siegfried Pammer
4db41f69db
Fix #1919 : Use unmapped IL offsets at the start of a catch-block for the 'exception specifier' sequence point.
5 years ago
Siegfried Pammer
ba5c645257
Add TryCatchHandler annotation to CatchClause
5 years ago
Siegfried Pammer
69ac54fbb6
Fix #1879 : Do not remove variables that look like display class variables, but are used in other patterns as well.
5 years ago
Siegfried Pammer
5ee172d4c4
Fix #1900 : RemoveDeadVariableInit.ResetHasInitialValueFlag should handle local functions
5 years ago
Siegfried Pammer
371d732c0a
Fix #1881 : Not properly reusing names from PDB#2
5 years ago
Siegfried Pammer
e748e71b56
Implement workaround for #1961
5 years ago
Siegfried Pammer
a7d1d8fad7
TransformNullPropagationOnUnconstrainedGenericExpression: handle pattern that uses leave instructions instead of stloc into a temporary.
5 years ago
Siegfried Pammer
010abebcc9
Fix #1050 : Implement TransformNullPropagationOnUnconstrainedGenericExpression
5 years ago
Siegfried Pammer
bef75321fb
#1913 : Do not destroy control-flow by removing return statements
5 years ago
Siegfried Pammer
73e0f7c3ac
Fix #1936 : TransformDisplayClassUsage should remove copies of display-class references.
5 years ago
Siegfried Pammer
28391c4864
Fix #1895 : local function not added to the correct parent function.
6 years ago
Siegfried Pammer
92e1d6fe85
Fix #1907 : Discard parameter names containing non-printable or white space characters from set of possible names considered by AssignVariableNames.
6 years ago
Chicken-Bones
22243de7b0
Improve ReduceNestingTransform by considering nested containers (Try/Using/Lock/Pinned/etc)
6 years ago
Siegfried Pammer
d8a08822b7
Fix #1879 : Incorrectly detected display class.
6 years ago
Siegfried Pammer
f831e4713f
Fix #1867 : Captures of copies of this are not properly handled by the decompiler
6 years ago
Siegfried Pammer
5be6be97df
Code review:
...
* rename a few identifiers,
* add comments,
* skip all compiler-generated type-arguments in resolve result,
* and change implementation of LocalFunctionMethod.Specialize: wrap specialized method and not the other way round.
6 years ago
Siegfried Pammer
9e89384916
Make NumberOfCompilerGeneratedGenerics immutable and rename to NumberOfCompilerGeneratedTypeParameters
6 years ago
Siegfried Pammer
e189ad9ca3
Fix #1863 : Invalid decompilation: accessibility level for CompilerGenerated method
6 years ago
Daniel Grunwald
eb2a9e6b94
#1852 : Rename array.to.pointer opcode to get.pinnable.reference.
6 years ago
SilverFox
5914d5b96b
Fix #1854
6 years ago
Siegfried Pammer
407c337168
Add ForStatement, DoWhileStatement and SeparateLocalVariableDeclarations settings.
6 years ago
Siegfried Pammer
a653b8b566
Fix #1841 : Not properly reusing names from PDB
6 years ago
Daniel Grunwald
832c18f0be
Fix #1809 : Support VB Select on string.
6 years ago
Daniel Grunwald
42f71b56f6
Fix #1811 : Assert in NullCoalescingInstruction.CheckInvariant after expression tree transform
6 years ago
Daniel Grunwald
93806b46fa
Fix compound assignments with type `bool`.
...
This required removing the "Replace bit.and with logic.and" transform, as it interfered with the compound assignment transform.
6 years ago
SilverFox
a5d85fea3f
Add an workaround for #1798
6 years ago
SilverFox
22daaa3572
Enable static local functions and update related tests, since roslyn 3.4.0-beta3 is available for tests
6 years ago
SilverFox
33f96fd888
Fix tests `LocalFunctions.NestedCapture1`
6 years ago
SilverFox
5e6fecebf5
Rework support for generic local function, and fix tests `LocalFunctions.Generic.Test_CaptureT` and `LocalFunctions.Generic.TestGenericArgs`
6 years ago
SilverFox
e60f1f5a87
Skip LocalFunctionDecompiler if the top scope is LocalFunction or LocalFunctionDisplayClass
6 years ago
SilverFox
f039705704
Add support for generic local function
6 years ago