| ... | @@ -1179,8 +1179,7 @@ pub const Object = struct { | ... | @@ -1179,8 +1179,7 @@ pub const Object = struct { |
| 1179 | | 1179 | |
| 1180 | llvm_func.fnSetSubprogram(subprogram); | 1180 | llvm_func.fnSetSubprogram(subprogram); |
| 1181 | | 1181 | |
| 1182 | const lexical_block = dib.createLexicalBlock(subprogram.toScope(), di_file.?, line_number, 1); | 1182 | di_scope = subprogram.toScope(); |
| 1183 | di_scope = lexical_block.toScope(); | | |
| 1184 | } | 1183 | } |
| 1185 | | 1184 | |
| 1186 | var fg: FuncGen = .{ | 1185 | var fg: FuncGen = .{ |
| ... | @@ -1393,9 +1392,10 @@ pub const Object = struct { | ... | @@ -1393,9 +1392,10 @@ pub const Object = struct { |
| 1393 | return @ptrCast(*llvm.DIFile, gop.value_ptr.*); | 1392 | return @ptrCast(*llvm.DIFile, gop.value_ptr.*); |
| 1394 | } | 1393 | } |
| 1395 | const dir_path = file.pkg.root_src_directory.path orelse "."; | 1394 | const dir_path = file.pkg.root_src_directory.path orelse "."; |
| 1396 | const sub_file_path_z = try gpa.dupeZ(u8, file.sub_file_path); | 1395 | const sub_file_path_z = try gpa.dupeZ(u8, std.fs.path.basename(file.sub_file_path)); |
| 1397 | defer gpa.free(sub_file_path_z); | 1396 | defer gpa.free(sub_file_path_z); |
| 1398 | const dir_path_z = try gpa.dupeZ(u8, dir_path); | 1397 | const stage1_workaround = std.fs.path.dirname(file.sub_file_path) orelse ""; |
| | 1398 | const dir_path_z = try std.fs.path.joinZ(gpa, &.{ dir_path, stage1_workaround }); |
| 1399 | defer gpa.free(dir_path_z); | 1399 | defer gpa.free(dir_path_z); |
| 1400 | const di_file = o.di_builder.?.createFile(sub_file_path_z, dir_path_z); | 1400 | const di_file = o.di_builder.?.createFile(sub_file_path_z, dir_path_z); |
| 1401 | gop.value_ptr.* = di_file.toNode(); | 1401 | gop.value_ptr.* = di_file.toNode(); |