Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed May 2, 2022
1 parent 64b3cf6 commit 0c6af71
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 102 deletions.
24 changes: 11 additions & 13 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16026,7 +16026,8 @@ bool GenTree::DefinesLocal(Compiler* comp, GenTreeLclVarCommon** pLclVarTree, bo
else if (AsOp()->gtOp1->OperGet() == GT_IND)
{
GenTree* indArg = AsOp()->gtOp1->AsOp()->gtOp1;
return indArg->DefinesLocalAddr(comp, genTypeSize(AsOp()->gtOp1->TypeGet()), pLclVarTree, pIsEntire, pOffset);
return indArg->DefinesLocalAddr(comp, genTypeSize(AsOp()->gtOp1->TypeGet()), pLclVarTree, pIsEntire,
pOffset);
}
else if (AsOp()->gtOp1->OperIsBlk())
{
Expand Down Expand Up @@ -16074,11 +16075,8 @@ bool GenTree::DefinesLocal(Compiler* comp, GenTreeLclVarCommon** pLclVarTree, bo
return false;
}

bool GenTree::DefinesLocalAddr(Compiler* comp,
unsigned width,
GenTreeLclVarCommon** pLclVarTree,
bool* pIsEntire,
ssize_t* pOffset)
bool GenTree::DefinesLocalAddr(
Compiler* comp, unsigned width, GenTreeLclVarCommon** pLclVarTree, bool* pIsEntire, ssize_t* pOffset)
{
if (OperIs(GT_ADDR, GT_LCL_VAR_ADDR, GT_LCL_FLD_ADDR))
{
Expand Down Expand Up @@ -16811,9 +16809,9 @@ bool GenTree::IsFieldAddr(Compiler* comp, GenTree** pBaseAddr, FieldSeqNode** pF
else if (IsCnsIntOrI() && IsIconHandle(GTF_ICON_STATIC_HDL))
{
assert(!comp->GetZeroOffsetFieldMap()->Lookup(this) && (AsIntCon()->gtFieldSeq != nullptr));
baseAddr = this;
fldSeq = AsIntCon()->gtFieldSeq;
offset = AsIntCon()->IconValue();
baseAddr = this;
fldSeq = AsIntCon()->gtFieldSeq;
offset = AsIntCon()->IconValue();
}
else if (comp->GetZeroOffsetFieldMap()->Lookup(this, &fldSeq))
{
Expand Down Expand Up @@ -18136,8 +18134,9 @@ FieldSeqStore::FieldSeqStore(CompAllocator alloc) : m_alloc(alloc), m_canonMap(n
{
}

FieldSeqNode* FieldSeqStore::CreateSingleton(
CORINFO_FIELD_HANDLE fieldHnd, size_t offset, FieldSeqNode::FieldKind fieldKind)
FieldSeqNode* FieldSeqStore::CreateSingleton(CORINFO_FIELD_HANDLE fieldHnd,
size_t offset,
FieldSeqNode::FieldKind fieldKind)
{
FieldSeqNode fsn(fieldHnd, nullptr, offset, fieldKind);
FieldSeqNode* res = nullptr;
Expand Down Expand Up @@ -18195,8 +18194,7 @@ FieldSeqNode* FieldSeqStore::Append(FieldSeqNode* a, FieldSeqNode* b)
}

FieldSeqNode::FieldSeqNode(CORINFO_FIELD_HANDLE fieldHnd, FieldSeqNode* next, size_t offset, FieldKind fieldKind)
: m_next(next)
, m_offset(offset)
: m_next(next), m_offset(offset)
{
uintptr_t handleValue = reinterpret_cast<uintptr_t>(fieldHnd);

Expand Down
13 changes: 6 additions & 7 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,10 @@ struct GenTree
// tree for the local that is defined, and, if "pIsEntire" is non-null, sets "*pIsEntire" to
// true or false, depending on whether the assignment writes to the entirety of the local
// variable, or just a portion of it.
bool DefinesLocal(
Compiler* comp, GenTreeLclVarCommon** pLclVarTree, bool* pIsEntire = nullptr, ssize_t* pOffset = nullptr);
bool DefinesLocal(Compiler* comp,
GenTreeLclVarCommon** pLclVarTree,
bool* pIsEntire = nullptr,
ssize_t* pOffset = nullptr);

bool IsLocalAddrExpr(Compiler* comp,
GenTreeLclVarCommon** pLclVarTree,
Expand Down Expand Up @@ -1955,11 +1957,8 @@ struct GenTree
// operation. Returns "true" if "this" is an address of (or within)
// a local variable; sets "*pLclVarTree" to that local variable instance; and, if "pIsEntire" is non-null,
// sets "*pIsEntire" to true if this assignment writes the full width of the local.
bool DefinesLocalAddr(Compiler* comp,
unsigned width,
GenTreeLclVarCommon** pLclVarTree,
bool* pIsEntire,
ssize_t* pOffset = nullptr);
bool DefinesLocalAddr(
Compiler* comp, unsigned width, GenTreeLclVarCommon** pLclVarTree, bool* pIsEntire, ssize_t* pOffset = nullptr);

// These are only used for dumping.
// The GetRegNum() is only valid in LIR, but the dumping methods are not easily
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,8 +1416,8 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr,

GenTree* ptrSlot = gtNewOperNode(GT_IND, TYP_I_IMPL, destAddr);
GenTreeIntCon* typeFieldOffset = gtNewIconNode(OFFSETOF__CORINFO_TypedReference__type, TYP_I_IMPL);
typeFieldOffset->gtFieldSeq = GetFieldSeqStore()->CreateSingleton(GetRefanyTypeField(),
OFFSETOF__CORINFO_TypedReference__type);
typeFieldOffset->gtFieldSeq =
GetFieldSeqStore()->CreateSingleton(GetRefanyTypeField(), OFFSETOF__CORINFO_TypedReference__type);
GenTree* typeSlot =
gtNewOperNode(GT_IND, TYP_I_IMPL, gtNewOperNode(GT_ADD, destAddr->gtType, destAddrClone, typeFieldOffset));

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lclmorph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class LocalAddressVisitor final : public GenTreeVisitor<LocalAddressVisitor>
{
FieldSeqStore* fieldSeqStore = compiler->GetFieldSeqStore();
FieldSeqNode* fieldSeqNode = fieldSeqStore->CreateSingleton(field->gtFldHnd, field->gtFldOffset);
m_fieldSeq = fieldSeqStore->Append(val.m_fieldSeq, fieldSeqNode);
m_fieldSeq = fieldSeqStore->Append(val.m_fieldSeq, fieldSeqNode);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3465,11 +3465,11 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
// (tmp.ptr=argx),(tmp.type=handle)
GenTreeLclFld* destPtrSlot = gtNewLclFldNode(tmp, TYP_I_IMPL, OFFSETOF__CORINFO_TypedReference__dataPtr);
GenTreeLclFld* destTypeSlot = gtNewLclFldNode(tmp, TYP_I_IMPL, OFFSETOF__CORINFO_TypedReference__type);
destPtrSlot->SetFieldSeq(GetFieldSeqStore()->CreateSingleton(GetRefanyDataField(),
OFFSETOF__CORINFO_TypedReference__dataPtr));
destPtrSlot->SetFieldSeq(
GetFieldSeqStore()->CreateSingleton(GetRefanyDataField(), OFFSETOF__CORINFO_TypedReference__dataPtr));
destPtrSlot->gtFlags |= GTF_VAR_DEF;
destTypeSlot->SetFieldSeq(GetFieldSeqStore()->CreateSingleton(GetRefanyTypeField(),
OFFSETOF__CORINFO_TypedReference__type));
destTypeSlot->SetFieldSeq(
GetFieldSeqStore()->CreateSingleton(GetRefanyTypeField(), OFFSETOF__CORINFO_TypedReference__type));
destTypeSlot->gtFlags |= GTF_VAR_DEF;

GenTree* asgPtrSlot = gtNewAssignNode(destPtrSlot, argx->AsOp()->gtOp1);
Expand Down
Loading

0 comments on commit 0c6af71

Please sign in to comment.