Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions llvm/lib/CheerpWriter/PartialExecuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ class PartialInterpreter : public llvm::Interpreter {
if (!calledFunc)
return true;

if (calledFunc->getIntrinsicID() == Intrinsic::cheerp_typed_ptrcast)
return false;

if (isAlreadyInCallStack(calledFunc))
return true;

Expand Down Expand Up @@ -1744,7 +1747,24 @@ void PartialInterpreter::visitOuter(FunctionData& data, llvm::Instruction& I)

//Iff it's a call, set up the next stack frame
if (CallInst* CI = dyn_cast<CallInst>(&I))
{
const Function* calledFunc = dyn_cast_or_null<Function>(cast<CallInst>(I).getCalledFunction());
if (calledFunc->getIntrinsicID() == Intrinsic::cheerp_typed_ptrcast)
{
Value* srcPtr = CI->getArgOperand(0);
BitMask strongBits = getBitMask(srcPtr);
GlobalVariable* ptrBase = getPointerBase(srcPtr);
if (isValueComputed(srcPtr))
{
GenericValue GV = getOperandValue(srcPtr);
assignToMaps(&I, strongBits, GV, ptrBase);
}
else
assignToMaps(&I, strongBits, ptrBase);
return;
}
forwardArgumentsToNextFrame(*CI);
}

//Dispatch to the Interpreter's visitor for the given Instructon
Interpreter::visit(I);
Expand Down
Loading