Set the wrapped function. It's fine to modify the attributes initialized here later to customize the wrapper function.
(self, fn: FuncIR)
| 850 | self.traceback_code = "" |
| 851 | |
| 852 | def set_target(self, fn: FuncIR) -> None: |
| 853 | """Set the wrapped function. |
| 854 | |
| 855 | It's fine to modify the attributes initialized here later to customize |
| 856 | the wrapper function. |
| 857 | """ |
| 858 | self.target_name = fn.name |
| 859 | self.target_cname = fn.cname(self.emitter.names) |
| 860 | # Cached native-call expression so cross-group targets go through the |
| 861 | # exports table; same as `NATIVE_PREFIX + cname` for in-group calls. |
| 862 | self.target_native_call = self.emitter.native_function_call(fn.decl) |
| 863 | self.num_bitmap_args = fn.sig.num_bitmap_args |
| 864 | if self.num_bitmap_args: |
| 865 | self.args = fn.args[: -self.num_bitmap_args] |
| 866 | else: |
| 867 | self.args = fn.args |
| 868 | self.arg_names = [arg.name for arg in self.args] |
| 869 | self.ret_type = fn.ret_type |
| 870 | |
| 871 | def wrapper_name(self) -> str: |
| 872 | """Return the name of the wrapper function.""" |
no test coverage detected