mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-17 08:21:25 -07:00
Merge pull request #3895 from laytan/fix-optimization-mode-attribute
remove misleading @(optimization_mode) values and make "none" inhibit optimizations
This commit is contained in:
@@ -2523,6 +2523,12 @@ gb_internal void lb_add_proc_attribute_at_index(lbProcedure *p, isize index, cha
|
||||
gb_internal void lb_add_attribute_to_proc(lbModule *m, LLVMValueRef proc_value, char const *name, u64 value=0) {
|
||||
LLVMAddAttributeAtIndex(proc_value, LLVMAttributeIndex_FunctionIndex, lb_create_enum_attribute(m->ctx, name, value));
|
||||
}
|
||||
|
||||
gb_internal bool lb_proc_has_attribute(lbModule *m, LLVMValueRef proc_value, char const *name) {
|
||||
LLVMAttributeRef ref = LLVMGetEnumAttributeAtIndex(proc_value, LLVMAttributeIndex_FunctionIndex, LLVMGetEnumAttributeKindForName(name, gb_strlen(name)));
|
||||
return ref != nullptr;
|
||||
}
|
||||
|
||||
gb_internal void lb_add_attribute_to_proc_with_string(lbModule *m, LLVMValueRef proc_value, String const &name, String const &value) {
|
||||
LLVMAttributeRef attr = lb_create_string_attribute(m->ctx, name, value);
|
||||
LLVMAddAttributeAtIndex(proc_value, LLVMAttributeIndex_FunctionIndex, attr);
|
||||
|
||||
Reference in New Issue
Block a user