- env : Lean.Environment
- modName : Lean.Name
- jpMap : Lean.IR.JPParamsMap
- mainFn : Lean.IR.FunId
- mainParams : Array Lean.IR.Param
Instances For
@[reducible, inline]
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Instances For
@[inline]
Equations
- Lean.IR.EmitC.emitLn a = do Lean.IR.EmitC.emit a Lean.IR.EmitC.emit "\n"
Instances For
Instances For
Equations
- Lean.IR.EmitC.argToCString (Lean.IR.Arg.var x_2) = toString x_2
- Lean.IR.EmitC.argToCString x = "lean_box(0)"
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Equations
- Lean.IR.EmitC.emitExternDeclAux decl cNameStr = do let env ← Lean.IR.EmitC.getEnv let extC : Bool := Lean.isExternC env decl.name Lean.IR.EmitC.emitFnDeclAux decl cNameStr extC
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.IR.EmitC.hasMainFn = do let env ← Lean.IR.EmitC.getEnv let decls : List Lean.IR.Decl := Lean.IR.getDecls env pure (decls.any fun (d : Lean.IR.Decl) => d.name == `main)
Instances For
Equations
- Lean.IR.EmitC.emitMainFnIfNeeded = do let __do_lift ← Lean.IR.EmitC.hasMainFn if __do_lift = true then Lean.IR.EmitC.emitMainFn else pure PUnit.unit
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Instances For
Equations
- Lean.IR.EmitC.declareParams ps = Array.forM (fun (p : Lean.IR.Param) => Lean.IR.EmitC.declareVar p.x p.ty) ps
Instances For
Equations
- Lean.IR.EmitC.emitTag x xType = if xType.isObj = true then do Lean.IR.EmitC.emit "lean_obj_tag(" Lean.IR.EmitC.emit x Lean.IR.EmitC.emit ")" else Lean.IR.EmitC.emit x
Instances For
Equations
- Lean.IR.EmitC.isIf alts = if h : alts.size ≠ 2 then none else match alts[0] with | Lean.IR.AltCore.ctor c b => some (c.cidx, b, Lean.IR.AltCore.body alts[1]) | x => none
Instances For
Instances For
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.IR.EmitC.emitSSet
(x : Lean.IR.VarId)
(n offset : Nat)
(y : Lean.IR.VarId)
(t : Lean.IR.IRType)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.IR.EmitC.emitReuse
(z x : Lean.IR.VarId)
(c : Lean.IR.CtorInfo)
(updtHeader : Bool)
(ys : Array Lean.IR.Arg)
:
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.IR.EmitC.emitSProj
(z : Lean.IR.VarId)
(t : Lean.IR.IRType)
(n offset : Nat)
(x : Lean.IR.VarId)
:
Instances For
Equations
- Lean.IR.EmitC.toStringArgs ys = List.map Lean.IR.EmitC.argToCString ys.toList
Instances For
def
Lean.IR.EmitC.emitSimpleExternalCall
(f : String)
(ps : Array Lean.IR.Param)
(ys : Array Lean.IR.Arg)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.IR.EmitC.emitExternCall
(f : Lean.IR.FunId)
(ps : Array Lean.IR.Param)
(extData : Lean.ExternAttrData)
(ys : Array Lean.IR.Arg)
:
Instances For
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.IR.EmitC.emitBox z x xType = do Lean.IR.EmitC.emitLhs z Lean.IR.EmitC.emitBoxFn xType Lean.IR.EmitC.emit "(" Lean.IR.EmitC.emit x Lean.IR.EmitC.emitLn ");"
Instances For
Instances For
Equations
- Lean.IR.EmitC.toHexDigit c = String.singleton c.digitChar
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.ctor c ys) = Lean.IR.EmitC.emitCtor z c ys
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.reset n x) = Lean.IR.EmitC.emitReset z n x
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.reuse x c u ys) = Lean.IR.EmitC.emitReuse z x c u ys
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.proj i x) = Lean.IR.EmitC.emitProj z i x
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.uproj i x) = Lean.IR.EmitC.emitUProj z i x
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.sproj n o x) = Lean.IR.EmitC.emitSProj z t n o x
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.fap c ys) = Lean.IR.EmitC.emitFullApp z c ys
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.pap c ys) = Lean.IR.EmitC.emitPartialApp z c ys
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.ap x ys) = Lean.IR.EmitC.emitApp z x ys
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.box t_1 x) = Lean.IR.EmitC.emitBox z x t_1
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.unbox x) = Lean.IR.EmitC.emitUnbox z t x
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.isShared x) = Lean.IR.EmitC.emitIsShared z x
- Lean.IR.EmitC.emitVDecl z t (Lean.IR.Expr.lit v_2) = Lean.IR.EmitC.emitLit z t v_2
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given [p_0, ..., p_{n-1}]
, [y_0, ..., y_{n-1}]
, representing the assignments
p_0 := y_0,
...
p_{n-1} := y_{n-1}
Return true iff we have (i, j)
where j > i
, and y_j == p_i
.
That is, we have
p_i := y_i,
...
p_j := p_i, -- p_i was overwritten above
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.IR.EmitC.emitTailCall v = throw "bug at emitTailCall"
Instances For
partial def
Lean.IR.EmitC.emitIf
(x : Lean.IR.VarId)
(xType : Lean.IR.IRType)
(tag : Nat)
(t e : Lean.IR.FnBody)
:
partial def
Lean.IR.EmitC.emitCase
(x : Lean.IR.VarId)
(xType : Lean.IR.IRType)
(alts : Array Lean.IR.Alt)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.IR.EmitC.emitFns = do let env ← Lean.IR.EmitC.getEnv let decls : List Lean.IR.Decl := Lean.IR.getDecls env decls.reverse.forM Lean.IR.EmitC.emitDecl
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[export lean_ir_emit_c]
Equations
- One or more equations did not get rendered due to their size.