zeroext = 34signext = 24inreg = 5byval = 3byref = 69preallocated = 65inalloca = 38sret = 29elementtype = 77@"align" = 1@"noalias" = 9nocapture = 11nofree = 62nest = 8returned = 22nonnull = 39dereferenceable = 41dereferenceable_or_null = 42swiftself = 46swiftasync = 75swifterror = 47immarg = 60noundef = 68nofpclass = 87alignstack = 25allocalign = 80allocptr = 81readnone = 20readonly = 21writeonly = 52allockind = 82allocsize = 51alwaysinline = 2builtin = 35cold = 36convergent = 43disable_sanitizer_information = 78fn_ret_thunk_extern = 84hot = 72inlinehint = 4jumptable = 40memory = 86minsize = 6naked = 7nobuiltin = 10nocallback = 71noduplicate = 12noimplicitfloat = 13@"noinline" = 14nomerge = 66nonlazybind = 15noprofile = 73skipprofile = 85noredzone = 16noreturn = 17norecurse = 48willreturn = 61nosync = 63nounwind = 18nosanitize_bounds = 79nosanitize_coverage = 76null_pointer_is_valid = 67optforfuzzing = 57optnone = 37optsize = 19returns_twice = 23safestack = 44sanitize_address = 30sanitize_memory = 32sanitize_thread = 31sanitize_hwaddress = 55sanitize_memtag = 64speculative_load_hardening = 59speculatable = 53ssp = 26sspstrong = 28sspreq = 27strictfp = 54uwtable = 33nocf_check = 56shadowcallstack = 58mustprogress = 70vscale_range = 74no_sanitize_address = 100no_sanitize_hwaddress = 101sanitize_address_dyninit = 102_pub const Kind = enum(u32) {
// Parameter Attributes
zeroext = 34,
signext = 24,
inreg = 5,
byval = 3,
byref = 69,
preallocated = 65,
inalloca = 38,
sret = 29, // TODO: ?
elementtype = 77,
@"align" = 1,
@"noalias" = 9,
nocapture = 11,
nofree = 62,
nest = 8,
returned = 22,
nonnull = 39,
dereferenceable = 41,
dereferenceable_or_null = 42,
swiftself = 46,
swiftasync = 75,
swifterror = 47,
immarg = 60,
noundef = 68,
nofpclass = 87,
alignstack = 25,
allocalign = 80,
allocptr = 81,
readnone = 20,
readonly = 21,
writeonly = 52,
// Function Attributes
//alignstack,
allockind = 82,
allocsize = 51,
alwaysinline = 2,
builtin = 35,
cold = 36,
convergent = 43,
disable_sanitizer_information = 78,
fn_ret_thunk_extern = 84,
hot = 72,
inlinehint = 4,
jumptable = 40,
memory = 86,
minsize = 6,
naked = 7,
nobuiltin = 10,
nocallback = 71,
noduplicate = 12,
//nofree,
noimplicitfloat = 13,
@"noinline" = 14,
nomerge = 66,
nonlazybind = 15,
noprofile = 73,
skipprofile = 85,
noredzone = 16,
noreturn = 17,
norecurse = 48,
willreturn = 61,
nosync = 63,
nounwind = 18,
nosanitize_bounds = 79,
nosanitize_coverage = 76,
null_pointer_is_valid = 67,
optforfuzzing = 57,
optnone = 37,
optsize = 19,
//preallocated,
returns_twice = 23,
safestack = 44,
sanitize_address = 30,
sanitize_memory = 32,
sanitize_thread = 31,
sanitize_hwaddress = 55,
sanitize_memtag = 64,
speculative_load_hardening = 59,
speculatable = 53,
ssp = 26,
sspstrong = 28,
sspreq = 27,
strictfp = 54,
uwtable = 33,
nocf_check = 56,
shadowcallstack = 58,
mustprogress = 70,
vscale_range = 74,
// Global Attributes
no_sanitize_address = 100,
no_sanitize_hwaddress = 101,
//sanitize_memtag,
sanitize_address_dyninit = 102,
string = std.math.maxInt(u31),
none = std.math.maxInt(u32),
_,
pub const len = @typeInfo(Kind).@"enum".fields.len - 2;
pub fn fromString(str: String) Kind {
assert(!str.isAnon());
const kind: Kind = @enumFromInt(@intFromEnum(str));
assert(kind != .none);
return kind;
}
fn toString(self: Kind) ?String {
assert(self != .none);
const str: String = @enumFromInt(@intFromEnum(self));
return if (str.isAnon()) null else str;
}
}