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

Commit

Permalink
Use ClassLayout in GenTreeRetExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedn committed May 5, 2019
1 parent 867ab3f commit 3419c45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ class Compiler
#endif // FEATURE_HW_INTRINSICS

GenTreeLclFld* gtNewLclFldNode(unsigned lnum, var_types type, unsigned offset);
GenTree* gtNewInlineCandidateReturnExpr(GenTree* inlineCandidate, var_types type);
GenTreeRetExpr* gtNewInlineCandidateReturnExpr(GenTree* inlineCandidate, var_types type);

GenTree* gtNewFieldRef(var_types typ, CORINFO_FIELD_HANDLE fldHnd, GenTree* obj = nullptr, DWORD offset = 0);

Expand Down
12 changes: 5 additions & 7 deletions src/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5961,18 +5961,16 @@ GenTreeLclFld* Compiler::gtNewLclFldNode(unsigned lnum, var_types type, unsigned
return node;
}

GenTree* Compiler::gtNewInlineCandidateReturnExpr(GenTree* inlineCandidate, var_types type)

GenTreeRetExpr* Compiler::gtNewInlineCandidateReturnExpr(GenTree* inlineCandidate, var_types type)
{
assert(GenTree::s_gtNodeSizes[GT_RET_EXPR] == TREE_NODE_SZ_LARGE);

GenTree* node = new (this, GT_RET_EXPR) GenTreeRetExpr(type);

node->gtRetExpr.gtInlineCandidate = inlineCandidate;
GenTreeRetExpr* node = new (this, GT_RET_EXPR) GenTreeRetExpr(type);
node->gtInlineCandidate = inlineCandidate;

if (varTypeIsStruct(inlineCandidate) && !inlineCandidate->OperIsBlkOp())
if (varTypeIsStruct(inlineCandidate->TypeGet()) && !inlineCandidate->OperIsBlkOp())
{
node->AsRetExpr()->SetLayout(typGetObjLayout(gtGetStructHandle(inlineCandidate)));
node->SetLayout(typGetObjLayout(gtGetStructHandle(inlineCandidate)));
}

// GT_RET_EXPR node eventually might be bashed back to GT_CALL (when inlining is aborted for example).
Expand Down

0 comments on commit 3419c45

Please sign in to comment.