Class CilBlockPattern
Defines the pattern that matches on a single basic block in a control flow graph of a CIL method body.
public record CilBlockPattern : Pattern<IList<CilInstruction>>, IEquatable<Pattern>, IEquatable<Pattern<IList<CilInstruction>>>, IEquatable<CilBlockPattern>
- Inheritance
-
CilBlockPattern
- Implements
- Inherited Members
Constructors
CilBlockPattern(CilBlockPattern)
protected CilBlockPattern(CilBlockPattern original)
Parameters
originalCilBlockPattern
CilBlockPattern(CilBlockPatternAttributes, ImmutableArray<Pattern<CilInstruction>>)
Defines the pattern that matches on a single basic block in a control flow graph of a CIL method body.
public CilBlockPattern(CilBlockPatternAttributes Attributes, ImmutableArray<Pattern<CilInstruction>> Instructions)
Parameters
AttributesCilBlockPatternAttributesThe matching flags.
InstructionsImmutableArray<Pattern<CilInstruction>>The list of expected instructions.
Properties
Attributes
The matching flags.
public CilBlockPatternAttributes Attributes { get; init; }
Property Value
EqualityContract
protected override Type EqualityContract { get; }
Property Value
IgnoreNops
Gets a value indicating NOP instructions in the input should be ignored.
public bool IgnoreNops { get; }
Property Value
Instructions
The list of expected instructions.
public ImmutableArray<Pattern<CilInstruction>> Instructions { get; init; }
Property Value
Methods
Deconstruct(out CilBlockPatternAttributes, out ImmutableArray<Pattern<CilInstruction>>)
public void Deconstruct(out CilBlockPatternAttributes Attributes, out ImmutableArray<Pattern<CilInstruction>> Instructions)
Parameters
AttributesCilBlockPatternAttributesInstructionsImmutableArray<Pattern<CilInstruction>>
Equals(CilBlockPattern?)
public virtual bool Equals(CilBlockPattern? other)
Parameters
otherCilBlockPattern
Returns
Equals(Pattern<IList<CilInstruction>>?)
public override sealed bool Equals(Pattern<IList<CilInstruction>>? other)
Parameters
otherPattern<IList<CilInstruction>>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Format(IndentedTextWriter)
Serializes the pattern to a readable string.
public override void Format(IndentedTextWriter indented)
Parameters
indentedIndentedTextWriter
GetHashCode()
public override int GetHashCode()
Returns
Match(IList<CilInstruction>, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<IList<CilInstruction>>? Match(IList<CilInstruction> input, MatchingContext context)
Parameters
inputIList<CilInstruction>The input to match.
contextMatchingContextThe context in which to match the pattern to.
Returns
- IMatchNode<IList<CilInstruction>>
When successful, returns the root node of the match tree, otherwise
null.
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(CilBlockPattern?, CilBlockPattern?)
public static bool operator ==(CilBlockPattern? left, CilBlockPattern? right)
Parameters
leftCilBlockPatternrightCilBlockPattern
Returns
operator !=(CilBlockPattern?, CilBlockPattern?)
public static bool operator !=(CilBlockPattern? left, CilBlockPattern? right)
Parameters
leftCilBlockPatternrightCilBlockPattern