Skip to content

Commit

Permalink
Always display statement information (#99531)
Browse files Browse the repository at this point in the history
There is negative utility in not doing when debug info is not requested.
  • Loading branch information
SingleAccretion committed Mar 11, 2024
1 parent e5179e7 commit e171360
Showing 1 changed file with 34 additions and 37 deletions.
71 changes: 34 additions & 37 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13299,48 +13299,45 @@ void Compiler::gtDispArgList(GenTreeCall* call, GenTree* lastCallOperand, Indent
//
void Compiler::gtDispStmt(Statement* stmt, const char* msg /* = nullptr */)
{
if (opts.compDbgInfo)
if (msg != nullptr)
{
if (msg != nullptr)
{
printf("%s ", msg);
}
printStmtID(stmt);
printf(" ( ");
const DebugInfo& di = stmt->GetDebugInfo();
// For statements in the root we display just the location without the
// inline context info.
if (di.GetInlineContext() == nullptr || di.GetInlineContext()->IsRoot())
{
di.GetLocation().Dump();
}
else
{
stmt->GetDebugInfo().Dump(false);
}
printf(" ... ");

IL_OFFSET lastILOffs = stmt->GetLastILOffset();
if (lastILOffs == BAD_IL_OFFSET)
{
printf("???");
}
else
{
printf("0x%03X", lastILOffs);
}
printf("%s ", msg);
}
printStmtID(stmt);
printf(" ( ");
const DebugInfo& di = stmt->GetDebugInfo();
// For statements in the root we display just the location without the
// inline context info.
if (di.GetInlineContext() == nullptr || di.GetInlineContext()->IsRoot())
{
di.GetLocation().Dump();
}
else
{
stmt->GetDebugInfo().Dump(false);
}
printf(" ... ");

printf(" )");
IL_OFFSET lastILOffs = stmt->GetLastILOffset();
if (lastILOffs == BAD_IL_OFFSET)
{
printf("???");
}
else
{
printf("0x%03X", lastILOffs);
}

DebugInfo par;
if (stmt->GetDebugInfo().GetParent(&par))
{
printf(" <- ");
par.Dump(true);
}
printf(" )");

printf("\n");
DebugInfo par;
if (stmt->GetDebugInfo().GetParent(&par))
{
printf(" <- ");
par.Dump(true);
}
printf("\n");

gtDispTree(stmt->GetRootNode());
}

Expand Down

0 comments on commit e171360

Please sign in to comment.