ICTop,
ICMiddle,
ICDash,
- ICEmbedded,
ICTerminal,
ICError,
IndentCharCount
// clang-format off
// Sets of strings for different dumping options vert bot top mid dash embedded terminal error
-static const char* emptyIndents[IndentCharCount] = { " ", " ", " ", " ", " ", "{", "", "?" };
-static const char* asciiIndents[IndentCharCount] = { "|", "\\", "/", "+", "-", "{", "*", "?" };
-static const char* unicodeIndents[IndentCharCount] = { "\xe2\x94\x82", "\xe2\x94\x94", "\xe2\x94\x8c", "\xe2\x94\x9c", "\xe2\x94\x80", "{", "\xe2\x96\x8c", "?" };
+static const char* emptyIndents[IndentCharCount] = { " ", " ", " ", " ", " ", "", "?" };
+static const char* asciiIndents[IndentCharCount] = { "|", "\\", "/", "+", "-", "*", "?" };
+static const char* unicodeIndents[IndentCharCount] = { "\xe2\x94\x82", "\xe2\x94\x94", "\xe2\x94\x8c", "\xe2\x94\x9c", "\xe2\x94\x80", "\xe2\x96\x8c", "?" };
// clang-format on
typedef ArrayStack<Compiler::IndentInfo> IndentInfoStack;
case Compiler::IndentInfo::IINone:
printf(" ");
break;
- case Compiler::IndentInfo::IIEmbedded:
- printf("%s ", indents[ICEmbedded]);
- break;
case Compiler::IndentInfo::IIArc:
if (index == 0)
{
indentStack->Push(IINone);
lowerArc = IIArc;
break;
- case IIEmbedded:
- indentStack->Push(IIEmbedded);
- lowerArc = IIEmbedded;
- break;
case IINone:
indentStack->Push(IINone);
lowerArc = IINone;
}
}
- // Special case formatting for PHI nodes -- arg lists like calls.
-
- if (tree->OperGet() == GT_PHI)
- {
- gtDispNode(tree, indentStack, msg, isLIR);
- gtDispCommonEndLine(tree);
-
- if (!topOnly)
- {
- if (tree->gtOp.gtOp1 != nullptr)
- {
- IndentInfo arcType = IIArcTop;
- for (GenTreeArgList* args = tree->gtOp.gtOp1->AsArgList(); args != nullptr; args = args->Rest())
- {
- if (args->Rest() == nullptr)
- {
- arcType = IIArcBottom;
- }
- gtDispChild(args->Current(), indentStack, arcType);
- arcType = IIArc;
- }
- }
- }
- return;
- }
-
/* Is it a 'simple' unary/binary operator? */
const char* childMsg = nullptr;
if (tree->OperIsSimple())
{
- if (!topOnly)
- {
- if (tree->gtGetOp2IfPresent())
- {
- // Label the childMsgs of the GT_COLON operator
- // op2 is the then part
-
- if (tree->gtOper == GT_COLON)
- {
- childMsg = "then";
- }
- gtDispChild(tree->gtOp.gtOp2, indentStack, IIArcTop, childMsg, topOnly);
- }
- }
-
// Now, get the right type of arc for this node
if (myArc != IINone)
{
gtDispCommonEndLine(tree);
- if (!topOnly && tree->gtOp.gtOp1)
+ if (!topOnly)
{
-
- // Label the child of the GT_COLON operator
- // op1 is the else part
-
- if (tree->gtOper == GT_COLON)
+ if (tree->gtOp.gtOp1 != nullptr)
{
- childMsg = "else";
+ if (tree->OperIs(GT_PHI))
+ {
+ for (GenTreeArgList* args = tree->gtGetOp1()->AsArgList(); args != nullptr; args = args->Rest())
+ {
+ gtDispChild(args->Current(), indentStack, (args->Rest() == nullptr) ? IIArcBottom : IIArc);
+ }
+ }
+ else
+ {
+ // Label the child of the GT_COLON operator
+ // op1 is the else part
+
+ if (tree->gtOper == GT_COLON)
+ {
+ childMsg = "else";
+ }
+ else if (tree->gtOper == GT_QMARK)
+ {
+ childMsg = " if";
+ }
+ gtDispChild(tree->gtOp.gtOp1, indentStack,
+ (tree->gtGetOp2IfPresent() == nullptr) ? IIArcBottom : IIArc, childMsg, topOnly);
+ }
}
- else if (tree->gtOper == GT_QMARK)
+
+ if (tree->gtGetOp2IfPresent())
{
- childMsg = " if";
+ // Label the childMsgs of the GT_COLON operator
+ // op2 is the then part
+
+ if (tree->gtOper == GT_COLON)
+ {
+ childMsg = "then";
+ }
+ gtDispChild(tree->gtOp.gtOp2, indentStack, IIArcBottom, childMsg, topOnly);
}
- gtDispChild(tree->gtOp.gtOp1, indentStack, IIArcBottom, childMsg, topOnly);
}
return;