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
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
18ace00266
Refactor LocalFunctionDeclarationStatement + LocalFunctionMethod
5 years ago
Siegfried Pammer
431bbaa489
RequiredNamespaceCollector: properly handle parts of methods
5 years ago
Siegfried Pammer
5459d6b022
#2064 : Improve performance of RequiredNamespaceCollector by skipping repeated IType.GetAllBaseTypes() calls.
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
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
016d9f8f4d
Fix #1903 : un-inline argument of unsupported `isinst` instructions.
5 years ago
Daniel Grunwald
94a8190861
#2049 : Delete old NRefactory node types that were never supported for output.
5 years ago
Daniel Grunwald
a0b144d332
Use `Unsafe.AsPointer()` for `ConversionKind.StopGCTracking`.
5 years ago
Daniel Grunwald
35c405b973
Translate the initializer of a `fixed` statement as managed reference and only apply the ref-to-pointer conversion at the end.
...
This way we create compilable code when the pinned variable type does not match the initializer type.
5 years ago
Daniel Grunwald
a9d643b208
Emit a call to `ref Unsafe.As<TFrom, TTo>(ref TFrom)` when the IL code contains a mismatch of managed reference types.
...
The previously emitted `ref *(TTo*)(&source)` only compiles when `source` is a local variable; otherwise C# complains about the memory not being pinned.
Note that we special-case local variables to keep the previous behavior around; this avoids pulling in `System.Runtime.CompilerServices.Unsafe.dll` when it's unnecessary.
5 years ago
Daniel Grunwald
2c0554f129
Fix #1963 : Support decompiling `calli` instructions into C# 9 function pointer syntax.
5 years ago
Siegfried Pammer
9f0ca09e56
Fix #2033 : Wrong place for variable declaration.
5 years ago
Siegfried Pammer
3e4091442d
Simplify ExpressionBuilder.ConvertField.IsUnambiguousAccess by renaming it to ExpressionBuilder.ConvertField.IsAmbiguousAccess
5 years ago
dymanoid
bfb57da93b
Implement project writer for SDK style projects
5 years ago
dymanoid
fdef5d11c6
Rearrange project writing logic
...
The WholeProjectDecompiler shall not have too many responsibilities.
5 years ago
dymanoid
b492a20442
Move assembly resolution logic to better place
...
WholeProjectDecompiler shall not care about checking whether an assembly
is in GAC.
5 years ago
dymanoid
a952cda502
Create dedicated namespace for project decompiler
5 years ago
dymanoid
48be6267f3
Replace tuples with value tuples
5 years ago
Siegfried Pammer
a49577ce2d
Fix #2020 : Mark Modifier Letter (Lm category) characters as printable
5 years ago
Siegfried Pammer
30c8a22ded
Fix #1765 : Add another pattern of FSM initialization to ReadCodeMappingInfo
5 years ago
Siegfried Pammer
d27c0226b4
Fix #2010 : NullReferenceException in SequencePointBuilder.VisitCatchClause()
5 years ago
Siegfried Pammer
4f7ca65408
Fix #1913 : Make sure to declare local variables captured by local functions before the first invocation of the local function.
5 years ago
Siegfried Pammer
0df7e1e4a5
Fix #1999 : Compiler generated variables with weird names; by supporting a newer naming-convention used by mcs for anonymous delegates: See c2795c9cb5/mcs/mcs/delegate.cs (L808)
5 years ago
Siegfried Pammer
2f51f31257
PDBGen: avoid assertion failure, if there are instructions that are not supported in C# (e.g. calli)
5 years ago
Siegfried Pammer
794be9a5b4
Fix SequencePointBuilder.VisitCatchClause: do not create a sequence point from the catch-token to the closing brace.
5 years ago
Siegfried Pammer
6382f8c41d
Fix #1990 : Empty default ctor with XML comment discarded from decompilation
5 years ago
Daniel Grunwald
b7754cdf5c
Workaround dotnet/roslyn#43659 in decompiled code.
5 years ago
Daniel Grunwald
cd04e80f5e
Use IsKnownType() when checking for System.Object
5 years ago
Siegfried Pammer
60e9c204cc
Fix #1940 : Make sure that we use the correct .NET Core version, when there are multiple frameworks loaded in the current assembly list.
5 years ago
Daniel Grunwald
0dd75d6852
Add support for slicing using C# 8 ranges.
5 years ago
Daniel Grunwald
aed358b5a0
Use more precise ResolveResult, so that Range/Index operators are hyperlinked.
5 years ago
Daniel Grunwald
12226c5f90
Add support for indexing a container with a System.Index instance.
5 years ago
Daniel Grunwald
748c54a1c1
Support array slicing.
5 years ago
Daniel Grunwald
dc6e094a30
Add support for indexing arrays using System.Index
5 years ago
Daniel Grunwald
4846feb640
Add support for C# 8 range syntax.
...
This initial commit only handles the trivial case where an Index or Range object is constructed.
The TODO portions of the test case show there are plenty of cases where where the C# compiler emits more complex code patterns that will require ILAst transforms.
5 years ago