Siegfried Pammer
c5ff0cafc5
TransformInlineAssignmentStObjOrCall: Make sure no dead store is produced by the transform.
3 years ago
Daniel Grunwald
bd9aabeae2
Update to dotnet-format 5.1.225507.
...
This makes the formatting expected by our CI consistent with that generated by VS2019.9.
4 years ago
Siegfried Pammer
d2fc380e0e
Fix #2349 : Use proper ExpressionType with DynamicCompoundAssign.
4 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Daniel Grunwald
1d684102ac
Support compound assignment for native integers.
5 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
Chicken-Bones
661acdfc08
Transform post-increment on float/double. Fixes #1764
6 years ago
Daniel Grunwald
752f0de978
Further adjustments to transforms now that copy propagation no longer runs.
6 years ago
Daniel Grunwald
97d490a3df
Slightly generalize the post-increment transform so that it no longer depends on copy propagation.
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
33c7425fa2
Fix several bugs with compound assignments on indexers.
...
Closes #1580 .
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
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
00d6c6175a
#1049 : Check decompiler settings in TransformAssignment.HandleCompoundAssign as well.
6 years ago
Siegfried Pammer
087cb2489d
Fix #1049 : Unimplemented decompiler settings
6 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
6 years ago
Siegfried Pammer
667e04462a
Fix #1325 : Do not perform inline assignment transform on setter calls, that belong to parameterized properties.
7 years ago
Daniel Grunwald
12e74daf48
Handle Comp in InferType().
7 years ago
Daniel Grunwald
ba0a3af3c4
#1195 : Fix several issues decompiling SharpSvn.dll (C++/CLI)
7 years ago
Daniel Grunwald
066da1ea16
Fix #1200 : assertion in TransformInlineAssignmentLocal when reconstructed stack slot (after async-await transform) has small integer type.
...
The assertion was unnecessary, because we already check 'IsImplicitTruncation(inst.Value, inst.Variable.Type)'.
7 years ago
Daniel Grunwald
4580eab7ab
Disable ref inline assignments.
...
This increases the chances that we'll avoid CS8174: A declaration of a by-reference variable must have an initializer.
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
c4f41f459f
Add support for more dynamic binary operators.
7 years ago
Siegfried Pammer
273a1c24ff
Add dynamic compound assignment transforms
7 years ago
Daniel Grunwald
f021ec4383
NumericCompoundAssign: implement ILiftableInstruction
7 years ago
Daniel Grunwald
3956fa685d
Refactor TransformAssignment to reduce code duplication.
7 years ago
Siegfried Pammer
9ebfbe57dd
Add transforms for userdef compound assignment
...
fix bugs in other transforms
7 years ago
Daniel Grunwald
25706f2a39
Support logic.and/etc. in IsImplicitTruncation().
7 years ago
Daniel Grunwald
75a627d40b
Don't use compound assignment when the RHS value does not fit into the LHS type.
7 years ago
Daniel Grunwald
0a1921ff67
Fix #1007 : post-increment transform incorrect due to variable splitting.
8 years ago
Siegfried Pammer
349183544a
Rename BlockType to BlockKind
8 years ago
Daniel Grunwald
a82430fc78
Add missing safety checks to inline assignment transforms.
8 years ago
Daniel Grunwald
11631d6cf0
Remove redundant code from TransformAssignment.
8 years ago
Daniel Grunwald
7847a69d69
Fix compound assignment and post-increment.
8 years ago
Daniel Grunwald
4c5f0b7e9c
Convert TransformAssignment into a statement transform and add support for inline property assignments.
8 years ago
Daniel Grunwald
40a4f08a8d
Add support for compound assignment of short integers.
8 years ago
Daniel Grunwald
248a9ad76f
Fix #954 : don't use invalid compound assignments on enums
8 years ago
Daniel Grunwald
b0bf6326ad
Allow inline assignments to short integers when we can tell that there's no truncation.
8 years ago
Daniel Grunwald
c7e60a9b3c
Avoid using inline assignments if they truncate the input value.
8 years ago
Daniel Grunwald
385005b2e5
More strictly test the inline assignment pattern.
8 years ago
Siegfried Pammer
ab1598c547
Fix bug in TransformRoslynPostIncDecOperatorOnAddress;
...
Add DelegateConstruction tests
8 years ago
Siegfried Pammer
cf8d4936e6
Fix regression in TransformPostIncDecOperatorOnAddress;
...
Add pattern for Roslyn inc/dec operator on addresses
8 years ago
Siegfried Pammer
23bf856132
Fix bug in TransformPostIncDecOperatorOnAddress
8 years ago
Daniel Grunwald
39bb6856b7
Fix various bugs with compound assignments.
8 years ago
Daniel Grunwald
61900e33c3
[nullables] Lifted compound assignments
8 years ago
Siegfried Pammer
b5e46c3545
Fix #882 : Invalid assignment code after decompiling
8 years ago
Daniel Grunwald
c81f9f366e
Remove LdAddressUsagesTransform.
...
The transform was incorrect (moving and cloning instructions without verifying that they don't have side-effects), and had a negative effect on our ability to detect compound assignments.
8 years ago
Daniel Grunwald
735f8e070d
Compound assignment doesn't support lifting yet.
8 years ago
Siegfried Pammer
bc33fa54e9
Rename BlockType.CompoundOperator to PostfixOperator
8 years ago