! Copyright (C) 2004, 2005 Slava Pestov. ! See http://factor.sf.net/license.txt for BSD license. IN: compiler-frontend USING: arrays compiler-backend errors generic inference kernel lists math namespaces prettyprint sequences strings words ; GENERIC: linearize* ( node -- ) : linearize ( dataflow -- linear ) #! Transform dataflow IR into linear IR. This strips out #! stack flow information, and flattens conditionals into #! jumps and labels. [ %prologue , linearize* ] { } make ; : linearize-next node-successor linearize* ; M: f linearize* ( f -- ) drop ; M: node linearize* ( node -- ) linearize-next ; M: #label linearize* ( node -- ) #! We remap the IR node's label to a new label object here, #! to avoid problems with two IR #label nodes having the #! same label in different lexical scopes.