pub struct FunctionInfo {Show 14 fields
pub params: ParamRange,
pub return_type: Type,
pub return_type_sym: Spur,
pub body: InstRef,
pub span: Span,
pub is_generic: bool,
pub is_pub: bool,
pub is_unchecked: bool,
pub file_id: FileId,
pub canonical_name: Option<Spur>,
pub link_library: Option<Spur>,
pub link_name: Option<Spur>,
pub is_extern: bool,
pub is_c_abi: bool,
}Expand description
Information about a function.
Fields§
§params: ParamRangeParameter data (names, types, modes, comptime flags) stored in arena.
Access via arena.names(params), arena.types(params), etc.
return_type: TypeReturn type
return_type_sym: SpurThe return type symbol (before resolution) - needed for generic function specialization
body: InstRefThe RIR instruction ref for the function body - needed for generic function specialization
span: SpanSpan of the function declaration
is_generic: boolWhether this function has any comptime type parameters
is_pub: boolWhether this function is public (visible outside its directory)
is_unchecked: boolWhether this function is marked unchecked (can only be called from checked blocks)
file_id: FileIdFile ID this function was declared in (for visibility checking)
canonical_name: Option<Spur>ADR-0078: when this entry is an item-level re-export alias
(pub const X = mod.Y), this is the canonical name Y of the
re-exported function. Call-site codegen uses this name so the
emitted Call instruction targets the original function symbol
(which is what’s actually defined in the binary). For
non-aliased entries this is None.
link_library: Option<Spur>ADR-0085: when this entry is a C extern (declared inside a
link_extern("…") { … } block), this is the library name. None
for regular Gruel fns and C exports.
link_name: Option<Spur>ADR-0085: when this entry is a C extern or @mark(c) fn export
and an explicit @link_name("…") directive overrides the
emitted symbol, this is the override. None means the symbol
equals the Gruel identifier.
is_extern: boolADR-0085: true iff this entry came from inside a link_extern
block — the body field is meaningless and codegen must emit a
declaration only.
is_c_abi: boolADR-0085: true iff the host is a top-level @mark(c) fn …{ … }
or an extern fn — both use the platform C calling convention
and suppress Gruel name mangling at the emitted symbol.
Trait Implementations§
Source§impl Clone for FunctionInfo
impl Clone for FunctionInfo
Source§fn clone(&self) -> FunctionInfo
fn clone(&self) -> FunctionInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FunctionInfo
impl Debug for FunctionInfo
impl Copy for FunctionInfo
Auto Trait Implementations§
impl Freeze for FunctionInfo
impl RefUnwindSafe for FunctionInfo
impl Send for FunctionInfo
impl Sync for FunctionInfo
impl Unpin for FunctionInfo
impl UnsafeUnpin for FunctionInfo
impl UnwindSafe for FunctionInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].