remove misleading @(optimization_mode) values and make "none" inhibit optimizations

This commit is contained in:
Laytan Laats
2024-07-08 21:06:57 +02:00
parent 498fb00c25
commit 1a20b78633
7 changed files with 19 additions and 34 deletions
+6
View File
@@ -2522,6 +2522,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);