SCM Repository
[smlnj] Diff of /sml/trunk/src/MLRISC/flowgraph/buildFlowgraph.sml
Diff of /sml/trunk/src/MLRISC/flowgraph/buildFlowgraph.sml
Parent Directory
|
Revision Log
|
Patch
170 |
in List.foldl switch 0 targets; () |
in List.foldl switch 0 targets; () |
171 |
end |
end |
172 |
|
|
173 |
and fallsThru(id, blks) = let |
and fallsThru(id, blks) = |
|
fun fallThruEdge(to) = addEdge (id, to, CFG.FALLSTHRU) |
|
|
in |
|
174 |
case blks |
case blks |
175 |
of [] => fallThruEdge(EXIT) |
of [] => addEdge(id, EXIT, CFG.FALLSTHRU) |
176 |
| CFG.BLOCK{id=next, insns=ref(_::_), (*data=ref[], JHR *) ...}::_ => fallThruEdge(next) |
| CFG.BLOCK{id=next, ...}::_ => addEdge(id, next, CFG.FALLSTHRU) |
177 |
| CFG.BLOCK{id=next, ...} ::_ => error |
(*esac*) |
|
(* if pseudo ops are alignment directives, this may not be an error *) |
|
|
(Fmt.format "Block %d falls through to pseudoOps in %d\n" |
|
|
[Fmt.INT id, Fmt.INT next]) |
|
|
end |
|
178 |
|
|
179 |
and addEdges [] = () |
and addEdges [] = () |
180 |
| addEdges(CFG.BLOCK{id, insns=ref[], ...}::blocks) = fallsThru(id, blocks) |
| addEdges(CFG.BLOCK{id, insns=ref[], ...}::blocks) = fallsThru(id, blocks) |
|
Legend:
Removed from v.1016 |
|
changed lines |
|
Added in v.1017 |
|
|