Skip to content

Commit

Permalink
Moved control_flow package to root
Browse files Browse the repository at this point in the history
  • Loading branch information
RealA10N committed Dec 17, 2024
1 parent 1d8334b commit 1329c93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
17 changes: 0 additions & 17 deletions usm64/control_flow/graph.go → control_flow/builder.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
package control_flow

type SupportsControlFlow interface {
// Returns a list of all instruction indices in the function that execution
// could arrive to after the execution of this instruction.
PossibleNextInstructionIndices() []uint
}

type ControlFlowBasicBlock struct {
InstructionIndices []uint
ForwardEdges []uint
BackwardEdges []uint
}

type ControlFlowGraph[InstT SupportsControlFlow] struct {
Instructions []InstT
BasicBlocks []ControlFlowBasicBlock
}

func getInstructionsForwardEdges[InstT SupportsControlFlow](
instructions []InstT,
) [][]uint {
Expand Down
18 changes: 18 additions & 0 deletions control_flow/graph.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package control_flow

type SupportsControlFlow interface {
// Returns a list of all instruction indices in the function that execution
// could arrive to after the execution of this instruction.
PossibleNextInstructionIndices() []uint
}

type ControlFlowBasicBlock struct {
InstructionIndices []uint
ForwardEdges []uint
BackwardEdges []uint
}

type ControlFlowGraph[InstT SupportsControlFlow] struct {
Instructions []InstT
BasicBlocks []ControlFlowBasicBlock
}

0 comments on commit 1329c93

Please sign in to comment.