chore: remove VarInfo defaults in IR RC pass (#9167)
These defaults don't make the code easier to understand.
This commit is contained in:
parent
01d32aa408
commit
174b1301d8
1 changed files with 4 additions and 4 deletions
|
|
@ -16,9 +16,9 @@ that introduce the instructions `release` and `set`
|
|||
-/
|
||||
|
||||
structure VarInfo where
|
||||
ref : Bool := true -- true if the variable may be a reference (aka pointer) at runtime
|
||||
persistent : Bool := false -- true if the variable is statically known to be marked a Persistent at runtime
|
||||
consume : Bool := false -- true if the variable RC must be "consumed"
|
||||
ref : Bool -- true if the variable may be a reference (aka pointer) at runtime
|
||||
persistent : Bool -- true if the variable is statically known to be marked a Persistent at runtime
|
||||
consume : Bool -- true if the variable RC must be "consumed"
|
||||
deriving Inhabited
|
||||
|
||||
abbrev VarMap := RBMap VarId VarInfo (fun x y => compare x.idx y.idx)
|
||||
|
|
@ -207,7 +207,7 @@ private def processVDecl (ctx : Context) (z : VarId) (t : IRType) (v : Expr) (b
|
|||
|
||||
def updateVarInfoWithParams (ctx : Context) (ps : Array Param) : Context :=
|
||||
let m := ps.foldl (init := ctx.varMap) fun m p =>
|
||||
m.insert p.x { ref := p.ty.isObj, consume := !p.borrow }
|
||||
m.insert p.x { ref := p.ty.isObj, persistent := false, consume := !p.borrow }
|
||||
{ ctx with varMap := m }
|
||||
|
||||
partial def visitFnBody : FnBody → Context → (FnBody × LiveVarSet)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue