mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-23 06:05:00 -07:00
Add @(cold) attribute to procedure declarations
This commit is contained in:
@@ -2562,6 +2562,18 @@ DECL_ATTRIBUTE_PROC(proc_decl_attribute) {
|
||||
error(elem, "Expected a boolean value for '%.*s'", LIT(name));
|
||||
}
|
||||
return true;
|
||||
} else if (name == "cold") {
|
||||
if (value == nullptr) {
|
||||
ac->set_cold = true;
|
||||
} else {
|
||||
ExactValue ev = check_decl_attribute_value(c, value);
|
||||
if (ev.kind == ExactValue_Bool) {
|
||||
ac->set_cold = ev.value_bool;
|
||||
} else {
|
||||
error(elem, "Expected a boolean value for '%.*s' or no value whatsoever", LIT(name));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user