- step: Lean.Name → Array Lean.IR.Decl → Lean.IR.LogEntry
- message: Lean.Format → Lean.IR.LogEntry
Equations
- Lean.IR.LogEntry.fmt x = match x with | Lean.IR.LogEntry.step cls decls => Lean.Format.bracket "[" (Lean.format cls) "]" ++ Array.foldl (fun fmt decl => fmt ++ Lean.Format.line ++ Lean.format decl) Lean.Format.nil decls 0 (Array.size decls) | Lean.IR.LogEntry.message msg => msg
Equations
- Lean.IR.LogEntry.instToFormatLogEntry = { format := Lean.IR.LogEntry.fmt }
Equations
- Lean.IR.Log.format log = Array.foldl (fun fmt entry => Lean.format "" ++ Lean.format fmt ++ Lean.format "" ++ Lean.format Lean.Format.line ++ Lean.format "" ++ Lean.format entry ++ Lean.format "") Lean.Format.nil log 0 (Array.size log)
Equations
@[inline]
Equations
Equations
- Lean.IR.log entry = modify fun s => { env := s.env, log := Array.push s.log entry }
Equations
- Lean.IR.tracePrefixOptionName = `trace.compiler.ir
@[inline]
Equations
- Lean.IR.logDecls cls decl = Lean.IR.logDeclsAux (Lean.IR.tracePrefixOptionName ++ cls) cls decl
@[inline]
Equations
@[inline]
Equations
@[inline]
Equations
- Lean.IR.modifyEnv f = modify fun s => { env := f s.env, log := s.log }
@[inline]
Equations
Equations
Equations
- Lean.IR.findDecl n = do let a ← get pure (Lean.IR.findEnvDecl a.env n)
Equations
- Lean.IR.containsDecl n = do let a ← get pure (Lean.SMap.contains (Lean.SimplePersistentEnvExtension.getState Lean.IR.declMapExt a.env) n)
Equations
- Lean.IR.addDeclAux env decl = Lean.PersistentEnvExtension.addEntry Lean.IR.declMapExt env decl
Equations
Equations
- Lean.IR.getEnv = do let s ← get pure s.env
Equations
- Lean.IR.addDecl decl = Lean.IR.modifyEnv fun env => Lean.PersistentEnvExtension.addEntry Lean.IR.declMapExt env decl
Equations
- Lean.IR.addDecls decls = Array.forM Lean.IR.addDecl decls 0 (Array.size decls)
Equations
- Lean.IR.findEnvDecl' env n decls = match Array.find? decls fun decl => Lean.IR.Decl.name decl == n with | some decl => some decl | none => Lean.SMap.find? (Lean.SimplePersistentEnvExtension.getState Lean.IR.declMapExt env) n
Equations
- Lean.IR.findDecl' n decls = do let a ← get pure (Lean.IR.findEnvDecl' a.env n decls)
Equations
- Lean.IR.containsDecl' n decls = if Array.any decls (fun decl => Lean.IR.Decl.name decl == n) 0 (Array.size decls) = true then pure true else do let a ← get pure (Lean.SMap.contains (Lean.SimplePersistentEnvExtension.getState Lean.IR.declMapExt a.env) n)
Equations
- Lean.IR.getSorryDep env declName = match Lean.SMap.find? (Lean.SimplePersistentEnvExtension.getState Lean.IR.declMapExt env) declName with | some (Lean.IR.Decl.fdecl x x_1 x_2 x_3 { sorryDep? := dep? }) => dep? | x => none