Function fnAttrs [src]

Prototype

pub fn fnAttrs(self: *Builder, fn_attributes: []const Attributes) Allocator.Error!FunctionAttributes

Parameters

self: *Builderfn_attributes: []const Attributes

Source

pub fn fnAttrs(self: *Builder, fn_attributes: []const Attributes) Allocator.Error!FunctionAttributes { try self.function_attributes_set.ensureUnusedCapacity(self.gpa, 1); const function_attributes: FunctionAttributes = @enumFromInt(try self.attrGeneric(@ptrCast( fn_attributes[0..if (std.mem.lastIndexOfNone(Attributes, fn_attributes, &.{.none})) |last| last + 1 else 0], ))); _ = self.function_attributes_set.getOrPutAssumeCapacity(function_attributes); return function_attributes; }