From a4d545bdeeb3e8c613880944311be5420d42d1c4 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Fri, 19 Jul 2024 10:18:10 +0900 Subject: [PATCH 1/2] [compiler] printTerminal always prints instruction id Doing some debugging I noticed that a few of the newer terminals kinds weren't printing the instruction id. [ghstack-poisoned] --- .../src/HIR/PrintHIR.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts b/compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts index 43352166d4c..fd17822af0a 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/HIR/PrintHIR.ts @@ -276,27 +276,29 @@ export function printTerminal(terminal: Terminal): Array | string { break; } case 'unsupported': { - value = `Unsupported`; + value = `[${terminal.id}] Unsupported`; break; } case 'maybe-throw': { - value = `MaybeThrow continuation=bb${terminal.continuation} handler=bb${terminal.handler}`; + value = `[${terminal.id}] MaybeThrow continuation=bb${terminal.continuation} handler=bb${terminal.handler}`; break; } case 'scope': { - value = `Scope ${printReactiveScopeSummary(terminal.scope)} block=bb${ - terminal.block - } fallthrough=bb${terminal.fallthrough}`; + value = `[${terminal.id}] Scope ${printReactiveScopeSummary( + terminal.scope, + )} block=bb${terminal.block} fallthrough=bb${terminal.fallthrough}`; break; } case 'pruned-scope': { - value = ` Scope ${printReactiveScopeSummary( + value = `[${terminal.id}] Scope ${printReactiveScopeSummary( terminal.scope, )} block=bb${terminal.block} fallthrough=bb${terminal.fallthrough}`; break; } case 'try': { - value = `Try block=bb${terminal.block} handler=bb${terminal.handler}${ + value = `[${terminal.id}] Try block=bb${terminal.block} handler=bb${ + terminal.handler + }${ terminal.handlerBinding !== null ? ` handlerBinding=(${printPlace(terminal.handlerBinding)})` : '' From bf2ad1b2b3eb8a098e66c0c4b2785ecb9781ad2b Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Fri, 19 Jul 2024 10:23:45 +0900 Subject: [PATCH 2/2] Update on "[compiler] printTerminal always prints instruction id" Doing some debugging I noticed that a few of the newer terminals kinds weren't printing the instruction id. [ghstack-poisoned]