diff options
author | Sam Clegg <sbc@chromium.org> | 2024-08-06 10:17:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-06 10:17:40 -0700 |
commit | 6fe3d885604bb053979f4e5adad2840ea936fd17 (patch) | |
tree | 551e57f5325df334d2fd01393053eb786ba25ef6 /src/parser | |
parent | e2e5b9cf70c8a81492db259e1a17294064a69157 (diff) | |
download | binaryen-6fe3d885604bb053979f4e5adad2840ea936fd17.tar.gz binaryen-6fe3d885604bb053979f4e5adad2840ea936fd17.tar.bz2 binaryen-6fe3d885604bb053979f4e5adad2840ea936fd17.zip |
Make source parser consistent with binary parser when naming things. NFC (#6813)
The `timport$` prefix is already used for tables, so the binary parser
currently uses `eimport$` to name tags (I guess because they are
normally exception tags?).
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/context-decls.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser/context-decls.cpp b/src/parser/context-decls.cpp index c5b212038..8e9638ae7 100644 --- a/src/parser/context-decls.cpp +++ b/src/parser/context-decls.cpp @@ -196,7 +196,8 @@ ParseDeclsCtx::addGlobalDecl(Index pos, Name name, ImportNames* importNames) { } g->setExplicitName(name); } else { - name = (importNames ? "gimport$" : "") + std::to_string(globalCounter++); + name = + (importNames ? "gimport$" : "global$") + std::to_string(globalCounter++); name = Names::getValidGlobalName(wasm, name); g->name = name; } @@ -276,7 +277,7 @@ ParseDeclsCtx::addTagDecl(Index pos, Name name, ImportNames* importNames) { } t->setExplicitName(name); } else { - name = (importNames ? "timport$" : "") + std::to_string(tagCounter++); + name = (importNames ? "eimport$" : "tag$") + std::to_string(tagCounter++); name = Names::getValidTagName(wasm, name); t->name = name; } |