-
- fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) {
- self.super_terminator(terminator, location);
-
- if let TerminatorKind::Call { ref func, .. } = terminator.kind {
- if let ty::FnDef(def_id, _) = *func.ty(self.ccx.body, self.ccx.tcx).kind() {
- let fn_sig = self.ccx.tcx.fn_sig(def_id);
- if let Abi::RustIntrinsic | Abi::PlatformIntrinsic = fn_sig.abi() {
- let name = self.ccx.tcx.item_name(def_id);
- // FIXME(eddyb) use `#[rustc_args_required_const(2)]` for shuffles.
- if name.as_str().starts_with("simd_shuffle") {
- self.candidates.push(Candidate::Argument { bb: location.block, index: 2 });
-
- return; // Don't double count `simd_shuffle` candidates
- }
- }
-
- if let Some(constant_args) = args_required_const(self.ccx.tcx, def_id) {
- for index in constant_args {
- self.candidates.push(Candidate::Argument { bb: location.block, index });
- }
- }
- }
- }
- }