Skip to content

Commit 36e32f8

Browse files
authored
[JIT] Added BEGIN and END anchors for disasm output (#88782)
* Added BEGIN and END anchors for disasm output * Fixing build * Feedback
1 parent 62d6335 commit 36e32f8

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/coreclr/jit/codegencommon.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,6 +1966,11 @@ void CodeGen::genEmitMachineCode()
19661966
trackedStackPtrsContig = !compiler->opts.compDbgEnC;
19671967
#endif
19681968

1969+
if (compiler->opts.disAsm)
1970+
{
1971+
printf("; BEGIN METHOD %s\n", compiler->eeGetMethodFullName(compiler->info.compMethodHnd));
1972+
}
1973+
19691974
codeSize = GetEmitter()->emitEndCodeGen(compiler, trackedStackPtrsContig, GetInterruptible(),
19701975
IsFullPtrRegMapRequired(), compiler->compHndBBtabCount, &prologSize,
19711976
&epilogSize, codePtr, &coldCodePtr, &consPtr DEBUGARG(&instrCount));
@@ -1985,6 +1990,11 @@ void CodeGen::genEmitMachineCode()
19851990
((double)compiler->info.compTotalColdCodeSize * (double)PERFSCORE_CODESIZE_COST_COLD);
19861991
#endif // DEBUG || LATE_DISASM
19871992

1993+
if (compiler->opts.disAsm)
1994+
{
1995+
printf("; END METHOD %s\n", compiler->eeGetMethodFullName(compiler->info.compMethodHnd));
1996+
}
1997+
19881998
#ifdef DEBUG
19891999
if (compiler->opts.disAsm || verbose)
19902000
{

src/coreclr/tools/SuperFileCheck/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ static string PreProcessMethod(MethodDeclarationInfo methodDeclInfo, string[] ch
391391
var methodName = methodDeclInfo.FullyQualifiedName.Replace("*", "{{.*}}"); // Change wild-card to FileCheck wild-card syntax.
392392

393393
// Create anchors from the first prefix.
394-
var startAnchorText = $"// {checkPrefixes[0]}-LABEL: for method {methodName}";
395-
var endAnchorText = $"// {checkPrefixes[0]}: for method {methodName}";
394+
var beginAnchorText = $"// {checkPrefixes[0]}-LABEL: BEGIN METHOD {methodName}";
395+
var endAnchorText = $"// {checkPrefixes[0]}: END METHOD {methodName}";
396396

397397
// Create temp source file based on the source text of the method.
398398
// Newlines are added to pad the text so FileCheck's error messages will correspond
@@ -404,7 +404,7 @@ static string PreProcessMethod(MethodDeclarationInfo methodDeclInfo, string[] ch
404404
{
405405
tmpSrc.AppendLine(String.Empty);
406406
}
407-
tmpSrc.AppendLine(startAnchorText);
407+
tmpSrc.AppendLine(beginAnchorText);
408408
tmpSrc.AppendLine(TransformMethod(methodDecl, checkPrefixes));
409409
tmpSrc.AppendLine(endAnchorText);
410410

0 commit comments

Comments
 (0)