28 lines
574 B
Factor
28 lines
574 B
Factor
! Copyright (C) 2008 Slava Pestov.
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
USING: kernel accessors namespaces assocs sequences sets fry ;
|
|
IN: compiler.cfg
|
|
|
|
TUPLE: cfg entry word label ;
|
|
|
|
C: <cfg> cfg
|
|
|
|
! - "number" and "visited" is used by linearization.
|
|
TUPLE: basic-block < identity-tuple
|
|
visited
|
|
number
|
|
label
|
|
instructions
|
|
successors
|
|
predecessors ;
|
|
|
|
: <basic-block> ( -- basic-block )
|
|
basic-block new
|
|
V{ } clone >>instructions
|
|
V{ } clone >>successors
|
|
V{ } clone >>predecessors ;
|
|
|
|
TUPLE: mr instructions word label ;
|
|
|
|
C: <mr> mr
|