Equations
- Lean.IR.isTailCallTo g b = match b with | Lean.IR.FnBody.vdecl x x_1 (Lean.IR.Expr.fap f x_2) (Lean.IR.FnBody.ret (Lean.IR.Arg.var y)) => x == y && f == g | x => false
Equations
- Lean.IR.usesModuleFrom env modulePrefix = List.any (Array.toList (Lean.Environment.allImportedModuleNames env)) fun modName => Lean.Name.isPrefixOf modulePrefix modName
@[inline]
Equations
@[inline]
Equations
- Lean.IR.CollectUsedDecls.collect f = modify fun s => Lean.NameSet.insert s f
Equations
- Lean.IR.CollectUsedDecls.collectInitDecl fn = do let env ← read match Lean.getInitFnNameFor? env fn with | some initFn => Lean.IR.CollectUsedDecls.collect initFn | x => pure ()
Equations
- Lean.IR.CollectUsedDecls.collectDecl x = match x with | Lean.IR.Decl.fdecl f x x_1 b x_2 => SeqRight.seqRight (SeqRight.seqRight (Lean.IR.CollectUsedDecls.collectInitDecl f) fun x => Lean.IR.CollectUsedDecls.collectFnBody b) fun x => get | Lean.IR.Decl.extern f x x_1 x_2 => SeqRight.seqRight (Lean.IR.CollectUsedDecls.collectInitDecl f) fun x => get
def
Lean.IR.collectUsedDecls
(env : Lean.Environment)
(decl : Lean.IR.Decl)
(used : optParam Lean.NameSet ∅)
:
Equations
- Lean.IR.collectUsedDecls env decl used = StateT.run' (Lean.IR.CollectUsedDecls.collectDecl decl env) used
@[inline]
@[inline]
Equations
@[inline]
@[inline]
Equations
- Lean.IR.CollectMaps.collectVar x t x = match x with | (vs, js) => (Std.HashMap.insert vs x t, js)
Equations
- Lean.IR.CollectMaps.collectParams ps s = Array.foldl (fun s p => Lean.IR.CollectMaps.collectVar p.x p.ty s) s ps 0 (Array.size ps)
@[inline]
Equations
- Lean.IR.CollectMaps.collectJP j xs x = match x with | (vs, js) => (vs, Std.HashMap.insert js j xs)
Equations
- Lean.IR.CollectMaps.collectDecl x = match x with | Lean.IR.Decl.fdecl x xs x_1 b x_2 => Lean.IR.CollectMaps.collectParams xs ∘ Lean.IR.CollectMaps.collectFnBody b | x => id