const CodeGenInterface* codeGen) const
{
codeGen->dumpSiVarLoc(&m_VarLocation);
- printf(" [ ");
+
+ printf(" [");
m_StartEmitLocation.Print(codeGen->GetCompiler()->compMethodID);
printf(", ");
if (m_EndEmitLocation.Valid())
}
else
{
- printf("NON_CLOSED_RANGE");
+ printf("...");
}
- printf(" ]; ");
+ printf("]");
}
// Dump "VariableLiveRange" when code has been generated and we have the assembly native offset of each "emitLocation"
// If this is an open "VariableLiveRange", "m_EndEmitLocation" is non-valid and print -1
UNATIVE_OFFSET endAssemblyOffset = m_EndEmitLocation.Valid() ? m_EndEmitLocation.CodeOffset(emit) : -1;
- printf(" [%X , %X )", m_StartEmitLocation.CodeOffset(emit), m_EndEmitLocation.CodeOffset(emit));
+ printf(" [%X, %X)", m_StartEmitLocation.CodeOffset(emit), m_EndEmitLocation.CodeOffset(emit));
}
//------------------------------------------------------------------------
void CodeGenInterface::VariableLiveKeeper::VariableLiveDescriptor::dumpAllRegisterLiveRangesForBlock(
emitter* emit, const CodeGenInterface* codeGen) const
{
- printf("[");
+ bool first = true;
for (LiveRangeListIterator it = m_VariableLiveRanges->begin(); it != m_VariableLiveRanges->end(); it++)
{
+ if (!first)
+ {
+ printf("; ");
+ }
it->dumpVariableLiveRange(emit, codeGen);
+ first = false;
}
- printf("]\n");
}
void CodeGenInterface::VariableLiveKeeper::VariableLiveDescriptor::dumpRegisterLiveRangesForBlockBeforeCodeGenerated(
const CodeGenInterface* codeGen) const
{
- noway_assert(codeGen != nullptr);
-
- printf("[");
+ bool first = true;
for (LiveRangeListIterator it = m_VariableLifeBarrier->getStartForDump(); it != m_VariableLiveRanges->end(); it++)
{
+ if (!first)
+ {
+ printf("; ");
+ }
it->dumpVariableLiveRange(codeGen);
+ first = false;
}
- printf("]\n");
}
// Returns true if a live range for this variable has been recorded
#ifdef DEBUG
void CodeGenInterface::VariableLiveKeeper::dumpBlockVariableLiveRanges(const BasicBlock* block)
{
- // "block" will be dereferenced
- noway_assert(block != nullptr);
+ assert(block != nullptr);
bool hasDumpedHistory = false;
- if (m_Compiler->verbose)
- {
- printf("////////////////////////////////////////\n");
- printf("////////////////////////////////////////\n");
- printf("Variable Live Range History Dump for Block %d \n", block->bbNum);
+ printf("\nVariable Live Range History Dump for " FMT_BB "\n", block->bbNum);
- if (m_Compiler->opts.compDbgInfo)
+ if (m_Compiler->opts.compDbgInfo)
+ {
+ for (unsigned int varNum = 0; varNum < m_LiveDscCount; varNum++)
{
- for (unsigned int varNum = 0; varNum < m_LiveDscCount; varNum++)
- {
- VariableLiveDescriptor* varLiveDsc = m_vlrLiveDsc + varNum;
+ VariableLiveDescriptor* varLiveDsc = m_vlrLiveDsc + varNum;
- if (varLiveDsc->hasVarLiveRangesFromLastBlockToDump())
- {
- hasDumpedHistory = true;
- printf("IL Var Num %d:\n", m_Compiler->compMap2ILvarNum(varNum));
- varLiveDsc->dumpRegisterLiveRangesForBlockBeforeCodeGenerated(m_Compiler->codeGen);
- varLiveDsc->endBlockLiveRanges();
- }
+ if (varLiveDsc->hasVarLiveRangesFromLastBlockToDump())
+ {
+ hasDumpedHistory = true;
+ m_Compiler->gtDispLclVar(varNum, false);
+ printf(": ");
+ varLiveDsc->dumpRegisterLiveRangesForBlockBeforeCodeGenerated(m_Compiler->codeGen);
+ varLiveDsc->endBlockLiveRanges();
+ printf("\n");
}
}
+ }
- if (!hasDumpedHistory)
- {
- printf("..None..\n");
- }
-
- printf("////////////////////////////////////////\n");
- printf("////////////////////////////////////////\n");
- printf("End Generating code for Block %d \n", block->bbNum);
+ if (!hasDumpedHistory)
+ {
+ printf("..None..\n");
}
}
{
bool hasDumpedHistory = false;
- if (m_Compiler->verbose)
- {
- printf("////////////////////////////////////////\n");
- printf("////////////////////////////////////////\n");
- printf("PRINTING VARIABLE LIVE RANGES:\n");
+ printf("VARIABLE LIVE RANGES:\n");
- if (m_Compiler->opts.compDbgInfo)
+ if (m_Compiler->opts.compDbgInfo)
+ {
+ for (unsigned int varNum = 0; varNum < m_LiveDscCount; varNum++)
{
- for (unsigned int varNum = 0; varNum < m_LiveDscCount; varNum++)
- {
- VariableLiveDescriptor* varLiveDsc = m_vlrLiveDsc + varNum;
+ VariableLiveDescriptor* varLiveDsc = m_vlrLiveDsc + varNum;
- if (varLiveDsc->hasVarLiveRangesToDump())
- {
- hasDumpedHistory = true;
- printf("IL Var Num %d:\n", m_Compiler->compMap2ILvarNum(varNum));
- varLiveDsc->dumpAllRegisterLiveRangesForBlock(m_Compiler->GetEmitter(), m_Compiler->codeGen);
- }
+ if (varLiveDsc->hasVarLiveRangesToDump())
+ {
+ hasDumpedHistory = true;
+ m_Compiler->gtDispLclVar(varNum, false);
+ printf(": ");
+ varLiveDsc->dumpAllRegisterLiveRangesForBlock(m_Compiler->GetEmitter(), m_Compiler->codeGen);
+ printf("\n");
}
}
+ }
- if (!hasDumpedHistory)
- {
- printf("..None..\n");
- }
-
- printf("////////////////////////////////////////\n");
- printf("////////////////////////////////////////\n");
+ if (!hasDumpedHistory)
+ {
+ printf("..None..\n");
}
}
#endif // DEBUG