Infer more precise error_kind attributes for ops. We have access here to more information than what was available when the IR was initially built.
(block: BasicBlock)
| 160 | |
| 161 | |
| 162 | def adjust_error_kinds(block: BasicBlock) -> None: |
| 163 | """Infer more precise error_kind attributes for ops. |
| 164 | |
| 165 | We have access here to more information than what was available |
| 166 | when the IR was initially built. |
| 167 | """ |
| 168 | for op in block.ops: |
| 169 | if isinstance(op, GetAttr): |
| 170 | if op.class_type.class_ir.is_always_defined(op.attr): |
| 171 | op.error_kind = ERR_NEVER |
| 172 | if isinstance(op, SetAttr): |
| 173 | if op.class_type.class_ir.is_always_defined(op.attr): |
| 174 | op.error_kind = ERR_NEVER |
| 175 | |
| 176 | |
| 177 | def insert_overlapping_error_value_check(ops: list[Op], target: Value) -> ComparisonOp: |
no test coverage detected
searching dependent graphs…