diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.cpp | 4 | ||||
| -rw-r--r-- | src/ir.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 0aecacb0b2..339c643425 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -590,8 +590,10 @@ static ZigLLVMDIScope *get_di_scope(CodeGen *g, Scope *scope) { bool is_optimized = g->build_mode != BuildModeDebug; bool is_internal_linkage = (fn_table_entry->body_node != nullptr && fn_table_entry->export_list.length == 0); + ZigLLVMDIScope *fn_di_scope = get_di_scope(g, scope->parent); + assert(fn_di_scope != nullptr); ZigLLVMDISubprogram *subprogram = ZigLLVMCreateFunction(g->dbuilder, - get_di_scope(g, scope->parent), buf_ptr(&fn_table_entry->symbol_name), "", + fn_di_scope, buf_ptr(&fn_table_entry->symbol_name), "", import->di_file, line_number, fn_table_entry->type_entry->di_type, is_internal_linkage, is_definition, scope_line, flags, is_optimized, nullptr); diff --git a/src/ir.cpp b/src/ir.cpp index a0f5a9be47..8698456379 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -14051,6 +14051,8 @@ static TypeTableEntry *ir_analyze_instruction_c_import(IrAnalyze *ira, IrInstruc child_import->package = new_anonymous_package(); child_import->package->package_table.put(buf_create_from_str("builtin"), ira->codegen->compile_var_package); child_import->package->package_table.put(buf_create_from_str("std"), ira->codegen->std_package); + child_import->di_file = ZigLLVMCreateFile(ira->codegen->dbuilder, + buf_ptr(buf_create_from_str("cimport.h")), buf_ptr(buf_create_from_str("."))); ZigList<ErrorMsg *> errors = {0}; |
