Files
IPS_W-assignments/W1/fasto/Fasto/DeadFunctionRemoval.fs
NikolajDanger b9ef4bb00e stuff
2022-04-30 16:18:13 +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