| ... | @@ -4577,6 +4577,10 @@ pub const FuncGen = struct { | ... | @@ -4577,6 +4577,10 @@ pub const FuncGen = struct { |
| 4577 | const operand_ty = self.air.typeOf(pl_op.operand); | 4577 | const operand_ty = self.air.typeOf(pl_op.operand); |
| 4578 | const name = self.air.nullTerminatedString(pl_op.payload); | 4578 | const name = self.air.nullTerminatedString(pl_op.payload); |
| 4579 | | 4579 | |
| | 4580 | if (needDbgVarWorkaround(self.dg, operand_ty)) { |
| | 4581 | return null; |
| | 4582 | } |
| | 4583 | |
| 4580 | const di_local_var = dib.createAutoVariable( | 4584 | const di_local_var = dib.createAutoVariable( |
| 4581 | self.di_scope.?, | 4585 | self.di_scope.?, |
| 4582 | name.ptr, | 4586 | name.ptr, |
| ... | @@ -6147,6 +6151,10 @@ pub const FuncGen = struct { | ... | @@ -6147,6 +6151,10 @@ pub const FuncGen = struct { |
| 6147 | | 6151 | |
| 6148 | const inst_ty = self.air.typeOfIndex(inst); | 6152 | const inst_ty = self.air.typeOfIndex(inst); |
| 6149 | if (self.dg.object.di_builder) |dib| { | 6153 | if (self.dg.object.di_builder) |dib| { |
| | 6154 | if (needDbgVarWorkaround(self.dg, inst_ty)) { |
| | 6155 | return arg_val; |
| | 6156 | } |
| | 6157 | |
| 6150 | const src_index = self.getSrcArgIndex(self.arg_index - 1); | 6158 | const src_index = self.getSrcArgIndex(self.arg_index - 1); |
| 6151 | const func = self.dg.decl.getFunction().?; | 6159 | const func = self.dg.decl.getFunction().?; |
| 6152 | const lbrace_line = self.dg.module.declPtr(func.owner_decl).src_line + func.lbrace_line + 1; | 6160 | const lbrace_line = self.dg.module.declPtr(func.owner_decl).src_line + func.lbrace_line + 1; |
| ... | @@ -8248,3 +8256,15 @@ const AnnotatedDITypePtr = enum(usize) { | ... | @@ -8248,3 +8256,15 @@ const AnnotatedDITypePtr = enum(usize) { |
| 8248 | }; | 8256 | }; |
| 8249 | | 8257 | |
| 8250 | const lt_errors_fn_name = "__zig_lt_errors_len"; | 8258 | const lt_errors_fn_name = "__zig_lt_errors_len"; |
| | 8259 | |
| | 8260 | /// Without this workaround, LLVM crashes with "unknown codeview register H1" |
| | 8261 | /// TODO use llvm-reduce and file upstream LLVM bug for this. |
| | 8262 | fn needDbgVarWorkaround(dg: *DeclGen, ty: Type) bool { |
| | 8263 | if (ty.tag() == .f16) { |
| | 8264 | const target = dg.module.getTarget(); |
| | 8265 | if (target.os.tag == .windows and target.cpu.arch == .aarch64) { |
| | 8266 | return true; |
| | 8267 | } |
| | 8268 | } |
| | 8269 | return false; |
| | 8270 | } |