diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-01-08 17:43:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 17:43:25 -0800 |
commit | 77329439d6307d292e59986db3a194c3085abbe2 (patch) | |
tree | ac9f4ad3787f2e0d3644d34ff324a546380a17fd /src/passes/OptimizeInstructions.cpp | |
parent | 8d4db9fb86c3b80df3eaa0d8e5eb379d081c8399 (diff) | |
download | binaryen-77329439d6307d292e59986db3a194c3085abbe2.tar.gz binaryen-77329439d6307d292e59986db3a194c3085abbe2.tar.bz2 binaryen-77329439d6307d292e59986db3a194c3085abbe2.zip |
Remove implicit conversion operators from Type (#2577)
* Remove implicit conversion operators from Type
Now types must be explicitly converted to uint32_t with Type::getID or
to ValueType with Type::getVT. This fixes #2572 for switches that use
Type::getVT.
* getVT => getSingle
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r-- | src/passes/OptimizeInstructions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 2372df462..ef7c17000 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -53,7 +53,7 @@ Name ANY_EXPR = "any.expr"; template<typename LocalInfoProvider> Index getMaxBits(Expression* curr, LocalInfoProvider* localInfoProvider) { if (auto* const_ = curr->dynCast<Const>()) { - switch (curr->type) { + switch (curr->type.getSingle()) { case Type::i32: return 32 - const_->value.countLeadingZeroes().geti32(); case Type::i64: @@ -178,7 +178,7 @@ Index getMaxBits(Expression* curr, LocalInfoProvider* localInfoProvider) { return 8 * load->bytes; } } - switch (curr->type) { + switch (curr->type.getSingle()) { case Type::i32: return 32; case Type::i64: @@ -260,7 +260,7 @@ struct LocalScanner : PostWalker<LocalScanner> { Index getMaxBitsForLocal(LocalGet* get) { return getBitsForType(get->type); } Index getBitsForType(Type type) { - switch (type) { + switch (type.getSingle()) { case Type::i32: return 32; case Type::i64: |