diff options
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index c86ce0ed10..588e831af6 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -744,6 +744,7 @@ static LLVMValueRef gen_cast_expr(CodeGen *g, AstNode *node) { case CastOpBoolToInt: assert(wanted_type->id == TypeTableEntryIdInt); assert(actual_type->id == TypeTableEntryIdBool); + add_debug_source_node(g, node); return LLVMBuildZExt(g->builder, expr_val, wanted_type->type_ref, ""); } @@ -1965,6 +1966,7 @@ static LLVMValueRef gen_if_bool_expr_raw(CodeGen *g, AstNode *source_node, LLVMV endif_block = LLVMAppendBasicBlock(g->cur_fn->fn_value, "EndIf"); } + add_debug_source_node(g, source_node); LLVMBuildCondBr(g->builder, cond_value, then_block, else_block); LLVMPositionBuilderAtEnd(g->builder, then_block); @@ -3836,6 +3838,8 @@ static void init(CodeGen *g, Buf *source_path) { LLVMSetTarget(g->module, buf_ptr(&g->triple_str)); + ZigLLVMAddModuleDebugInfoFlag(g->module); + LLVMTargetRef target_ref; char *err_msg = nullptr; if (LLVMGetTargetFromTriple(buf_ptr(&g->triple_str), &target_ref, &err_msg)) { |
