Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
really fix void returns
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyAyersMS committed Nov 29, 2018
1 parent 6bb87dd commit d35d4dd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26093,6 +26093,8 @@ class IndirectCallTransformer
GenTreeCall* call = compiler->gtCloneExpr(origCall)->AsCall();
call->gtCallObjp = compiler->gtNewLclvNode(thisTemp, TYP_REF);

JITDUMP("Direct call [%06u] in block BB%02u\n", compiler->dspTreeID(call), thenBlock->bbNum);

// Then invoke impDevirtualizeCall do actually
// transform the call for us. It should succeed.... as we have
// now provided an exact typed this.
Expand Down Expand Up @@ -26138,13 +26140,14 @@ class IndirectCallTransformer
inlineInfo->exactContextHnd = context;
call->gtInlineCandidateInfo = inlineInfo;

// Add the call
GenTreeStmt* callStmt = compiler->gtNewStmt(call);
compiler->fgInsertStmtAtEnd(thenBlock, callStmt);

// If there is a ret expr for this call, we need to update it
// and append it just after the call.
if (oldRetExpr != nullptr)
{
GenTreeStmt* callStmt = compiler->gtNewStmt(call);
compiler->fgInsertStmtAtEnd(thenBlock, callStmt);

GenTree* retExpr = compiler->gtNewInlineCandidateReturnExpr(call, call->TypeGet());
inlineInfo->retExpr = retExpr;

Expand Down Expand Up @@ -26173,6 +26176,8 @@ class IndirectCallTransformer
GenTreeCall* call = newStmt->gtStmtExpr->AsCall();
call->gtFlags &= ~GTF_CALL_INLINE_CANDIDATE;

JITDUMP("Residual call [%06u] in block BB%02u\n", compiler->dspTreeID(call), elseBlock->bbNum);

if (returnTemp != BAD_VAR_NUM)
{
GenTree* assign = compiler->gtNewTempAssign(returnTemp, call);
Expand Down

0 comments on commit d35d4dd

Please sign in to comment.