raddbgi_from_pdb: path tree & string baking

This commit is contained in:
Ryan Fleury
2024-02-21 15:12:08 -08:00
parent f2cf518231
commit 2dd4526dd9
3 changed files with 121 additions and 87 deletions
+90 -56
View File
@@ -1590,22 +1590,22 @@ rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst, RDIM_BakeSecti
//- rjf: bake string map from params //- rjf: bake string map from params
RDI_PROC RDIM_BakeStringMap RDI_PROC RDIM_BakeStringMap *
rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params) rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params)
{ {
//- rjf: set up map //- rjf: set up map
RDIM_BakeStringMap strings = {0}; RDIM_BakeStringMap *strings = rdim_push_array(arena, RDIM_BakeStringMap, 1);
strings.slots_count = params->procedures.total_count*2 + params->global_variables.total_count*2 + params->thread_variables.total_count*2 + params->types.total_count*2; strings->slots_count = params->procedures.total_count*2 + params->global_variables.total_count*2 + params->thread_variables.total_count*2 + params->types.total_count*2;
strings.slots = rdim_push_array(arena, RDIM_BakeStringNode *, strings.slots_count); strings->slots = rdim_push_array(arena, RDIM_BakeStringNode *, strings->slots_count);
rdim_bake_string_map_insert(arena, &strings, rdim_str8_lit("")); rdim_bake_string_map_insert(arena, strings, rdim_str8_lit(""));
//- rjf: bake exe name //- rjf: bake exe name
rdim_bake_string_map_insert(arena, &strings, params->top_level_info.exe_name); rdim_bake_string_map_insert(arena, strings, params->top_level_info.exe_name);
//- rjf: bake binary section names //- rjf: bake binary section names
for(RDIM_BinarySectionNode *n = params->binary_sections.first; n != 0; n = n->next) for(RDIM_BinarySectionNode *n = params->binary_sections.first; n != 0; n = n->next)
{ {
rdim_bake_string_map_insert(arena, &strings, n->v.name); rdim_bake_string_map_insert(arena, strings, n->v.name);
} }
//- rjf: bake source file normalized full paths //- rjf: bake source file normalized full paths
@@ -1613,10 +1613,16 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
rdim_bake_string_map_insert(arena, &strings, n->v[idx].normal_full_path); rdim_bake_string_map_insert(arena, strings, n->v[idx].normal_full_path);
} }
} }
//- rjf: bake file path parts
for(RDIM_BakePathNode *n = path_tree->first; n != 0; n = n->next_order)
{
rdim_bake_string_map_insert(arena, strings, n->name);
}
//- rjf: bake unit strings //- rjf: bake unit strings
RDIM_ProfScope("bake unit strings") RDIM_ProfScope("bake unit strings")
{ {
@@ -1624,12 +1630,12 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
rdim_bake_string_map_insert(arena, &strings, n->v[idx].unit_name); rdim_bake_string_map_insert(arena, strings, n->v[idx].unit_name);
rdim_bake_string_map_insert(arena, &strings, n->v[idx].compiler_name); rdim_bake_string_map_insert(arena, strings, n->v[idx].compiler_name);
rdim_bake_string_map_insert(arena, &strings, n->v[idx].source_file); rdim_bake_string_map_insert(arena, strings, n->v[idx].source_file);
rdim_bake_string_map_insert(arena, &strings, n->v[idx].object_file); rdim_bake_string_map_insert(arena, strings, n->v[idx].object_file);
rdim_bake_string_map_insert(arena, &strings, n->v[idx].archive_file); rdim_bake_string_map_insert(arena, strings, n->v[idx].archive_file);
rdim_bake_string_map_insert(arena, &strings, n->v[idx].build_path); rdim_bake_string_map_insert(arena, strings, n->v[idx].build_path);
} }
} }
} }
@@ -1641,7 +1647,7 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
rdim_bake_string_map_insert(arena, &strings, n->v[idx].name); rdim_bake_string_map_insert(arena, strings, n->v[idx].name);
} }
} }
} }
@@ -1655,11 +1661,11 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDIM_UDTMember *mem = n->v[idx].first_member; mem != 0; mem = mem->next) for(RDIM_UDTMember *mem = n->v[idx].first_member; mem != 0; mem = mem->next)
{ {
rdim_bake_string_map_insert(arena, &strings, mem->name); rdim_bake_string_map_insert(arena, strings, mem->name);
} }
for(RDIM_UDTEnumVal *mem = n->v[idx].first_enum_val; mem != 0; mem = mem->next) for(RDIM_UDTEnumVal *mem = n->v[idx].first_enum_val; mem != 0; mem = mem->next)
{ {
rdim_bake_string_map_insert(arena, &strings, mem->name); rdim_bake_string_map_insert(arena, strings, mem->name);
} }
} }
} }
@@ -1672,7 +1678,7 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
rdim_bake_string_map_insert(arena, &strings, n->v[idx].normal_full_path); rdim_bake_string_map_insert(arena, strings, n->v[idx].normal_full_path);
} }
} }
} }
@@ -1692,8 +1698,8 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
rdim_bake_string_map_insert(arena, &strings, n->v[idx].name); rdim_bake_string_map_insert(arena, strings, n->v[idx].name);
rdim_bake_string_map_insert(arena, &strings, n->v[idx].link_name); rdim_bake_string_map_insert(arena, strings, n->v[idx].link_name);
} }
} }
} }
@@ -1708,7 +1714,7 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
for(RDIM_Local *local = n->v[idx].first_local; local != 0; local = local->next) for(RDIM_Local *local = n->v[idx].first_local; local != 0; local = local->next)
{ {
rdim_bake_string_map_insert(arena, &strings, local->name); rdim_bake_string_map_insert(arena, strings, local->name);
} }
} }
} }
@@ -1719,89 +1725,89 @@ rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
//- rjf: bake name map building //- rjf: bake name map building
RDI_PROC RDIM_BakeNameMap RDI_PROC RDIM_BakeNameMap *
rdim_bake_name_map_from_kind_params(RDIM_Arena *arena, RDI_NameMapKind kind, RDIM_BakeParams *params) rdim_bake_name_map_from_kind_params(RDIM_Arena *arena, RDI_NameMapKind kind, RDIM_BakeParams *params)
{ {
RDIM_BakeNameMap map = {0}; RDIM_BakeNameMap *map = rdim_push_array(arena, RDIM_BakeNameMap, 1);
switch(kind) switch(kind)
{ {
default:{}break; default:{}break;
case RDI_NameMapKind_GlobalVariables: case RDI_NameMapKind_GlobalVariables:
{ {
map.slots_count = params->global_variables.total_count*2; map->slots_count = params->global_variables.total_count*2;
map.slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map.slots_count); map->slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map->slots_count);
for(RDIM_SymbolChunkNode *n = params->global_variables.first; n != 0; n = n->next) for(RDIM_SymbolChunkNode *n = params->global_variables.first; n != 0; n = n->next)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32 RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32
rdim_bake_name_map_push(arena, &map, n->v[idx].name, symbol_idx); rdim_bake_name_map_push(arena, map, n->v[idx].name, symbol_idx);
} }
} }
}break; }break;
case RDI_NameMapKind_ThreadVariables: case RDI_NameMapKind_ThreadVariables:
{ {
map.slots_count = params->thread_variables.total_count*2; map->slots_count = params->thread_variables.total_count*2;
map.slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map.slots_count); map->slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map->slots_count);
for(RDIM_SymbolChunkNode *n = params->thread_variables.first; n != 0; n = n->next) for(RDIM_SymbolChunkNode *n = params->thread_variables.first; n != 0; n = n->next)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32 RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32
rdim_bake_name_map_push(arena, &map, n->v[idx].name, symbol_idx); rdim_bake_name_map_push(arena, map, n->v[idx].name, symbol_idx);
} }
} }
}break; }break;
case RDI_NameMapKind_Procedures: case RDI_NameMapKind_Procedures:
{ {
map.slots_count = params->procedures.total_count*2; map->slots_count = params->procedures.total_count*2;
map.slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map.slots_count); map->slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map->slots_count);
for(RDIM_SymbolChunkNode *n = params->procedures.first; n != 0; n = n->next) for(RDIM_SymbolChunkNode *n = params->procedures.first; n != 0; n = n->next)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32 RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32
rdim_bake_name_map_push(arena, &map, n->v[idx].name, symbol_idx); rdim_bake_name_map_push(arena, map, n->v[idx].name, symbol_idx);
} }
} }
}break; }break;
case RDI_NameMapKind_Types: case RDI_NameMapKind_Types:
{ {
map.slots_count = params->types.total_count; map->slots_count = params->types.total_count;
map.slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map.slots_count); map->slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map->slots_count);
for(RDIM_TypeChunkNode *n = params->types.first; n != 0; n = n->next) for(RDIM_TypeChunkNode *n = params->types.first; n != 0; n = n->next)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
RDI_U32 type_idx = (RDI_U32)rdim_idx_from_type(&n->v[idx]); // TODO(rjf): @u64_to_u32 RDI_U32 type_idx = (RDI_U32)rdim_idx_from_type(&n->v[idx]); // TODO(rjf): @u64_to_u32
rdim_bake_name_map_push(arena, &map, n->v[idx].name, type_idx); rdim_bake_name_map_push(arena, map, n->v[idx].name, type_idx);
} }
} }
}break; }break;
case RDI_NameMapKind_LinkNameProcedures: case RDI_NameMapKind_LinkNameProcedures:
{ {
map.slots_count = params->procedures.total_count*2; map->slots_count = params->procedures.total_count*2;
map.slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map.slots_count); map->slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map->slots_count);
for(RDIM_SymbolChunkNode *n = params->procedures.first; n != 0; n = n->next) for(RDIM_SymbolChunkNode *n = params->procedures.first; n != 0; n = n->next)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
if(n->v[idx].link_name.size == 0) {continue;} if(n->v[idx].link_name.size == 0) {continue;}
RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32 RDI_U32 symbol_idx = (RDI_U32)rdim_idx_from_symbol(&n->v[idx]); // TODO(rjf): @u64_to_u32
rdim_bake_name_map_push(arena, &map, n->v[idx].link_name, symbol_idx); rdim_bake_name_map_push(arena, map, n->v[idx].link_name, symbol_idx);
} }
} }
}break; }break;
case RDI_NameMapKind_NormalSourcePaths: case RDI_NameMapKind_NormalSourcePaths:
{ {
map.slots_count = params->src_files.total_count*2; map->slots_count = params->src_files.total_count*2;
map.slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map.slots_count); map->slots = rdim_push_array(arena, RDIM_BakeNameMapNode *, map->slots_count);
for(RDIM_SrcFileChunkNode *n = params->src_files.first; n != 0; n = n->next) for(RDIM_SrcFileChunkNode *n = params->src_files.first; n != 0; n = n->next)
{ {
for(RDI_U64 idx = 0; idx < n->count; idx += 1) for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{ {
RDI_U32 src_file_idx = (RDI_U32)rdim_idx_from_src_file(&n->v[idx]); // TODO(rjf): @u64_to_u32 RDI_U32 src_file_idx = (RDI_U32)rdim_idx_from_src_file(&n->v[idx]); // TODO(rjf): @u64_to_u32
rdim_bake_name_map_push(arena, &map, n->v[idx].normal_full_path, src_file_idx); rdim_bake_name_map_push(arena, map, n->v[idx].normal_full_path, src_file_idx);
} }
} }
}break; }break;
@@ -1811,27 +1817,55 @@ rdim_bake_name_map_from_kind_params(RDIM_Arena *arena, RDI_NameMapKind kind, RDI
//- rjf: idx run map building //- rjf: idx run map building
RDI_PROC RDIM_BakeIdxRunMap RDI_PROC RDIM_BakeIdxRunMap *
rdim_bake_idx_run_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params) rdim_bake_idx_run_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
//- rjf: set up map //- rjf: set up map
RDIM_BakeIdxRunMap idx_runs = {0}; RDIM_BakeIdxRunMap *idx_runs = rdim_push_array(arena, RDIM_BakeIdxRunMap, 1);
idx_runs.slots_count = params->procedures.total_count*2 + params->global_variables.total_count*2 + params->thread_variables.total_count*2 + params->types.total_count*2; idx_runs->slots_count = params->procedures.total_count*2 + params->global_variables.total_count*2 + params->thread_variables.total_count*2 + params->types.total_count*2;
idx_runs.slots = rdim_push_array(arena, RDIM_BakeIdxRunNode *, idx_runs.slots_count); idx_runs->slots = rdim_push_array(arena, RDIM_BakeIdxRunNode *, idx_runs->slots_count);
rdim_bake_idx_run_map_insert(arena, &idx_runs, 0, 0); rdim_bake_idx_run_map_insert(arena, idx_runs, 0, 0);
return idx_runs; return idx_runs;
} }
//- rjf: bake path tree building //- rjf: bake path tree building
RDI_PROC RDIM_BakePathTree RDI_PROC RDIM_BakePathTree *
rdim_bake_path_tree_from_params(RDIM_Arena *arena, RDIM_BakeParams *params) rdim_bake_path_tree_from_params(RDIM_Arena *arena, RDIM_BakeParams *params)
{ {
RDIM_BakePathTree tree = {0}; //- rjf: set up tree
rdim_bake_path_tree_insert(arena, &tree, rdim_str8_lit("<nil>")); RDIM_BakePathTree *tree = rdim_push_array(arena, RDIM_BakePathTree, 1);
rdim_bake_path_tree_insert(arena, tree, rdim_str8_lit("<nil>"));
//- rjf: bake unit file paths
RDIM_ProfScope("bake unit file paths")
{
for(RDIM_UnitChunkNode *n = params->units.first; n != 0; n = n->next)
{
for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{
rdim_bake_path_tree_insert(arena, tree, n->v[idx].source_file);
rdim_bake_path_tree_insert(arena, tree, n->v[idx].object_file);
rdim_bake_path_tree_insert(arena, tree, n->v[idx].archive_file);
rdim_bake_path_tree_insert(arena, tree, n->v[idx].build_path);
}
}
}
//- rjf: bake source file paths
RDIM_ProfScope("bake source file paths")
{
for(RDIM_SrcFileChunkNode *n = params->src_files.first; n != 0; n = n->next)
{
for(RDI_U64 idx = 0; idx < n->count; idx += 1)
{
RDIM_BakePathNode *node = rdim_bake_path_tree_insert(arena, tree, n->v[idx].normal_full_path);
node->src_file = &n->v[idx];
}
}
}
return tree; return tree;
} }
@@ -2869,7 +2903,7 @@ rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams
//- rjf: name maps //- rjf: name maps
RDI_PROC RDIM_BakeSectionList RDI_PROC RDIM_BakeSectionList
rdim_bake_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap name_maps[RDI_NameMapKind_COUNT]) rdim_bake_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT])
{ {
RDIM_BakeSectionList sections = {0}; RDIM_BakeSectionList sections = {0};
@@ -2879,7 +2913,7 @@ rdim_bake_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStr
k < RDI_NameMapKind_COUNT; k < RDI_NameMapKind_COUNT;
k = (RDI_NameMapKind)(k+1)) k = (RDI_NameMapKind)(k+1))
{ {
if(name_maps[k].name_count != 0) if(name_maps[k] != 0 && name_maps[k]->name_count != 0)
{ {
name_map_count += 1; name_map_count += 1;
} }
@@ -2894,8 +2928,8 @@ rdim_bake_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStr
k = (RDI_NameMapKind)(k+1)) k = (RDI_NameMapKind)(k+1))
{ {
RDI_NameMap *dst_map = &dst_maps[dst_map_idx]; RDI_NameMap *dst_map = &dst_maps[dst_map_idx];
RDIM_BakeNameMap *src_map = &name_maps[k]; RDIM_BakeNameMap *src_map = name_maps[k];
if(src_map->name_count == 0) { continue; } if(src_map == 0 || src_map->name_count == 0) { continue; }
// rjf: bake name map // rjf: bake name map
RDI_U32 baked_buckets_count = src_map->name_count; RDI_U32 baked_buckets_count = src_map->name_count;
+5 -5
View File
@@ -1169,16 +1169,16 @@ RDI_PROC void rdim_bake_section_list_concat_in_place(RDIM_BakeSectionList *dst,
//~ rjf: [Baking] Build Artifacts -> Interned/Deduplicated Data Structures //~ rjf: [Baking] Build Artifacts -> Interned/Deduplicated Data Structures
//- rjf: bake string map building //- rjf: bake string map building
RDI_PROC RDIM_BakeStringMap rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params); RDI_PROC RDIM_BakeStringMap *rdim_bake_string_map_from_params(RDIM_Arena *arena, RDIM_BakePathTree *path_tree, RDIM_BakeParams *params);
//- rjf: bake name map building //- rjf: bake name map building
RDI_PROC RDIM_BakeNameMap rdim_bake_name_map_from_kind_params(RDIM_Arena *arena, RDI_NameMapKind kind, RDIM_BakeParams *params); RDI_PROC RDIM_BakeNameMap *rdim_bake_name_map_from_kind_params(RDIM_Arena *arena, RDI_NameMapKind kind, RDIM_BakeParams *params);
//- rjf: bake idx run map building //- rjf: bake idx run map building
RDI_PROC RDIM_BakeIdxRunMap rdim_bake_idx_run_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params); RDI_PROC RDIM_BakeIdxRunMap *rdim_bake_idx_run_map_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
//- rjf: bake path tree building //- rjf: bake path tree building
RDI_PROC RDIM_BakePathTree rdim_bake_path_tree_from_params(RDIM_Arena *arena, RDIM_BakeParams *params); RDI_PROC RDIM_BakePathTree *rdim_bake_path_tree_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
//////////////////////////////// ////////////////////////////////
//~ rjf: [Baking] Build Artifacts -> Data Section Lists //~ rjf: [Baking] Build Artifacts -> Data Section Lists
@@ -1223,7 +1223,7 @@ RDI_PROC RDIM_BakeSectionList rdim_bake_scope_section_list_from_params(RDIM_Aren
RDI_PROC RDIM_BakeSectionList rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params); RDI_PROC RDIM_BakeSectionList rdim_bake_scope_vmap_section_list_from_params(RDIM_Arena *arena, RDIM_BakeParams *params);
//- rjf: name maps //- rjf: name maps
RDI_PROC RDIM_BakeSectionList rdim_bake_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap name_maps[RDI_NameMapKind_COUNT]); RDI_PROC RDIM_BakeSectionList rdim_bake_name_map_section_list_from_params_maps(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakeIdxRunMap *idx_runs, RDIM_BakeParams *params, RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT]);
//- rjf: file paths //- rjf: file paths
RDI_PROC RDIM_BakeSectionList rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree); RDI_PROC RDIM_BakeSectionList rdim_bake_file_path_section_list_from_path_tree(RDIM_Arena *arena, RDIM_BakeStringMap *strings, RDIM_BakePathTree *path_tree);
+26 -26
View File
@@ -3382,15 +3382,22 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
RDIM_BakeParams *params = &in->bake_params; RDIM_BakeParams *params = &in->bake_params;
RDIM_BakeSectionList sections = {0}; RDIM_BakeSectionList sections = {0};
//- rjf: build interned path tree
RDIM_BakePathTree *path_tree = 0;
ProfScope("build interned path tree")
{
path_tree = rdim_bake_path_tree_from_params(arena, params);
}
//- rjf: build interned string map //- rjf: build interned string map
RDIM_BakeStringMap strings = {0}; RDIM_BakeStringMap *strings = 0;
ProfScope("build interned string map") ProfScope("build interned string map")
{ {
strings = rdim_bake_string_map_from_params(arena, params); strings = rdim_bake_string_map_from_params(arena, path_tree, params);
} }
//- rjf: build name maps //- rjf: build name maps
RDIM_BakeNameMap name_maps[RDI_NameMapKind_COUNT] = {0}; RDIM_BakeNameMap *name_maps[RDI_NameMapKind_COUNT] = {0};
ProfScope("build name maps") ProfScope("build name maps")
{ {
for(RDI_NameMapKind k = (RDI_NameMapKind)(RDI_NameMapKind_NULL+1); for(RDI_NameMapKind k = (RDI_NameMapKind)(RDI_NameMapKind_NULL+1);
@@ -3404,28 +3411,21 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
//- rjf: top-level info //- rjf: top-level info
ProfScope("top level info") ProfScope("top level info")
{ {
RDIM_BakeSectionList s = rdim_bake_top_level_info_section_list_from_params(arena, &strings, params); RDIM_BakeSectionList s = rdim_bake_top_level_info_section_list_from_params(arena, strings, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: binary sections //- rjf: binary sections
ProfScope("binary sections") ProfScope("binary sections")
{ {
RDIM_BakeSectionList s = rdim_bake_binary_section_section_list_from_params(arena, &strings, params); RDIM_BakeSectionList s = rdim_bake_binary_section_section_list_from_params(arena, strings, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: build interned path tree
RDIM_BakePathTree path_tree = {0};
ProfScope("build interned path tree")
{
path_tree = rdim_bake_path_tree_from_params(arena, params);
}
//- rjf: units //- rjf: units
ProfScope("units") ProfScope("units")
{ {
RDIM_BakeSectionList s = rdim_bake_unit_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_unit_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
@@ -3439,12 +3439,12 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
//- rjf: source files //- rjf: source files
ProfScope("source files") ProfScope("source files")
{ {
RDIM_BakeSectionList s = rdim_bake_src_file_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_src_file_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: build interned idx run map //- rjf: build interned idx run map
RDIM_BakeIdxRunMap idx_runs = {0}; RDIM_BakeIdxRunMap *idx_runs = 0;
ProfScope("build interned idx run map") ProfScope("build interned idx run map")
{ {
idx_runs = rdim_bake_idx_run_map_from_params(arena, params); idx_runs = rdim_bake_idx_run_map_from_params(arena, params);
@@ -3453,49 +3453,49 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
//- rjf: type nodes //- rjf: type nodes
ProfScope("type nodes") ProfScope("type nodes")
{ {
RDIM_BakeSectionList s = rdim_bake_type_node_section_list_from_params(arena, &strings, &idx_runs, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_type_node_section_list_from_params(arena, strings, idx_runs, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: UDTs //- rjf: UDTs
ProfScope("UDTs") ProfScope("UDTs")
{ {
RDIM_BakeSectionList s = rdim_bake_udt_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_udt_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: global variables //- rjf: global variables
ProfScope("global variables") ProfScope("global variables")
{ {
RDIM_BakeSectionList s = rdim_bake_global_variable_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_global_variable_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: global vmap //- rjf: global vmap
ProfScope("global vmap") ProfScope("global vmap")
{ {
RDIM_BakeSectionList s = rdim_bake_global_vmap_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_global_vmap_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: thread variables //- rjf: thread variables
ProfScope("thread variables") ProfScope("thread variables")
{ {
RDIM_BakeSectionList s = rdim_bake_thread_variable_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_thread_variable_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: procedures //- rjf: procedures
ProfScope("procedures") ProfScope("procedures")
{ {
RDIM_BakeSectionList s = rdim_bake_procedure_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_procedure_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: scopes //- rjf: scopes
ProfScope("scopes") ProfScope("scopes")
{ {
RDIM_BakeSectionList s = rdim_bake_scope_section_list_from_params(arena, &strings, &path_tree, params); RDIM_BakeSectionList s = rdim_bake_scope_section_list_from_params(arena, strings, path_tree, params);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
@@ -3509,28 +3509,28 @@ p2r_bake(Arena *arena, P2R_Convert2Bake *in)
//- rjf: name maps //- rjf: name maps
ProfScope("name map") ProfScope("name map")
{ {
RDIM_BakeSectionList s = rdim_bake_name_map_section_list_from_params_maps(arena, &strings, &idx_runs, params, name_maps); RDIM_BakeSectionList s = rdim_bake_name_map_section_list_from_params_maps(arena, strings, idx_runs, params, name_maps);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: file paths //- rjf: file paths
ProfScope("file paths") ProfScope("file paths")
{ {
RDIM_BakeSectionList s = rdim_bake_file_path_section_list_from_path_tree(arena, &strings, &path_tree); RDIM_BakeSectionList s = rdim_bake_file_path_section_list_from_path_tree(arena, strings, path_tree);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: strings //- rjf: strings
ProfScope("strings") ProfScope("strings")
{ {
RDIM_BakeSectionList s = rdim_bake_string_section_list_from_string_map(arena, &strings); RDIM_BakeSectionList s = rdim_bake_string_section_list_from_string_map(arena, strings);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }
//- rjf: index runs //- rjf: index runs
ProfScope("idx runs") ProfScope("idx runs")
{ {
RDIM_BakeSectionList s = rdim_bake_idx_run_section_list_from_idx_run_map(arena, &idx_runs); RDIM_BakeSectionList s = rdim_bake_idx_run_section_list_from_idx_run_map(arena, idx_runs);
rdim_bake_section_list_concat_in_place(&sections, &s); rdim_bake_section_list_concat_in_place(&sections, &s);
} }