Header menu logo B2R2

RegisterSet Type

Represents a set of register IDs. This is an efficient and architecture-agnostic set data structure that internally uses bit arrays. Since RegisterIDs always start from 0 for any architecture, we can use it directly as an index to the bit array.

Constructors

Constructor Description

RegisterSet()

Full Usage: RegisterSet()

Returns: RegisterSet
Returns: RegisterSet

RegisterSet(maxNumElems)

Full Usage: RegisterSet(maxNumElems)

Parameters:
    maxNumElems : int

Returns: RegisterSet
maxNumElems : int
Returns: RegisterSet

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    idx : int

Adds a register to the set by marking the corresponding bit.

idx : int

this.BucketCount

Full Usage: this.BucketCount

Returns: int

Gets the number of buckets in the bit array.

Returns: int

this.Clear

Full Usage: this.Clear

Clears the set.

this.Contains

Full Usage: this.Contains

Parameters:
    idx : int

Returns: bool

Checks if the set contains the given register indexed by idx.

idx : int
Returns: bool

this.Intersect

Full Usage: this.Intersect

Parameters:

Updates the current register set by making an intersection with the given set.

other : RegisterSet

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

Checks if the set is empty.

Returns: bool

this.Iterate

Full Usage: this.Iterate

Parameters:
    fn : int -> unit

Iterates over the set and applies the given function to each element.

fn : int -> unit

this.MaxNumElems

Full Usage: this.MaxNumElems

Returns: int

Gets the maximum number of elements that this set can hold.

Returns: int

this.Remove

Full Usage: this.Remove

Parameters:
    idx : int

Removes a register from the set by unmarking the corresponding bit.

idx : int

this.Union

Full Usage: this.Union

Parameters:

Updates the current register set by making a union with the given set.

other : RegisterSet

Type something to start searching.