- env : Lean.Environment
- modName : Lean.Name
- jpMap : Lean.IR.JPParamsMap
- mainFn : Lean.IR.FunId
- mainParams : Array Lean.IR.Param
@[inline]
Equations
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.IR.EmitC.emit a = modify fun out => out ++ toString a
@[inline]
Equations
- Lean.IR.EmitC.emitLn a = do Lean.IR.EmitC.emit a Lean.IR.EmitC.emit "\n"
Equations
- Lean.IR.EmitC.emitLns as = List.forM as fun a => Lean.IR.EmitC.emitLn a
Equations
- Lean.IR.EmitC.argToCString x = match x with | Lean.IR.Arg.var x => toString x | x => "lean_box(0)"
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitCName n = Lean.IR.EmitC.toCName n >>= Lean.IR.EmitC.emit
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitCInitName n = Lean.IR.EmitC.toCInitName n >>= Lean.IR.EmitC.emit
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitFnDecl decl isExternal = do let cppBaseName ← Lean.IR.EmitC.toCName (Lean.IR.Decl.name decl) Lean.IR.EmitC.emitFnDeclAux decl cppBaseName isExternal
Equations
- Lean.IR.EmitC.emitExternDeclAux decl cNameStr = do let env ← Lean.IR.EmitC.getEnv let extC : Bool := Lean.isExternC env (Lean.IR.Decl.name decl) Lean.IR.EmitC.emitFnDeclAux decl cNameStr extC
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.hasMainFn = do let env ← Lean.IR.EmitC.getEnv let decls : List Lean.IR.Decl := Lean.IR.getDecls env pure (List.any decls fun d => Lean.IR.Decl.name d == `main)
Equations
- Lean.IR.EmitC.emitMainFnIfNeeded = do let a ← Lean.IR.EmitC.hasMainFn if a = true then Lean.IR.EmitC.emitMainFn else pure PUnit.unit
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.getJPParams j = do let ctx ← read match Std.HashMap.find? ctx.jpMap j with | some ps => pure ps | none => throw "unknown join point"
Equations
- Lean.IR.EmitC.declareVar x t = do Lean.IR.EmitC.emit (Lean.IR.EmitC.toCType t) Lean.IR.EmitC.emit " " Lean.IR.EmitC.emit x Lean.IR.EmitC.emit " "
Equations
- Lean.IR.EmitC.declareParams ps = Array.forM (fun p => Lean.IR.EmitC.declareVar p.x p.ty) ps 0 (Array.size ps)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitDel x = do Lean.IR.EmitC.emit "lean_free_object(" Lean.IR.EmitC.emit x Lean.IR.EmitC.emitLn ");"
Equations
- Lean.IR.EmitC.emitSetTag x i = do Lean.IR.EmitC.emit "lean_ctor_set_tag(" Lean.IR.EmitC.emit x Lean.IR.EmitC.emit ", " Lean.IR.EmitC.emit i Lean.IR.EmitC.emitLn ");"
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.IR.EmitC.emitSSet
(x : Lean.IR.VarId)
(n : Nat)
(offset : Nat)
(y : Lean.IR.VarId)
(t : Lean.IR.IRType)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitLhs z = do Lean.IR.EmitC.emit z Lean.IR.EmitC.emit " = "
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.IR.EmitC.emitReuse
(z : Lean.IR.VarId)
(x : Lean.IR.VarId)
(c : Lean.IR.CtorInfo)
(updtHeader : Bool)
(ys : Array Lean.IR.Arg)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.IR.EmitC.emitSProj
(z : Lean.IR.VarId)
(t : Lean.IR.IRType)
(n : Nat)
(offset : Nat)
(x : Lean.IR.VarId)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
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.
def
Lean.IR.EmitC.emitExternCall
(f : Lean.IR.FunId)
(ps : Array Lean.IR.Param)
(extData : Lean.ExternAttrData)
(ys : Array Lean.IR.Arg)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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 ");"
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitIsTaggedPtr z x = do Lean.IR.EmitC.emitLhs z Lean.IR.EmitC.emit "!lean_is_scalar(" Lean.IR.EmitC.emit x Lean.IR.EmitC.emitLn ");"
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.paramEqArg p x = match x with | Lean.IR.Arg.var x => p.x == x | x => false
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
partial def
Lean.IR.EmitC.emitIf
(x : Lean.IR.VarId)
(xType : Lean.IR.IRType)
(tag : Nat)
(t : Lean.IR.FnBody)
(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.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.EmitC.emitFns = do let env ← Lean.IR.EmitC.getEnv let decls : List Lean.IR.Decl := Lean.IR.getDecls env List.forM (List.reverse decls) Lean.IR.EmitC.emitDecl
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
@[export lean_ir_emit_c]
Equations
- One or more equations did not get rendered due to their size.