all constants evaluation; constant autocompletion; constant name string baking fix

This commit is contained in:
Ryan Fleury
2025-05-29 17:50:35 -07:00
parent 6322427171
commit af4972a333
6 changed files with 53 additions and 35 deletions
+2 -1
View File
@@ -9960,7 +9960,7 @@ rd_set_autocomp_regs_(E_Eval dst_eval, RD_Regs *regs)
// rjf: calculate most general list expression, given the dst_eval space
B32 force_allow = 0;
B32 expr_based_replace = 1;
String8 list_expr = str8_lit("query:locals, query:globals, query:thread_locals, query:procedures, query:types");
String8 list_expr = str8_lit("query:locals, query:globals, query:thread_locals, query:procedures, query:types, query:constants");
{
E_TypeKey maybe_enum_type = e_type_key_unwrap(dst_eval.irtree.type_key, E_TypeUnwrapFlag_AllDecorative & ~E_TypeUnwrapFlag_Enums);
if(dst_eval.space.kind == RD_EvalSpaceKind_MetaCfg)
@@ -12169,6 +12169,7 @@ rd_frame(void)
{
str8_lit_comp("procedures"),
str8_lit_comp("thread_locals"),
str8_lit_comp("constants"),
str8_lit_comp("globals"),
str8_lit_comp("types"),
};
+8
View File
@@ -1553,6 +1553,7 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(debug_info_table)
else if(str8_match(lhs_type->name, str8_lit("procedures"), 0)) {section = RDI_SectionKind_Procedures;}
else if(str8_match(lhs_type->name, str8_lit("globals"), 0)) {section = RDI_SectionKind_GlobalVariables;}
else if(str8_match(lhs_type->name, str8_lit("thread_locals"), 0)) {section = RDI_SectionKind_ThreadVariables;}
else if(str8_match(lhs_type->name, str8_lit("constants"), 0)) {section = RDI_SectionKind_Constants;}
else if(str8_match(lhs_type->name, str8_lit("types"), 0)) {section = RDI_SectionKind_UDTs;}
}
@@ -1646,6 +1647,13 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(debug_info_table)
symbol_name.str = rdi_string_from_idx(module->rdi, tvar->name_string_idx, &symbol_name.size);
item_string = symbol_name;
}break;
case RDI_SectionKind_Constants:
{
RDI_Constant *cnst = rdi_element_from_name_idx(module->rdi, Constants, element_idx);
String8 symbol_name = {0};
symbol_name.str = rdi_string_from_idx(module->rdi, cnst->name_string_idx, &symbol_name.size);
item_string = symbol_name;
}break;
case RDI_SectionKind_UDTs:
{
RDI_UDT *udt = rdi_element_from_name_idx(module->rdi, UDTs, element_idx);