Remove a statement by its variable definition if and only if it is unused. Parameters ---------- var : Var The unused variable definition. allow_undef : bool, optional Whether to allow var being undefined variable, by default False
(self, var: Var, allow_undef=False)
| 97 | _ffi_api.dfb_rewrite_add(self, expr, name, is_dfvar) # type: ignore |
| 98 | |
| 99 | def remove_unused(self, var: Var, allow_undef=False) -> None: |
| 100 | """ |
| 101 | Remove a statement by its variable definition if and only if it is unused. |
| 102 | |
| 103 | Parameters |
| 104 | ---------- |
| 105 | var : Var |
| 106 | The unused variable definition. |
| 107 | allow_undef : bool, optional |
| 108 | Whether to allow var being undefined variable, by default False |
| 109 | |
| 110 | Raises |
| 111 | ------ |
| 112 | RuntimeError if the variable is used or undefined (allow_undef=False). |
| 113 | """ |
| 114 | _ffi_api.dfb_rewrite_remove_unused(self, var, allow_undef) # type: ignore |
| 115 | |
| 116 | def remove_all_unused(self) -> None: |
| 117 | """ |
no outgoing calls