diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-06-19 23:06:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-19 23:06:27 -0700 |
commit | 9fc276298b36080658236f0bc93d94cdf774492c (patch) | |
tree | b60592556b9edf4bb2dcd40034cb760c504cf576 /src | |
parent | aae35755e1d047c1f6fba9abfd2d836feafa5f66 (diff) | |
download | binaryen-9fc276298b36080658236f0bc93d94cdf774492c.tar.gz binaryen-9fc276298b36080658236f0bc93d94cdf774492c.tar.bz2 binaryen-9fc276298b36080658236f0bc93d94cdf774492c.zip |
Remove (attr 0) from tag text format (#3946)
This attribute is always 0 and reserved for future use. In Binayren's
unofficial text format we were writing this field as `(attr 0)`, but we
have recently come to the conclusion that this is not necessary.
Relevant discussion:
https://github.com/WebAssembly/exception-handling/pull/160#discussion_r653254680
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 4 | ||||
-rw-r--r-- | src/shared-constants.h | 1 | ||||
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 22 | ||||
-rw-r--r-- | src/wasm/wasm.cpp | 1 |
4 files changed, 2 insertions, 26 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 750bfbb38..c6bf13f42 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2685,7 +2685,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { emitImportHeader(curr); o << "(tag "; printName(curr->name, o); - o << maybeSpace << "(attr " << curr->attribute << ')' << maybeSpace; + o << maybeSpace; printParamType(o, curr->sig.params, currModule); o << "))"; o << maybeNewLine; @@ -2695,7 +2695,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { o << '('; printMedium(o, "tag "); printName(curr->name, o); - o << maybeSpace << "(attr " << curr->attribute << ')' << maybeSpace; + o << maybeSpace; printParamType(o, curr->sig.params, currModule); o << ")" << maybeNewLine; } diff --git a/src/shared-constants.h b/src/shared-constants.h index a0de4b9bb..6ad3ab9ac 100644 --- a/src/shared-constants.h +++ b/src/shared-constants.h @@ -66,7 +66,6 @@ extern Name PRINT; extern Name EXIT; extern Name SHARED; extern Name TAG; -extern Name ATTR; } // namespace wasm diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index c688630c3..8bedeab9f 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -3109,14 +3109,6 @@ void SExpressionWasmBuilder::parseImport(Element& s) { } } else if (kind == ExternalKind::Tag) { auto tag = make_unique<Tag>(); - if (j >= inner.size()) { - throw ParseException("tag does not have an attribute", s.line, s.col); - } - auto& attrElem = *inner[j++]; - if (!elementStartsWith(attrElem, ATTR) || attrElem.size() != 2) { - throw ParseException("invalid attribute", attrElem.line, attrElem.col); - } - tag->attribute = atoi(attrElem[1]->c_str()); j = parseTypeUse(inner, j, tag->sig); tag->setName(name, hasExplicitName); tag->module = module; @@ -3498,20 +3490,6 @@ void SExpressionWasmBuilder::parseTag(Element& s, bool preParseImport) { ex->kind = ExternalKind::Tag; } - // Parse attribute - if (i >= s.size()) { - throw ParseException("tag does not have an attribute", s.line, s.col); - } - auto& attrElem = *s[i++]; - if (!elementStartsWith(attrElem, ATTR) || attrElem.size() != 2) { - throw ParseException("invalid attribute", attrElem.line, attrElem.col); - } - if (!attrElem[1]->isStr()) { - throw ParseException( - "invalid attribute", attrElem[1]->line, attrElem[1]->col); - } - tag->attribute = atoi(attrElem[1]->c_str()); - // Parse typeuse i = parseTypeUse(s, i, tag->sig); diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index ea82bac39..54c82159f 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -97,7 +97,6 @@ Name PRINT("print"); Name EXIT("exit"); Name SHARED("shared"); Name TAG("tag"); -Name ATTR("attr"); // Expressions |