Skip to content

Commit

Permalink
fix(Writer): don't compile virtual/downcast if there are no uses
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri91 committed Oct 17, 2024
1 parent b15f598 commit c01ea7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/CheerpWriter/CheerpWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,15 @@ CheerpWriter::COMPILE_INSTRUCTION_FEEDBACK CheerpWriter::handleBuiltinCall(const
}
else if(intrinsicId==Intrinsic::cheerp_virtualcast)
{
if(callV.use_empty())
return COMPILE_EMPTY;
compileVirtualcast( callV );
return COMPILE_OK;
}
else if(intrinsicId==Intrinsic::cheerp_downcast)
{
if(callV.use_empty())
return COMPILE_EMPTY;
compileDowncast( callV );
return COMPILE_OK;
}
Expand Down

0 comments on commit c01ea7e

Please sign in to comment.