From d8dc55ceafff2c3b92d7d3e6434d56d346f8913b Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 16 Apr 2024 16:27:50 -0700 Subject: [Parser] Match legacy parser block naming (#6504) To reduce the size of the test output diff when switching to the new text parser, update it to generate the same block names as the legacy parser. --- src/wasm/wasm-ir-builder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/wasm/wasm-ir-builder.cpp') diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index bee858435..78ce07f8d 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -1035,7 +1035,11 @@ Result IRBuilder::getLabelName(Index label) { auto& scopeLabel = (*scope)->label; if (!scopeLabel) { // The scope does not already have a name, so we need to create one. - scopeLabel = makeFresh("label"); + if ((*scope)->getBlock()) { + scopeLabel = makeFresh("block"); + } else { + scopeLabel = makeFresh("label"); + } } (*scope)->labelUsed = true; return scopeLabel; -- cgit v1.2.3