diff options
author | Thomas Lively <tlively@google.com> | 2024-04-16 16:27:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-16 16:27:50 -0700 |
commit | d8dc55ceafff2c3b92d7d3e6434d56d346f8913b (patch) | |
tree | 0ccde7ed745a2d3fc54358cfadb2b38d933a5b36 /src/wasm/wasm-ir-builder.cpp | |
parent | 359d5aa30ca8349fd38e6968350e7ab4280c1cbb (diff) | |
download | binaryen-d8dc55ceafff2c3b92d7d3e6434d56d346f8913b.tar.gz binaryen-d8dc55ceafff2c3b92d7d3e6434d56d346f8913b.tar.bz2 binaryen-d8dc55ceafff2c3b92d7d3e6434d56d346f8913b.zip |
[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.
Diffstat (limited to 'src/wasm/wasm-ir-builder.cpp')
-rw-r--r-- | src/wasm/wasm-ir-builder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<Name> 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; |