diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-01-07 11:16:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-07 11:16:44 -0800 |
commit | e8f9d207427bda2f6e22c28ff0210b294b1f70e1 (patch) | |
tree | 503b20fb06274e38af7e25e3a1a4106827c52693 /src/passes/Print.cpp | |
parent | f73b40c7873dbd2dd46a962f3afe5b97a7fc8b0a (diff) | |
download | binaryen-e8f9d207427bda2f6e22c28ff0210b294b1f70e1.tar.gz binaryen-e8f9d207427bda2f6e22c28ff0210b294b1f70e1.tar.bz2 binaryen-e8f9d207427bda2f6e22c28ff0210b294b1f70e1.zip |
[NFC] Enforce use of `Type::` on type names (#2434)
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 549aa661d..106966ef1 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -89,7 +89,9 @@ std::ostream& operator<<(std::ostream& os, SigName sigName) { // Printing "unreachable" as a instruction prefix type is not valid in wasm text // format. Print something else to make it pass. -static Type forceConcrete(Type type) { return type.isConcrete() ? type : i32; } +static Type forceConcrete(Type type) { + return type.isConcrete() ? type : Type::i32; +} // Prints the internal contents of an expression: everything but // the children. @@ -186,7 +188,8 @@ struct PrintExpressionContents o << ".atomic"; } o << ".load"; - if (curr->type != unreachable && curr->bytes < curr->type.getByteSize()) { + if (curr->type != Type::unreachable && + curr->bytes < curr->type.getByteSize()) { if (curr->bytes == 1) { o << '8'; } else if (curr->bytes == 2) { @@ -212,7 +215,7 @@ struct PrintExpressionContents o << ".atomic"; } o << ".store"; - if (curr->bytes < 4 || (curr->valueType == i64 && curr->bytes < 8)) { + if (curr->bytes < 4 || (curr->valueType == Type::i64 && curr->bytes < 8)) { if (curr->bytes == 1) { o << '8'; } else if (curr->bytes == 2) { @@ -233,7 +236,7 @@ struct PrintExpressionContents } static void printRMWSize(std::ostream& o, Type type, uint8_t bytes) { prepareColor(o) << forceConcrete(type) << ".atomic.rmw"; - if (type != unreachable && bytes != type.getByteSize()) { + if (type != Type::unreachable && bytes != type.getByteSize()) { if (bytes == 1) { o << '8'; } else if (bytes == 2) { @@ -269,7 +272,8 @@ struct PrintExpressionContents o << "xchg"; break; } - if (curr->type != unreachable && curr->bytes != curr->type.getByteSize()) { + if (curr->type != Type::unreachable && + curr->bytes != curr->type.getByteSize()) { o << "_u"; } restoreNormalColor(o); @@ -281,7 +285,8 @@ struct PrintExpressionContents prepareColor(o); printRMWSize(o, curr->type, curr->bytes); o << "cmpxchg"; - if (curr->type != unreachable && curr->bytes != curr->type.getByteSize()) { + if (curr->type != Type::unreachable && + curr->bytes != curr->type.getByteSize()) { o << "_u"; } restoreNormalColor(o); |