| ... | ... | @@ -6944,6 +6944,23 @@ pub const FuncGen = struct { |
| 6944 | 6944 | // possibly do the safety 0xaa bytes for undefined. |
| 6945 | 6945 | const val_is_undef = if (self.air.value(bin_op.rhs)) |val| val.isUndefDeep() else false; |
| 6946 | 6946 | if (val_is_undef) { |
| 6947 | { |
| 6948 | // TODO let's handle this in AIR rather than by having each backend |
| 6949 | // check the optimization mode of the compilation because the plan is |
| 6950 | // to support setting the optimization mode at finer grained scopes |
| 6951 | // which happens in Sema. Codegen should not be aware of this logic. |
| 6952 | // I think this comment is basically the same as the other TODO comment just |
| 6953 | // above but I'm leaving them both here to make it look super messy and |
| 6954 | // thereby bait contributors (or let's be honest, probably myself) into |
| 6955 | // fixing this instead of letting it rot. |
| 6956 | const safety = switch (self.dg.module.comp.bin_file.options.optimize_mode) { |
| 6957 | .ReleaseSmall, .ReleaseFast => false, |
| 6958 | .Debug, .ReleaseSafe => true, |
| 6959 | }; |
| 6960 | if (!safety) { |
| 6961 | return null; |
| 6962 | } |
| 6963 | } |
| 6947 | 6964 | const target = self.dg.module.getTarget(); |
| 6948 | 6965 | const operand_size = operand_ty.abiSize(target); |
| 6949 | 6966 | const u8_llvm_ty = self.context.intType(8); |