Skip to content

Commit

Permalink
Remove CpsDeadCodeAnalysis.emptyUsage
Browse files Browse the repository at this point in the history
  • Loading branch information
minoki committed May 28, 2024
1 parent 32330c9 commit 579416c
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/cps.sml
Original file line number Diff line number Diff line change
Expand Up @@ -594,15 +594,13 @@ end;

structure CpsDeadCodeAnalysis :> sig
type usage
val emptyUsage : usage
val analyze : CSyntax.CExp -> usage
val isUsed : usage * TypedSyntax.VId -> bool
end = struct
local structure C = CSyntax
in
type graph = TypedSyntax.VIdSet.set TypedSyntax.VIdTable.hash_table
type usage = bool TypedSyntax.VIdTable.hash_table
val emptyUsage = TypedSyntax.VIdTable.mkTable (0, Fail "")
fun addValue (C.Var v, set) = TypedSyntax.VIdSet.add (set, v)
| addValue (C.Unit, set) = set
| addValue (C.Nil, set) = set
Expand Down Expand Up @@ -679,8 +677,6 @@ structure CpsUsageAnalysis :> sig
val neverUsedCont : cont_usage
type usage_table
type cont_usage_table
val emptyUsageTable : usage_table
val emptyContUsageTable : cont_usage_table
val getValueUsage : usage_table * TypedSyntax.VId -> usage
val getContUsage : cont_usage_table * CSyntax.CVar -> cont_usage
val analyze : CSyntax.CExp -> { usage : usage_table
Expand Down Expand Up @@ -716,8 +712,6 @@ val neverUsed : usage = { call = NEVER
val neverUsedCont : cont_usage = { direct = NEVER, indirect = NEVER }
type usage_table = (usage ref) TypedSyntax.VIdTable.hash_table
type cont_usage_table = (cont_usage ref) CSyntax.CVarTable.hash_table
val emptyUsageTable = TypedSyntax.VIdTable.mkTable (0, Fail "")
val emptyContUsageTable = CSyntax.CVarTable.mkTable (0, Fail "")
fun getValueUsage (table : usage_table, v)
= case TypedSyntax.VIdTable.find table v of
SOME r => !r
Expand Down

0 comments on commit 579416c

Please sign in to comment.