Files
IPS_G-assignment/Fasto/DeadFunctionRemoval.fs
2022-05-18 10:46: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