Files
IPS_G-assignment/fasto/Fasto/DeadFunctionRemoval.fs
NikolajDanger 642fcbd636 fasto unzipped
2022-05-04 10:40:19 +02:00

11 lines
253 B
Forth

module DeadFunctionRemoval
open AbSyn
open CallGraph
let removeDeadFunction (prog : TypedProg) =
let graph = callGraph prog
let alive (FunDec (fname, _, _, _, _)) =
fname = "main" || calls "main" fname graph
List.filter alive prog