Siegfried Pammer
7d4b4c6433
Implement NullCoalescingTransform with value types.
6 years ago
Daniel Grunwald
8117dfff4a
Fix #1242 : Discard unreachable code.
...
Unreachable code is not part of the dominator tree, which most of our transforms are based on.
In particular, dominance-based loop detection runs into the problem where unreachable code might have jumps into two independent loops. In that case, it's impossible to place the unreachable code in a way that avoids assertions / generating invalid C#.
We establish the invariant that all blocks in a BlockContainer must be statically reachable from the entry point (-> every block is part of the dominator tree). This means transforms no longer have to deal with special cases for unreachable code.
The "Remove dead and side effect free code" option still has an effect on dead stores, but unreachable code is now always removed (previously this also was dependent on this option).
6 years ago
Daniel Grunwald
c366235246
#1349 : Fix type substitution for members of unknown generic types (due to unresolved references)
...
Also, assume that unknown inputs to ldfld are temporaries, not unmanaged pointers.
This avoids emitting weird pointer casts when accessing fields on unresolved value types.
6 years ago
Daniel Grunwald
539e3a906d
Fix #1552 : user-defined and decimal increments
...
For user-defined increments, there were problems with Roslyn was optimizing out one of the stores.
The new transform FixRemainingIncrements now takes increments/decrements that were not detected by TransformAssignment and introduces a temporary variable that can be incremented.
This sometimes requires un-inlining via the new ILInstruction.Extract() operation.
Extract() is not supported in all possible contexts, so it is possible but unlikely that some op_Increment calls remain.
For decimals, the situation is different: legacy csc actually was optimizing "d + 1m" to "op_Increment(d)", so we can get rid of any left-over increments by undoing this optimization. This now happens in ReplaceMethodCallsWithOperators.
6 years ago
Daniel Grunwald
c56714c607
Fix assertion with async lambdas; fix async local functions.
6 years ago
Siegfried Pammer
37e14f43e3
Refactor/Clean up local functions representation in type system.
6 years ago
Daniel Grunwald
ccdabf2325
Fix a bunch of XmlDoc compiler warnings.
6 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 .
6 years ago
Daniel Grunwald
f2151972a0
Redesign CompoundAssignmentInstruction to support an 'Address' mode where we don't implicitly turn an LdObj into an StObj, but instead directly operate on an address.
...
This means we can get rid of the special case in TransformDisplayClassUsage, as compound.assign can now also be used with the address of a local variable.
6 years ago
Siegfried Pammer
6f98ed5415
Fix unit tests.
6 years ago
Siegfried Pammer
305b47245e
Refactor representation of local functions in ILAst.
6 years ago
Siegfried Pammer
b42d4963e7
Fix assertions in TransformExpressionTrees.
6 years ago
Siegfried Pammer
d50b8d66d1
Fix #1373 , fix #1541 : add support for instance calls to CallIndirect.
6 years ago
Daniel Grunwald
a6def4cdf5
Fix incorrect type for numeric.compound.assign when the pointer type is incompatible with the store type.
...
Closes #1511 , #1530 , #1533 .
6 years ago
Siegfried Pammer
8d1522f387
Transform display classes used in local functions.
6 years ago
Siegfried Pammer
9590cfbf59
Update tests to latest Roslyn implementation.
6 years ago
Siegfried Pammer
bd77b8301f
Basic implementation of local functions.
6 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
6 years ago
Siegfried Pammer
b03aa488aa
Performance: Cache ChainedConstructorCallILOffset in ILFunction to avoid having to scan the method body in every inlining step. Take a shortcut for static ctors, as there cannot be chained ctor calls in static ctors.
6 years ago
Daniel Grunwald
52e6717faf
Fix #1452 : Avoid NullReferenceException when accessing SlotInfo property on the root node
6 years ago
Daniel Grunwald
f18ed5a418
Fix #1453 : Incorrect assert in IL Conv for R4 -> R8
6 years ago
Daniel Grunwald
40b6f0c7bf
Use appropriate type for helper variables introduced for named arguments.
6 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
6 years ago
Daniel Grunwald
f1c8142ce2
PDB generator now can emit "method stepping information" for async functions.
6 years ago
Daniel Grunwald
763683748b
Emit debug info for display class locals, so that the debugger can show the values of captured variables.
6 years ago
Daniel Grunwald
da5693e605
Fix #1339 : fixed statement not decompiled correctly when pinned variable is reset in finally block
6 years ago
Daniel Grunwald
47ca51a769
Clarify the meaning of ILVariable.Index
6 years ago
Daniel Grunwald
0a9df3d373
Fix #1252 : Incorrect comparison type for lifted comparisons in expression trees.
7 years ago
Daniel Grunwald
12e74daf48
Handle Comp in InferType().
7 years ago
Chicken-Bones
e9b766d708
Improve persistence of IL offsets through various transforms.
7 years ago
Siegfried Pammer
2047923809
Add ShowChildIndexInBlock option to make debugging of larger blocks easier.
7 years ago
Siegfried Pammer
057ab82534
Add basic stackalloc initializer transforms.
7 years ago
Daniel Grunwald
dd5845e83d
Support short-circuiting operators with dynamic. (e.g. "if (x.A && x.B)" where "x" is dynamic)
7 years ago
Siegfried Pammer
e92b9fe5e4
Optimize performance of debug builds: only call string.Format, if assertion fails.
7 years ago
Daniel Grunwald
9479e8af13
Support overloaded operator &&/||.
7 years ago
Daniel Grunwald
107fe5eb1c
Eliminate SpecializingDecompilerTypeSystem and use GenericContext instead.
7 years ago
Daniel Grunwald
33ef82f75c
Fix #1082 : Add support for compound assignment with string.Concat().
...
Currently only supports the binary overloads of string.Concat().
7 years ago
Siegfried Pammer
4540b93e19
Use ArgumentOutOfRangeException or BadImageFormatException in switch-default sections.
7 years ago
Siegfried Pammer
89544864bf
Provide better exceptions and messages in case of errors.
7 years ago
Siegfried Pammer
4f8441e142
Introduce several new WriteReference overloads
7 years ago
Daniel Grunwald
367b396b35
Fix assertion with fields declared in an unresolved class type.
7 years ago
Siegfried Pammer
904aa5269e
Fix various bugs in ExpressionBuilder.VisitDynamic* + refactor DynamicInstructions a bit
7 years ago
Siegfried Pammer
6ce53c804b
Fix #1168 : Extend MatchCompEquals and MatchCompNotEquals to work with multiple nested logic.not instructions
7 years ago
Siegfried Pammer
bbe16584f7
Fix #1150 :
...
- Allow unknown type in BinaryNumericInstruction
- Make conversions explicit: I+I8=I8, I4+I8=I8, F4+F8=F8
7 years ago
Siegfried Pammer
c4f41f459f
Add support for more dynamic binary operators.
7 years ago
Siegfried Pammer
66724db69b
Add WriteArgumentList to DynamicInstruction
7 years ago
Siegfried Pammer
83c9d0f2fa
Add DynamicInstruction.GetArgumentInfoOfChild
7 years ago
Siegfried Pammer
0bb71f469d
Add DynamicCompoundAssign instruction
7 years ago
Daniel Grunwald
ca09f09222
Don't use named arguments when IL stack is empty after the stloc.
...
An empty stack indicates the statement is complete, so the code
is usually more readable if we keep the local variable.
7 years ago
Daniel Grunwald
810adea8b4
#1083 : Initial implementation of named arguments.
7 years ago