7import qualified Data.Map.Utils as Map
9import qualified AST.Optimized as Opt
16hasDebugUses :: Opt.LocalGraph -> Bool
17hasDebugUses (Opt.LocalGraph _ graph _) =
18 Map.any nodeHasDebug graph
21nodeHasDebug :: Opt.Node -> Bool
24 Opt.Define expr _ -> hasDebug expr
25 Opt.DefineTailFunc _ expr _ -> hasDebug expr
30 Opt.Cycle _ vs fs _ -> any (hasDebug . snd) vs || any defHasDebug fs
31 Opt.Manager _ -> False
32 Opt.Kernel _ _ -> False
33 Opt.PortIncoming expr _ -> hasDebug expr
34 Opt.PortOutgoing expr _ -> hasDebug expr
37hasDebug :: Opt.Expr -> Bool
45 Opt.VarLocal _ -> False
46 Opt.VarGlobal _ -> False
47 Opt.VarEnum _ _ -> False
49 Opt.VarCycle _ _ -> False
50 Opt.VarDebug _ _ _ _ -> True
51 Opt.VarKernel _ _ -> False
52 Opt.List exprs -> any hasDebug exprs
53 Opt.Function _ expr -> hasDebug expr
54 Opt.Call e es -> hasDebug e || any hasDebug es
55 Opt.TailCall _ args -> any (hasDebug . snd) args
56 Opt.If conds finally -> any (\(c,e) -> hasDebug c || hasDebug e) conds || hasDebug finally
57 Opt.Let def body -> defHasDebug def || hasDebug body
58 Opt.Destruct _ expr -> hasDebug expr
59 Opt.Case _ _ d jumps -> deciderHasDebug d || any (hasDebug . snd) jumps
60 Opt.Accessor _ -> False
61 Opt.Access r _ -> hasDebug r
62 Opt.Update r fs -> hasDebug r || any hasDebug fs
63 Opt.Record fs -> any hasDebug fs
65 Opt.Tuple a b c -> hasDebug a || hasDebug b || maybe False hasDebug c
66 Opt.Shader _ _ _ -> False
69defHasDebug :: Opt.Def -> Bool
72 Opt.Def _ expr -> hasDebug expr
73 Opt.TailDef _ _ expr -> hasDebug expr
76deciderHasDebug :: Opt.Decider Opt.Choice -> Bool
77deciderHasDebug decider =
79 Opt.Leaf (Opt.Inline expr) -> hasDebug expr
80 Opt.Leaf (Opt.Jump _) -> False
81 Opt.Chain _ success failure -> deciderHasDebug success || deciderHasDebug failure
82 Opt.FanOut _ tests fallback -> any (deciderHasDebug . snd) tests || deciderHasDebug fallback
86-- TODO: FIND GLOBALLY UNUSED DEFINITIONS?
87-- TODO: FIND PACKAGE USAGE STATS? (e.g. elm/core = 142, author/project = 2, etc.)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list