Peter Crabtree
e1e16b64f5
dev: Strip BOM mark from text files
4 months ago
Daniel Grunwald
f826037acc
Protect IsInst against multi-step inlining -- we can only allow `Box` as the top-level argument, not anywhere within the argument tree.
4 months ago
Daniel Grunwald
dd4bf7d8a4
Fix #3518 by replacing `FixLoneIsInst` with an inlining restriction.
...
This way we avoid having to extract later, as we will never inline if the `isinst` argument if this could result in it being unrepresentable in C#.
This commit also refactors inlining restrictions to avoid requiring special cases in ILInlining itself.
But when making this change, I discovered that this broke our pattern-matching tests, and that the weird IL with double `isinst` is indeed generated by the C# compiler for `if (genericParam is StringComparison.Ordinal)` style code. So instead we also allow `isinst` with a `box(expr-without-side-effects)` argument to be represented with the `expr is T ? (T)expr : null` emulation.
4 months ago
Daniel Grunwald
7fc9025500
Fix nullability of Extract return type
8 months ago
Daniel Grunwald
245261a1e5
#nullable enable for Instructions.tt
5 years ago
Daniel Grunwald
0414e7f8e9
Fix potential NRE in ILFunction.RegisterVariable()
5 years ago
Daniel Grunwald
5fb2f7a22f
#nullable enable for ILAst (except for generated code)
5 years ago
Daniel Grunwald
f726a0b73e
#nullable enable for typesystem and ILInstruction base class
5 years ago
dotnet format
0d9f871a4f
#2128 : Reformat the whole code base.
5 years ago
Siegfried Pammer
b435c07f4d
Added support for deconstruction assignments to properties
5 years ago
Siegfried Pammer
95f2ae7aef
Add ILAst base for Deconstruction and Pattern Matching
6 years ago
Daniel Grunwald
c63e14e805
Move some special cases from ILInlining.FindLoadInNext to the individual ILInstructions.
6 years ago
Siegfried Pammer
c293613a56
Add ExceptionSpecifierILRange to TryCatchHandler
6 years ago
Siegfried Pammer
e4fda5c2e4
Rename HasILRange to ILRangeIsEmpty to properly reflect its implementation.
6 years ago
Daniel Grunwald
2b9a40371b
Remove the dead LoopingTransform.
...
Make ILInstruction.IsDirty debug-only, as it is only used for assertions now.
7 years ago
Siegfried Pammer
3ea2ce4e2d
#1349 : Fix assertions triggered by incorrect reset implementation in TransformThrowExpressionsValueTypes. ILInstruction.SetChildInstruction should only return early, if index and parent are still the same.
7 years ago
Siegfried Pammer
7d4b4c6433
Implement NullCoalescingTransform with value types.
7 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.
7 years ago
Daniel Grunwald
52e6717faf
Fix #1452 : Avoid NullReferenceException when accessing SlotInfo property on the root node
7 years ago
Siegfried Pammer
c1fca21e8a
Make ILRange field private - introduce public API for IL range manipulation.
7 years ago
Daniel Grunwald
568b3e2d91
Fix DetectPinnedRegions introducing stack type inconsistencies.
8 years ago
Daniel Grunwald
b7d4636f80
Implement ILInstruction.AddILRange()
8 years ago
Siegfried Pammer
312277119c
Move ILAstWritingOptions to separate file
8 years ago
Daniel Grunwald
0008deb021
Fix handling of try-finally blocks in ReachingDefinitionsVisitor.
...
This was causing variables to get split incorrectly.
8 years ago
Daniel Grunwald
53a050552b
Add support for syntax sugar when writing out the ILAst.
8 years ago
Daniel Grunwald
66d1b744c3
Add ILAstWritingOptions parameter to ILInstruction.WriteTo().
8 years ago
Daniel Grunwald
96c6b03d9b
[nullables] operator! on bool?
8 years ago
Daniel Grunwald
21ef967d4d
[nullables] Lifting for non-equality comparisons.
8 years ago
Daniel Grunwald
133ddac256
[nullables] Add support for lifted conversions.
8 years ago
Daniel Grunwald
260d303b8e
Restore P/Invoke test.
8 years ago
Daniel Grunwald
3e8ab77d52
Perform even less aggressive inlining of return blocks.
8 years ago
Daniel Grunwald
fe84ea9730
WIP: yield return decompiler
9 years ago
Christoph Wille
1ce8349dd9
Adjust namespaces
9 years ago
Daniel Grunwald
7273fe58fd
Add BlockTransform concept and apply a bunch of refactoring essentials suggestions.
9 years ago
Daniel Grunwald
15b776faa2
Initial attempt at short-circuiting if conditions
9 years ago
Daniel Grunwald
6774b3c3cc
Add struct TranslationContext to ExpressionBuilder
10 years ago
Daniel Grunwald
14815abd7c
Initial version of IL pattern matching.
10 years ago
Siegfried Pammer
a674b4cdf1
Extend TransformAssignment
10 years ago
Siegfried Pammer
2d26c77682
Fix failing InstructionFlags-assertion
10 years ago
Daniel Grunwald
6d9e53bf4f
Improve ILInlining.IsSafeForInlineOver()
10 years ago
Siegfried Pammer
0e87dfb9aa
Add IInstructionWithMethodOperand for LdFtn and LdVirtFtn
10 years ago
Siegfried Pammer
f3f78ebfab
Add IInstructionWithFieldOperand
10 years ago
Daniel Grunwald
7e50076671
Introduce array.to.pointer instruction.
...
This is necessary to construct pinned regions in all cases.
10 years ago
Daniel Grunwald
bb1beedbd4
Reactivate PatternStatementTransform
10 years ago
Siegfried Pammer
3fc12209b1
Add IsDirty tracking to ILInstruction
10 years ago
Daniel Grunwald
b55775e2cc
Add reaching definitions analysis.
10 years ago
Daniel Grunwald
c171dbd520
Add class VariableScope.
10 years ago
Daniel Grunwald
8edfe57b85
Fix bug in Clone() impl for collection slots.
10 years ago
Daniel Grunwald
e0cf3bc7d8
Document stale positions and orphaned nodes.
10 years ago
Daniel Grunwald
e2c0f40f71
ILAst: make 'Return' less of a special case
...
(don't let the slot contents have an effect on the number of slots)
10 years ago