NOTE(eddyb) see the comment on `SpirvValueKind::FnAddr`, this should be fixed upstream, so we never see any "function pointer" values being created just to perform direct calls.
(&self, instance: Instance<'tcx>)
| 782 | // be fixed upstream, so we never see any "function pointer" values being |
| 783 | // created just to perform direct calls. |
| 784 | fn get_fn_addr(&self, instance: Instance<'tcx>) -> Self::Value { |
| 785 | let function = self.get_fn(instance); |
| 786 | let span = self.tcx.def_span(instance.def_id()); |
| 787 | |
| 788 | let ty = SpirvType::Pointer { |
| 789 | pointee: function.ty, |
| 790 | } |
| 791 | .def(span, self); |
| 792 | |
| 793 | // Create these `OpUndef`s up front, instead of on-demand in `SpirvValue::def`, |
| 794 | // because `SpirvValue::def` can't use `cx.emit()`. |
| 795 | self.def_constant(ty, SpirvConst::ZombieUndefForFnAddr); |
| 796 | |
| 797 | SpirvValue { |
| 798 | kind: SpirvValueKind::FnAddr { |
| 799 | function: function.def_cx(self), |
| 800 | }, |
| 801 | ty, |
| 802 | } |
| 803 | } |
| 804 | |
| 805 | fn eh_personality(&self) -> Self::Value { |
| 806 | todo!() |
no test coverage detected