mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-28 08:33:21 -08:00
adjust rdi make to keep per-unit info organization - flatten / join in baker, to ensure unit-sorted order
This commit is contained in:
1 parent
b7644a1d34
commit
57e4b69e64
4 files changed
+181
-217
No files matched your search
@@ -51,6 +51,23 @@ rdim_memcpy_struct(dst, to_push); \
|
||||
} \
|
||||
rdim_memzero_struct(to_push);
|
||||
|
||||
#define RDIM_IdxedChunkListShallowCopy(list_type, chunk_type, src, ...) \
|
||||
list_type dst = {0};\
|
||||
RDI_U64 base_idx = 0;\
|
||||
for(chunk_type *src_n = src->first; src_n != 0; src_n = src_n->next)\
|
||||
{\
|
||||
chunk_type *dst_n = rdim_push_array(arena, chunk_type, 1);\
|
||||
RDIM_SLLQueuePush(dst.first, dst.last, dst_n);\
|
||||
dst.total_count += src_n->count;\
|
||||
dst.chunk_count += 1;\
|
||||
dst_n->count = src_n->count;\
|
||||
dst_n->cap = dst_n->count;\
|
||||
dst_n->base_idx = base_idx;\
|
||||
dst_n->v = src_n->v;\
|
||||
base_idx += dst_n->count;\
|
||||
}\
|
||||
return dst;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Basic Helpers
|
||||
|
||||
@@ -943,6 +960,12 @@ rdim_symbol_chunk_list_concat_in_place(RDIM_SymbolChunkList *dst, RDIM_SymbolChu
|
||||
RDIM_IdxedChunkListConcatInPlace(RDIM_SymbolChunkNode, dst, to_push);
|
||||
}
|
||||
|
||||
RDI_PROC RDIM_SymbolChunkList
|
||||
rdim_symbol_chunk_list_shallow_copy(RDIM_Arena *arena, RDIM_SymbolChunkList *src)
|
||||
{
|
||||
RDIM_IdxedChunkListShallowCopy(RDIM_SymbolChunkList, RDIM_SymbolChunkNode, src);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Inline Site Info Building
|
||||
|
||||
@@ -1223,12 +1246,6 @@ rdim_bake_params_concat_in_place(RDIM_BakeParams *dst, RDIM_BakeParams *src)
|
||||
rdim_udt_chunk_list_concat_in_place(&dst->udts, &src->udts);
|
||||
rdim_src_file_chunk_list_concat_in_place(&dst->src_files, &src->src_files);
|
||||
rdim_line_table_chunk_list_concat_in_place(&dst->line_tables, &src->line_tables);
|
||||
rdim_symbol_chunk_list_concat_in_place(&dst->global_variables, &src->global_variables);
|
||||
rdim_symbol_chunk_list_concat_in_place(&dst->thread_variables, &src->thread_variables);
|
||||
rdim_symbol_chunk_list_concat_in_place(&dst->constants, &src->constants);
|
||||
rdim_symbol_chunk_list_concat_in_place(&dst->procedures, &src->procedures);
|
||||
rdim_scope_chunk_list_concat_in_place(&dst->scopes, &src->scopes);
|
||||
rdim_inline_site_chunk_list_concat_in_place(&dst->inline_sites, &src->inline_sites);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+44
-43
@@ -628,43 +628,6 @@ struct RDIM_LineTableChunkList
|
||||
RDI_U64 total_col_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Per-Compilation-Unit Info Types
|
||||
|
||||
typedef struct RDIM_Unit RDIM_Unit;
|
||||
struct RDIM_Unit
|
||||
{
|
||||
struct RDIM_UnitChunkNode *chunk;
|
||||
RDIM_String8 unit_name;
|
||||
RDIM_String8 compiler_name;
|
||||
RDIM_String8 source_file;
|
||||
RDIM_String8 object_file;
|
||||
RDIM_String8 archive_file;
|
||||
RDIM_String8 build_path;
|
||||
RDI_Language language;
|
||||
RDIM_LineTable *line_table;
|
||||
RDIM_Rng1U64ChunkList voff_ranges;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UnitChunkNode RDIM_UnitChunkNode;
|
||||
struct RDIM_UnitChunkNode
|
||||
{
|
||||
RDIM_UnitChunkNode *next;
|
||||
RDIM_Unit *v;
|
||||
RDI_U64 count;
|
||||
RDI_U64 cap;
|
||||
RDI_U64 base_idx;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UnitChunkList RDIM_UnitChunkList;
|
||||
struct RDIM_UnitChunkList
|
||||
{
|
||||
RDIM_UnitChunkNode *first;
|
||||
RDIM_UnitChunkNode *last;
|
||||
RDI_U64 chunk_count;
|
||||
RDI_U64 total_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Namespace Types
|
||||
|
||||
@@ -999,6 +962,49 @@ struct RDIM_ScopeChunkList
|
||||
RDI_U64 local_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Per-Compilation-Unit Info Types
|
||||
|
||||
typedef struct RDIM_Unit RDIM_Unit;
|
||||
struct RDIM_Unit
|
||||
{
|
||||
struct RDIM_UnitChunkNode *chunk;
|
||||
RDIM_String8 unit_name;
|
||||
RDIM_String8 compiler_name;
|
||||
RDIM_String8 source_file;
|
||||
RDIM_String8 object_file;
|
||||
RDIM_String8 archive_file;
|
||||
RDIM_String8 build_path;
|
||||
RDI_Language language;
|
||||
RDIM_LineTable *line_table;
|
||||
RDIM_Rng1U64ChunkList voff_ranges;
|
||||
RDIM_SymbolChunkList global_variables;
|
||||
RDIM_SymbolChunkList thread_variables;
|
||||
RDIM_SymbolChunkList constants;
|
||||
RDIM_SymbolChunkList procedures;
|
||||
RDIM_ScopeChunkList scopes;
|
||||
RDIM_InlineSiteChunkList inline_sites;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UnitChunkNode RDIM_UnitChunkNode;
|
||||
struct RDIM_UnitChunkNode
|
||||
{
|
||||
RDIM_UnitChunkNode *next;
|
||||
RDIM_Unit *v;
|
||||
RDI_U64 count;
|
||||
RDI_U64 cap;
|
||||
RDI_U64 base_idx;
|
||||
};
|
||||
|
||||
typedef struct RDIM_UnitChunkList RDIM_UnitChunkList;
|
||||
struct RDIM_UnitChunkList
|
||||
{
|
||||
RDIM_UnitChunkNode *first;
|
||||
RDIM_UnitChunkNode *last;
|
||||
RDI_U64 chunk_count;
|
||||
RDI_U64 total_count;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Baking Types
|
||||
|
||||
@@ -1016,12 +1022,6 @@ struct RDIM_BakeParams
|
||||
RDIM_UDTChunkList udts;
|
||||
RDIM_SrcFileChunkList src_files;
|
||||
RDIM_LineTableChunkList line_tables;
|
||||
RDIM_SymbolChunkList global_variables;
|
||||
RDIM_SymbolChunkList thread_variables;
|
||||
RDIM_SymbolChunkList constants;
|
||||
RDIM_SymbolChunkList procedures;
|
||||
RDIM_ScopeChunkList scopes;
|
||||
RDIM_InlineSiteChunkList inline_sites;
|
||||
};
|
||||
|
||||
//- rjf: data sections
|
||||
@@ -1475,6 +1475,7 @@ RDI_PROC RDIM_UDTEnumVal *rdim_udt_push_enum_val(RDIM_Arena *arena, RDIM_UDTChun
|
||||
RDI_PROC RDIM_Symbol *rdim_symbol_chunk_list_push(RDIM_Arena *arena, RDIM_SymbolChunkList *list, RDI_U64 cap);
|
||||
RDI_PROC RDI_U64 rdim_idx_from_symbol(RDIM_Symbol *symbol);
|
||||
RDI_PROC void rdim_symbol_chunk_list_concat_in_place(RDIM_SymbolChunkList *dst, RDIM_SymbolChunkList *to_push);
|
||||
RDI_PROC RDIM_SymbolChunkList rdim_symbol_chunk_list_shallow_copy(RDIM_Arena *arena, RDIM_SymbolChunkList *src);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: [Building] Inline Site Info Building
|
||||
|
||||
Reference in new issue
Block a user