Skip to content

Commit

Permalink
Update FlowDomain.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Oct 21, 2024
1 parent d5b0940 commit 573240d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Draco.Compiler/Internal/FlowAnalysis/FlowDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ internal abstract class GenKillFlowDomain<TElement>(IEnumerable<TElement> elemen
private readonly Dictionary<BoundNode, BitArray> genSets = [];
private readonly Dictionary<BoundNode, BitArray> notKillSets = [];

/// <summary>
/// Checks if the bit for the given element is set in the state.
/// </summary>
/// <param name="state">The state to check.</param>
/// <param name="element">The element to check the bit for.</param>
/// <returns>True if the corresponding bit for the element is set, false otherwise.</returns>
public bool IsSet(BitArray state, TElement element) => state[this.Elements.IndexOf(element)];

public override string ToString(BitArray state)
{
var result = new StringBuilder();
Expand Down

0 comments on commit 573240d

Please sign in to comment.