aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorlachsinc <lachlansinclair@gmail.com>2018-10-01 00:17:42 +1000
committerlachsinc <lachlansinclair@gmail.com>2018-10-01 00:17:42 +1000
commitf8d7f422089edfb2f1bf532cfbfcaaccf4bfc14c (patch)
tree80ff2dbd553dae177ef26fedcfc03528fc01f476 /src/ir.cpp
parentdb0756a1190b694e46c733498480b071265a0baf (diff)
Minor cleanup.
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 5163a631e..e0d7229ee 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -503,7 +503,7 @@ enum irDebugEncoding {
irDebugBasicEncoding_unsigned = 6,
irDebugBasicEncoding_unsigned_char = 7,
- // NOTE(lachsinc): Should the following be renamed from basic -> tag to mirror their DW_TAG_*
+ // TODO(lachsinc): Should the following be renamed from basic -> tag to mirror their DW_TAG_*
// counterparts? Perhaps separate out if they truly have different meaning.
irDebugBasicEncoding_member = 13,
@@ -527,7 +527,6 @@ enum irDebugInfoKind {
irDebugInfo_AllProcs,
irDebugInfo_BasicType, // basic types
- irDebugInfo_ProcType,
irDebugInfo_DerivedType, // pointer, typedef
irDebugInfo_CompositeType, // array, struct, enum, (raw_)union
irDebugInfo_Enumerator, // For irDebugInfo_CompositeType if enum
@@ -579,7 +578,6 @@ struct irDebugInfo {
Array<irDebugInfo *> procs;
} AllProcs; // TODO(lachsinc): Redundant w/ DebugInfoArray. Merge.
- // NOTE(lachsinc): Many of the following fields could be removed/resolved as we print it?
struct {
String name;
i32 size;
@@ -587,10 +585,6 @@ struct irDebugInfo {
irDebugEncoding encoding;
} BasicType;
struct {
- irDebugInfo * return_type;
- Array<irDebugInfo *> param_types;
- } ProcType; // TODO(lachsinc): Unused?
- struct {
// TODO(lachsinc): Do derived types even need scope/file/line etc. info?
irDebugEncoding tag;
irDebugInfo * base_type;
@@ -641,7 +635,7 @@ struct irDebugInfo {
irDebugInfo *type;
} LocalVariable;
struct {
- Array<irDebugInfo *> elements; // TODO(lachsinc): Never cleaned up?
+ Array<irDebugInfo *> elements; // TODO(lachsinc): Leak?
} DebugInfoArray;
};
};
@@ -1439,9 +1433,6 @@ irValue *ir_add_local(irProcedure *proc, Entity *e, Ast *expr, bool zero_initial
ir_emit(proc, ir_instr_debug_declare(proc, expr, e, true, instr));
// TODO(lachsinc): "Arg" is not used yet but should be eventually, if applicable, set to param index
- // NOTE(lachsinc): The following call recurses through a type creating or finding the necessary debug info.
- // This approach may be quite detrimental to perf?
- // This may not be the most appropriate place to place this? (for proc non-value params etc.)
irDebugInfo *di = *map_get(&proc->module->debug_info, hash_entity(proc->entity)); // TODO(lachsinc): Cleanup; lookup di for proc inside ir_add_debug_info_local() ?
ir_add_debug_info_local(proc->module, e, 0, di, di->Proc.file);
ir_pop_debug_location(proc->module);
@@ -2235,7 +2226,7 @@ irDebugInfo *ir_add_debug_info_proc(irProcedure *proc, Entity *entity, String na
if (e->kind != Entity_Variable) {
continue; // TODO(lachsinc): Confirm correct?
}
-
+
irDebugInfo *type_di = ir_add_debug_info_type(proc->module, e->type, nullptr, nullptr, nullptr);
GB_ASSERT_NOT_NULL(type_di);
array_add(&di->Proc.types->DebugInfoArray.elements, type_di);