Skip to content

Commit

Permalink
Support MIR tailcall
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Jul 11, 2024
1 parent 76653a5 commit 28e5195
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/monomorphize_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
};

match terminator.kind {
mir::TerminatorKind::Call { ref func, .. } => {
mir::TerminatorKind::Call { ref func, .. }
| mir::TerminatorKind::TailCall { ref func, .. } => {
let callee_ty = func.ty(self.body, tcx);
let callee_ty = self.monomorphize(callee_ty);
visit_fn_use(self.tcx, callee_ty, true, source, &mut self.output)
Expand Down
3 changes: 2 additions & 1 deletion src/preempt_count/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ impl<'mir, 'tcx, 'cx> MirNeighborVisitor<'mir, 'tcx, 'cx> {

let tcx = self.cx.tcx;
match terminator.kind {
mir::TerminatorKind::Call { ref func, .. } => {
mir::TerminatorKind::Call { ref func, .. }
| mir::TerminatorKind::TailCall { ref func, .. } => {
let callee_ty = func.ty(self.body, tcx);
let callee_ty = self.monomorphize(callee_ty);

Expand Down

0 comments on commit 28e5195

Please sign in to comment.