Siegfried Pammer
a541fc0ddf
Fix CS9336 precedence bug in CompoundAssignmentInstruction.
...
The C# 9 IntPtr / UIntPtr guard in IsBinaryCompatibleWithType read
type.Kind is not TypeKind.NInt or TypeKind.NUInt
which parses as `(is not NInt) or (is NUInt)` — true unless
Kind == NInt. The intent (per the surrounding comment "but not nint
or C# 11 IntPtr") is "Kind is neither NInt nor NUInt", which needs
parentheses around the alternation:
type.Kind is not (TypeKind.NInt or TypeKind.NUInt)
Effect: when Kind == NUInt the branch no longer mistakenly applies
the C# 9 IntPtr-only restrictions (suppressing compound assignment
without nint, disallowing shifts).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 months ago
Siegfried Pammer
77d9ee73e9
Fix IDE2000 globally
6 months ago
Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
10 months ago
Daniel Grunwald
b80d20b15d
Add support for calling `operator checked`.
3 years ago
Daniel Grunwald
8b9ba20847
Builtin unsigned right shift operator.
3 years ago
Daniel Grunwald
5fb2f7a22f
#nullable enable for ILAst (except for generated code)
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
6 years ago
Daniel Grunwald
1d684102ac
Support compound assignment for native integers.
6 years ago
Siegfried Pammer
e211b01595
Fix CA1507:UseNameofInPlaceOfString, adjust formatting of some older source files copied from NRefactory.
7 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.
7 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 .
7 years ago
Daniel Grunwald
961923f4fd
#1499 , #1240 : Translate pointer arithmetic on managed pointers (ref T) using the System.Runtime.CompilerServices.Unsafe intrinsics
7 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Daniel Grunwald
12e74daf48
Handle Comp in InferType().
8 years ago
Daniel Grunwald
33ef82f75c
Fix #1082 : Add support for compound assignment with string.Concat().
...
Currently only supports the binary overloads of string.Concat().
8 years ago
Siegfried Pammer
c4f41f459f
Add support for more dynamic binary operators.
8 years ago
Siegfried Pammer
0bb71f469d
Add DynamicCompoundAssign instruction
8 years ago
Daniel Grunwald
f021ec4383
NumericCompoundAssign: implement ILiftableInstruction
8 years ago
Daniel Grunwald
3956fa685d
Refactor TransformAssignment to reduce code duplication.
8 years ago
Siegfried Pammer
845c620a9f
Implement UserDefinedCompoundAssign
...
rename CompoundAssignmentInstruction -> NumericCompoundAssign
8 years ago
Daniel Grunwald
75a627d40b
Don't use compound assignment when the RHS value does not fit into the LHS type.
8 years ago
Daniel Grunwald
b9337c6129
Fix #1021 : Compound assignments on pointer types.
8 years ago
Daniel Grunwald
4c5f0b7e9c
Convert TransformAssignment into a statement transform and add support for inline property assignments.
9 years ago
Daniel Grunwald
40a4f08a8d
Add support for compound assignment of short integers.
9 years ago
Daniel Grunwald
248a9ad76f
Fix #954 : don't use invalid compound assignments on enums
9 years ago
Siegfried Pammer
5fec6bd7f7
Implement Interval.WriteTo extension method on ILAst
9 years ago
Daniel Grunwald
39bb6856b7
Fix various bugs with compound assignments.
9 years ago
Daniel Grunwald
61900e33c3
[nullables] Lifted compound assignments
9 years ago
Daniel Grunwald
66d1b744c3
Add ILAstWritingOptions parameter to ILInstruction.WriteTo().
9 years ago
Siegfried Pammer
840ec04fde
Namespace adjustments for Syntax classes
10 years ago
Christoph Wille
1ce8349dd9
Adjust namespaces
10 years ago
Daniel Grunwald
421ad617f8
Fix MayThrow flag on BinaryNumericInstruction
10 years ago
Siegfried Pammer
1d92df7723
Add HasTypeOperand to CompoundAssignmentInstruction
10 years ago
Siegfried Pammer
ae75c57e22
Basic implementation of CompoundAssignmentInstruction
10 years ago
Siegfried Pammer
3a89500e0c
Merge binary arithmetic instructions into one class.
10 years ago
Siegfried Pammer
8766783eb6
Remove ld(s)fld/st(s)fld
10 years ago
Daniel Grunwald
55d953b889
Remove CompoundAssignmentType from BinaryNumericInstruction:
...
Compound assignments were not supported by any user of the ILAst.
In particular, they are problematic because they are yet another way to store to a local variable (making reaching definitions complex).
They also didn't update the StoreCount correctly when inst.Left or inst.Left.Variable was changed.
Since they weren't used (yet), just remove them.
Hopefully we'll find a better representation once we need compound assignments.
10 years ago
Daniel Grunwald
ae318eca02
Make implicit I4->I conversions explicit in ILAst.
10 years ago
Daniel Grunwald
c171dbd520
Add class VariableScope.
10 years ago
Siegfried Pammer
7fdb7765c8
fix copy-paste error in PeekOrDefault extension
11 years ago
Siegfried Pammer
abc29ef52f
determine proper ResultType of Shl/Shr
11 years ago
Daniel Grunwald
ea0eaf9623
Add CompoundAssignment mode to BinaryNumericInstruction
12 years ago
Daniel Grunwald
3d47e1028e
Instead of OverflowMode, use bool checkForOverflow + Sign
12 years ago
Daniel Grunwald
42bfff077d
Finish the move to the new generated ILAst classes
12 years ago
Daniel Grunwald
49ce1bcea3
Worked on ILAst instruction representation
12 years ago