void gtGetLclVarNameInfo(unsigned lclNum, const char** ilKindOut, const char** ilNameOut, unsigned* ilNumOut);
int gtGetLclVarName(unsigned lclNum, char* buf, unsigned buf_remaining);
char* gtGetLclVarName(unsigned lclNum);
- void gtDispLclVar(unsigned varNum, bool padForBiggestDisp = true);
+ void gtDispLclVar(unsigned lclNum, bool padForBiggestDisp = true);
+ void gtDispLclVarStructType(unsigned lclNum);
+ void gtDispClassLayout(ClassLayout* layout, var_types type);
void gtDispStmt(Statement* stmt, const char* msg = nullptr);
void gtDispBlockStmts(BasicBlock* block);
void gtGetArgMsg(GenTreeCall* call, GenTree* arg, unsigned argNum, int listCount, char* bufp, unsigned bufLength);
if (layout != nullptr)
{
- if (layout->IsBlockLayout())
- {
- printf("<%u>", layout->GetSize());
- }
- else if (varTypeIsSIMD(tree->TypeGet()))
- {
- printf("<%s>", layout->GetClassName());
- }
- else
- {
- printf("<%s, %u>", layout->GetClassName(), layout->GetSize());
- }
+ gtDispClassLayout(layout, tree->TypeGet());
}
}
}
}
+//------------------------------------------------------------------------
+// gtDispLclVarStructType: Print size and type information about a struct or lclBlk local variable.
+//
+// Arguments:
+// lclNum - The local var id.
+//
+void Compiler::gtDispLclVarStructType(unsigned lclNum)
+{
+ LclVarDsc* varDsc = lvaGetDesc(lclNum);
+ var_types type = varDsc->TypeGet();
+ if (type == TYP_STRUCT)
+ {
+ ClassLayout* layout = varDsc->GetLayout();
+ assert(layout != nullptr);
+ gtDispClassLayout(layout, type);
+ }
+ else if (type == TYP_LCLBLK)
+ {
+#if FEATURE_FIXED_OUT_ARGS
+ assert(lclNum == lvaOutgoingArgSpaceVar);
+ // Since lvaOutgoingArgSpaceSize is a PhasedVar we can't read it for Dumping until
+ // after we set it to something.
+ if (lvaOutgoingArgSpaceSize.HasFinalValue())
+ {
+ // A PhasedVar<T> can't be directly used as an arg to a variadic function
+ unsigned value = lvaOutgoingArgSpaceSize;
+ printf("<%u> ", value);
+ }
+ else
+ {
+ printf("<na> "); // The value hasn't yet been determined
+ }
+#else
+ assert(!"Unknown size");
+ NO_WAY("Target doesn't support TYP_LCLBLK");
+#endif // FEATURE_FIXED_OUT_ARGS
+ }
+}
+
+//------------------------------------------------------------------------
+// gtDispClassLayout: Print size and type information about a layout.
+//
+// Arguments:
+// layout - the layout;
+// type - variable type, used to avoid printing size for SIMD nodes.
+//
+void Compiler::gtDispClassLayout(ClassLayout* layout, var_types type)
+{
+ assert(layout != nullptr);
+ if (layout->IsBlockLayout())
+ {
+ printf("<%u>", layout->GetSize());
+ }
+ else if (varTypeIsSIMD(type))
+ {
+ printf("<%s>", layout->GetClassName());
+ }
+ else
+ {
+ printf("<%s, %u>", layout->GetClassName(), layout->GetSize());
+ }
+}
+
/*****************************************************************************/
void Compiler::gtDispConst(GenTree* tree)
{
void Compiler::lvaDumpEntry(unsigned lclNum, FrameLayoutState curState, size_t refCntWtdWidth)
{
- LclVarDsc* varDsc = lvaTable + lclNum;
+ LclVarDsc* varDsc = lvaGetDesc(lclNum);
var_types type = varDsc->TypeGet();
if (curState == INITIAL_FRAME_LAYOUT)
gtDispLclVar(lclNum);
printf(" %7s ", varTypeName(type));
- if (genTypeSize(type) == 0)
- {
-#if FEATURE_FIXED_OUT_ARGS
- if (lclNum == lvaOutgoingArgSpaceVar)
- {
- // Since lvaOutgoingArgSpaceSize is a PhasedVar we can't read it for Dumping until
- // after we set it to something.
- if (lvaOutgoingArgSpaceSize.HasFinalValue())
- {
- // A PhasedVar<T> can't be directly used as an arg to a variadic function
- unsigned value = lvaOutgoingArgSpaceSize;
- printf("(%2d) ", value);
- }
- else
- {
- printf("(na) "); // The value hasn't yet been determined
- }
- }
- else
-#endif // FEATURE_FIXED_OUT_ARGS
- {
- printf("(%2d) ", lvaLclSize(lclNum));
- }
- }
+ gtDispLclVarStructType(lclNum);
}
else
{