| ... | @@ -6088,6 +6088,12 @@ pub const FuncGen = struct { | ... | @@ -6088,6 +6088,12 @@ pub const FuncGen = struct { |
| 6088 | const insert_block = self.builder.getInsertBlock(); | 6088 | const insert_block = self.builder.getInsertBlock(); |
| 6089 | if (isByRef(operand_ty)) { | 6089 | if (isByRef(operand_ty)) { |
| 6090 | _ = dib.insertDeclareAtEnd(operand, di_local_var, debug_loc, insert_block); | 6090 | _ = dib.insertDeclareAtEnd(operand, di_local_var, debug_loc, insert_block); |
| | 6091 | } else if (self.dg.module.comp.bin_file.options.optimize_mode == .Debug) { |
| | 6092 | const alignment = operand_ty.abiAlignment(self.dg.module.getTarget()); |
| | 6093 | const alloca = self.buildAlloca(operand.typeOf(), alignment); |
| | 6094 | const store_inst = self.builder.buildStore(operand, alloca); |
| | 6095 | store_inst.setAlignment(alignment); |
| | 6096 | _ = dib.insertDeclareAtEnd(alloca, di_local_var, debug_loc, insert_block); |
| 6091 | } else { | 6097 | } else { |
| 6092 | _ = dib.insertDbgValueIntrinsicAtEnd(operand, di_local_var, debug_loc, insert_block); | 6098 | _ = dib.insertDbgValueIntrinsicAtEnd(operand, di_local_var, debug_loc, insert_block); |
| 6093 | } | 6099 | } |
| ... | @@ -8026,6 +8032,12 @@ pub const FuncGen = struct { | ... | @@ -8026,6 +8032,12 @@ pub const FuncGen = struct { |
| 8026 | const insert_block = self.builder.getInsertBlock(); | 8032 | const insert_block = self.builder.getInsertBlock(); |
| 8027 | if (isByRef(inst_ty)) { | 8033 | if (isByRef(inst_ty)) { |
| 8028 | _ = dib.insertDeclareAtEnd(arg_val, di_local_var, debug_loc, insert_block); | 8034 | _ = dib.insertDeclareAtEnd(arg_val, di_local_var, debug_loc, insert_block); |
| | 8035 | } else if (self.dg.module.comp.bin_file.options.optimize_mode == .Debug) { |
| | 8036 | const alignment = inst_ty.abiAlignment(self.dg.module.getTarget()); |
| | 8037 | const alloca = self.buildAlloca(arg_val.typeOf(), alignment); |
| | 8038 | const store_inst = self.builder.buildStore(arg_val, alloca); |
| | 8039 | store_inst.setAlignment(alignment); |
| | 8040 | _ = dib.insertDeclareAtEnd(alloca, di_local_var, debug_loc, insert_block); |
| 8029 | } else { | 8041 | } else { |
| 8030 | _ = dib.insertDbgValueIntrinsicAtEnd(arg_val, di_local_var, debug_loc, insert_block); | 8042 | _ = dib.insertDbgValueIntrinsicAtEnd(arg_val, di_local_var, debug_loc, insert_block); |
| 8031 | } | 8043 | } |