File: .lake/packages/lean4/src/lean/Lean/Compiler/InlineAttrs.lean

full_name: Lean.Compiler.InlineAttributeKind
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Type

full_name: Lean.Compiler.InlineAttributeKind.inline
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.instHashableInlineAttributeKind
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Hashable Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.InlineAttributeKind.macroInline
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.InlineAttributeKind.inlineIfReduce
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.InlineAttributeKind.noinline
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.instInhabitedInlineAttributeKind
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Inhabited Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.InlineAttributeKind.alwaysInline
code: inductive InlineAttributeKind where
  | inline | noinline | macroInline | inlineIfReduce | alwaysInline
  deriving Inhabited, BEq, Hashable
goal: Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.instBEqInlineAttributeKind
code: BEq
goal: BEq Lean.Compiler.InlineAttributeKind

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.InlineAttrs.0.Lean.Compiler.isValidMacroInline
code: /--
  This is an approximate test for testing whether `declName` can be annotated with the `[macro_inline]` attribute or not.
-/
private def isValidMacroInline (declName : Name) : CoreM Bool 
goal: Lean.CoreM Bool

full_name: Lean.Compiler.initFn._@..lake.packages.lean4.src.lean.Lean.Compiler.InlineAttrs._hyg.267
code: builtin_initialize inlineAttrs : EnumAttributes InlineAttributeKind ←
  registerEnumAttributes
    [(`inline, "mark definition to be inlined", .inline),
     (`inline_if_reduce, "mark definition to be inlined when resultant term after reduction is not a `cases_on` application", .inlineIfReduce),
     (`noinline, "mark definition to never be inlined", .noinline),
     (`macro_inline, "mark definition to always be inlined before ANF conversion", .macroInline),
     (`always_inline, "mark definition to be always inlined", .alwaysInline)]
    fun declName kind => do
      ofExcept <| checkIsDefinition (← getEnv) declName
      if kind matches .macroInline then
        unless (← isValidMacroInline declName) do
          throwError "invalid use of `[macro_inline]` attribute at `{declName}`, it is not supported in this kind of declaration, declaration must be a non-recursive definition"
goal: IO (Lean.EnumAttributes Lean.Compiler.InlineAttributeKind)

full_name: Lean.Compiler.inlineAttrs
code: builtin_initialize inlineAttrs : EnumAttributes InlineAttributeKind ←
  registerEnumAttributes
    [(`inline, "mark definition to be inlined", .inline),
     (`inline_if_reduce, "mark definition to be inlined when resultant term after reduction is not a `cases_on` application", .inlineIfReduce),
     (`noinline, "mark definition to never be inlined", .noinline),
     (`macro_inline, "mark definition to always be inlined before ANF conversion", .macroInline),
     (`always_inline, "mark definition to be always inlined", .alwaysInline)]
    fun declName kind => do
      ofExcept <| checkIsDefinition (← getEnv) declName
      if kind matches .macroInline then
        unless (← isValidMacroInline declName) do
          throwError "invalid use of `[macro_inline]` attribute at `{declName}`, it is not supported in this kind of declaration, declaration must be a non-recursive definition"
goal: Lean.EnumAttributes Lean.Compiler.InlineAttributeKind

full_name: Lean.Compiler.setInlineAttribute
code: def setInlineAttribute (env : Environment) (declName : Name) (kind : InlineAttributeKind) : Except String Environment 
goal: Except String Lean.Environment

full_name: Lean.Compiler.getInlineAttribute?
code: def getInlineAttribute? (env : Environment) (declName : Name) : Option InlineAttributeKind 
goal: Option Lean.Compiler.InlineAttributeKind

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.InlineAttrs.0.Lean.Compiler.hasInlineAttrCore
code: private def hasInlineAttrCore (env : Environment) (kind : InlineAttributeKind) (declName : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasInlineAttribute
code: abbrev hasInlineAttribute (env : Environment) (declName : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasInlineIfReduceAttribute
code: def hasInlineIfReduceAttribute (env : Environment) (declName : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasNoInlineAttribute
code: def hasNoInlineAttribute (env : Environment) (declName : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasMacroInlineAttribute
code: def hasMacroInlineAttribute (env : Environment) (declName : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasAlwaysInlineAttribute
code: abbrev hasAlwaysInlineAttribute (env : Environment) (declName : Name) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.InlineAttrs.0.Lean.Compiler.hasInlineAttrAux
code: private partial def hasInlineAttrAux (env : Environment) (kind : InlineAttributeKind) (n : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasInlineAttributeOld
code: @[export lean_has_inline_attribute]
def hasInlineAttributeOld (env : Environment) (n : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasInlineIfReduceAttributeOld
code: @[export lean_has_inline_if_reduce_attribute]
def hasInlineIfReduceAttributeOld (env : Environment) (n : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasNoInlineAttributeOld
code: @[export lean_has_noinline_attribute]
def hasNoInlineAttributeOld (env : Environment) (n : Name) : Bool 
goal: Bool

full_name: Lean.Compiler.hasMacroInlineAttributeOld
code: @[export lean_has_macro_inline_attribute]
def hasMacroInlineAttributeOld (env : Environment) (n : Name) : Bool 
goal: Bool