From 7c7087811eaf7db5e783c35527be73bfb35b599e Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Tue, 23 Jul 2024 10:07:49 +0900 Subject: [PATCH] [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-source-id: e0e4c96aeefdfe09d3be1527fd7103b4e506eb8e Pull Request resolved: https://github.com/facebook/react/pull/30397 --- .../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 43352166d4..fd17822af0 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)})` : ''