Siegfried Pammer
62b8ab39f1
Fix oversight from b788441c78
5 years ago
Daniel Grunwald
8061634e67
#1203 , #2092 : New logic for resolving assembly references within the type system.
...
We now avoid the old `IModuleReference` interface which required allocating for every type being resolved.
Instead `MetadataModule.ResolveModule` now combines decoding+resolving assembly references into a single step.
This allows the type system to maintain a cache indexed by row number.
This also changes the behavior of resolving references within a compilation: We now prefer an exact match (name + version + publickeytoken) first; and fall back to a name-only match only if no exact match exists.
This somewhat improves the decompilation of assemblies created by using ilmerge to combine assemblies with different target frameworks.
5 years ago
Daniel Grunwald
1751c9922c
Avoid constructing a GetClassTypeReference instance in TypeProvider.GetTypeFromReference.
5 years ago
Daniel Grunwald
b788441c78
DecompilerTypeSystem: If some known types are present in referenced assemblies but others are missing; add the missing known types to the compilation.
...
This ensures that FindType(KnownTypeCode).GetDefinition() always returns a usable definition.
5 years ago
Daniel Grunwald
5bd47c171f
Don't require a definition for the task builder type, also accept an UnknownType.
5 years ago
Daniel Grunwald
440ef75898
Avoid pointless UnknownType->object->UnknownType casts.
5 years ago
Daniel Grunwald
b6b5f1e8e6
#2092 : ILFunction.Parameters / ILFunction.ReturnType should never be null.
5 years ago
Daniel Grunwald
40e2776f02
#2089 : Handle invalid attribute/reference metadata in `DetectTargetFrameworkId`
5 years ago
Daniel Grunwald
c6b10d3ec3
Fix #2094 : ByteOffset() arguments passed in wrong order
5 years ago
Daniel Grunwald
1a997fdb60
Enable aggressive inlining into switch expressions.
5 years ago
Daniel Grunwald
abb9d49a0f
Add support for C# 8 switch expressions.
5 years ago
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