public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(OpCode); output.Write(' '); output.WriteLocalReference(TargetLabel, (object)targetBlock ?? TargetILOffset); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write("deconstruct "); output.MarkFoldStart("{...}"); output.WriteLine("{"); output.Indent(); output.WriteLine("init:"); output.Indent(); foreach (var inst in this.Init) { inst.WriteTo(output, options); output.WriteLine(); } output.Unindent(); output.WriteLine("pattern:"); output.Indent(); pattern.WriteTo(output, options); output.Unindent(); output.WriteLine(); output.Write("conversions: "); conversions.WriteTo(output, options); output.WriteLine(); output.Write("assignments: "); assignments.WriteTo(output, options); output.Unindent(); output.WriteLine(); output.Write('}'); output.MarkFoldEnd(); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); if (ConstrainedTo != null) { output.Write("constrained["); ConstrainedTo.WriteTo(output, ILNameSyntax.ShortTypeName); output.Write("]."); } if (IsTail) { output.Write("tail."); } output.Write(OpCode); output.Write(' '); Method.WriteTo(output); output.Write('('); int firstIndex = (OpCode != OpCode.NewObj && !Method.IsStatic) ? -1 : 0; for (int i = 0; i < Arguments.Count; i++) { if (i > 0) { output.Write(", "); } if (ArgumentToParameterMap[i] != firstIndex + i) { output.Write($"{ArgumentToParameterMap[i]}: "); } Arguments[i].WriteTo(output, options); } output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write(".try "); TryBlock.WriteTo(output, options); output.Write(" fault "); faultBlock.WriteTo(output, options); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.WriteDefinition("BlockContainer", this); output.Write(' '); output.MarkFoldStart("{...}"); output.WriteLine("{"); output.Indent(); foreach (var inst in Blocks) { if (inst.Parent == this) { inst.WriteTo(output, options); } else { output.Write("stale reference to "); output.WriteReference(inst.Label, inst, isLocal: true); } output.WriteLine(); output.WriteLine(); } output.Unindent(); output.Write("}"); output.MarkFoldEnd(); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); if (ConstrainedTo != null) { output.Write("constrained["); ConstrainedTo.WriteTo(output); output.Write("]."); } if (IsTail) { output.Write("tail."); } output.Write(OpCode); output.Write(' '); Method.WriteTo(output); output.Write('('); for (int i = 0; i < Arguments.Count; i++) { if (i > 0) { output.Write(", "); } Arguments[i].WriteTo(output, options); } output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); if (options.UseLogicOperationSugar) { if (MatchLogicAnd(out var lhs, out var rhs)) { output.Write("logic.and("); lhs.WriteTo(output, options); output.Write(", "); rhs.WriteTo(output, options); output.Write(')'); return; } if (MatchLogicOr(out lhs, out rhs)) { output.Write("logic.or("); lhs.WriteTo(output, options); output.Write(", "); rhs.WriteTo(output, options); output.Write(')'); return; } } output.Write(OpCode); output.Write(" ("); condition.WriteTo(output, options); output.Write(") "); trueInst.WriteTo(output, options); if (falseInst.OpCode != OpCode.Nop) { output.Write(" else "); falseInst.WriteTo(output, options); } }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(OpCode); output.Write("." + BinaryNumericInstruction.GetOperatorName(Operator)); if (CheckForOverflow) { output.Write(".ovf"); } if (Sign == Sign.Unsigned) { output.Write(".unsigned"); } else if (Sign == Sign.Signed) { output.Write(".signed"); } output.Write('.'); output.Write(UnderlyingResultType.ToString().ToLowerInvariant()); if (IsLifted) { output.Write(".lifted"); } base.WriteSuffix(output); output.Write('('); Target.WriteTo(output, options); output.Write(", "); Value.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); output.Write(OpCode); output.Write("." + BinaryNumericInstruction.GetOperatorName(Operator)); if (CompoundAssignmentType == CompoundAssignmentType.EvaluatesToNewValue) { output.Write(".new"); } else { output.Write(".old"); } if (CheckForOverflow) { output.Write(".ovf"); } if (Sign == Sign.Unsigned) { output.Write(".unsigned"); } else if (Sign == Sign.Signed) { output.Write(".signed"); } output.Write('('); Target.WriteTo(output, options); output.Write(", "); Value.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write("call.indirect "); ReturnType.WriteTo(output); output.Write('('); bool first = true; int firstArgument = IsInstance ? 1 : 0; if (firstArgument == 1) { Arguments[0].WriteTo(output, options); first = false; } foreach (var(inst, type) in Arguments.Skip(firstArgument).Zip(ParameterTypes, (a, b) => (a, b))) { if (first) { first = false; } else { output.Write(", "); } inst.WriteTo(output, options); output.Write(" : "); type.WriteTo(output); } if (Arguments.Count > 0) { output.Write(", "); } functionPointer.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); output.Write("Block "); output.WriteDefinition(Label, this); if (Parent is BlockContainer) { output.Write(" (incoming: {0})", IncomingEdgeCount); } output.Write(' '); output.MarkFoldStart("{...}"); output.WriteLine("{"); output.Indent(); foreach (var inst in Instructions) { inst.WriteTo(output, options); output.WriteLine(); } if (finalInstruction.OpCode != OpCode.Nop) { output.Write("final: "); finalInstruction.WriteTo(output, options); output.WriteLine(); } output.Unindent(); output.Write("}"); output.MarkFoldEnd(); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(".try "); TryBlock.WriteTo(output, options); output.Write(" finally "); finallyBlock.WriteTo(output, options); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write("case "); output.Write(Labels.ToString()); output.Write(": "); body.WriteTo(output, options); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write("nullable.unwrap "); output.Write(ResultType); output.Write('('); Argument.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write(OpCode); output.Write("("); valueInst.WriteTo(output, options); output.Write(", "); fallbackInst.WriteTo(output, options); output.Write(")"); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write(OpCode); output.Write('.'); output.Write(resultType); output.Write('('); this.array.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(OpCode); output.Write(' '); output.Write(Index.ToString()); output.Write('('); this.Argument.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write(".try "); TryBlock.WriteTo(output, options); foreach (var handler in Handlers) { output.Write(' '); handler.WriteTo(output, options); } }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(OpCode); output.Write("." + Operation.ToString().ToLower()); DynamicInstruction.WriteBinderFlags(BinderFlags, output, options); base.WriteSuffix(output); output.Write(' '); DynamicInstruction.WriteArgumentList(output, options, (Target, TargetArgumentInfo), (Value, ValueArgumentInfo)); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write("lock ("); OnExpression.WriteTo(output, options); output.WriteLine(") {"); output.Indent(); Body.WriteTo(output, options); output.Unindent(); output.WriteLine(); output.Write("}"); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write(OpCode); if (IsLifted) { output.Write(".lifted"); } output.Write('('); this.Argument.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write(OpCode); if (targetContainer != null) { output.Write(' '); output.WriteReference(TargetLabel, targetContainer, isLocal: true); output.Write(" ("); value.WriteTo(output, options); output.Write(')'); } }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write("using ("); Variable.WriteTo(output); output.Write(" = "); ResourceExpression.WriteTo(output, options); output.WriteLine(") {"); output.Indent(); Body.WriteTo(output, options); output.Unindent(); output.WriteLine(); output.Write("}"); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { WriteILRange(output, options); output.Write(OpCode); base.WriteSuffix(output); output.Write(' '); Method.WriteTo(output); output.Write('('); this.Target.WriteTo(output, options); output.Write(", "); this.Value.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); output.Write(OpCode); if (IsChecked) { output.Write(".checked"); } output.Write(' '); type.WriteTo(output); output.Write('('); Argument.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write("catch "); if (variable != null) { output.WriteDefinition(variable.Name, variable); output.Write(" : "); Disassembler.DisassemblerHelpers.WriteOperand(output, variable.Type); } output.Write(" when ("); filter.WriteTo(output, options); output.Write(')'); output.Write(' '); body.WriteTo(output, options); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); output.Write(OpCode); output.Write("." + Operation.ToString().ToLower()); DynamicInstruction.WriteBinderFlags(BinderFlags, output, options); if (CompoundAssignmentType == CompoundAssignmentType.EvaluatesToNewValue) { output.Write(".new"); } else { output.Write(".old"); } output.Write(' '); DynamicInstruction.WriteArgumentList(output, options, (Target, TargetArgumentInfo), (Value, ValueArgumentInfo)); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); output.Write(OpCode); if (CompoundAssignmentType == CompoundAssignmentType.EvaluatesToNewValue) { output.Write(".new"); } else { output.Write(".old"); } output.Write(' '); Method.WriteTo(output); output.Write('('); this.Target.WriteTo(output, options); output.Write(", "); this.Value.WriteTo(output, options); output.Write(')'); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { output.Write("switch ("); value.WriteTo(output, options); output.Write(") "); output.MarkFoldStart("{...}"); output.WriteLine("{"); output.Indent(); output.Write("default: "); defaultBody.WriteTo(output, options); output.WriteLine(); foreach (var section in this.Sections) { section.WriteTo(output, options); output.WriteLine(); } output.Unindent(); output.Write('}'); output.MarkFoldEnd(); }
public override void WriteTo(ITextOutput output, ILAstWritingOptions options) { ILRange.WriteTo(output, options); if (options.UseLogicOperationSugar && MatchLogicNot(out var arg)) { output.Write("logic.not("); arg.WriteTo(output, options); output.Write(')'); return; } output.Write(OpCode); output.Write('.'); output.Write(InputType.ToString().ToLower()); switch (Sign) { case Sign.Signed: output.Write(".signed"); break; case Sign.Unsigned: output.Write(".unsigned"); break; } switch (LiftingKind) { case ComparisonLiftingKind.CSharp: output.Write(".lifted[C#]"); break; case ComparisonLiftingKind.ThreeValuedLogic: output.Write(".lifted[3VL]"); break; } output.Write('('); Left.WriteTo(output, options); output.Write(' '); output.Write(Kind.GetToken()); output.Write(' '); Right.WriteTo(output, options); output.Write(')'); }