diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-11-22 12:46:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-22 12:46:04 -0800 |
commit | e2587f30827cd3d35dd409c2958b25a6c5517092 (patch) | |
tree | 22a372a3986cbfbc6db09df45bffe00631083f69 /src/ir/ReFinalize.cpp | |
parent | a0c423ef501ea7267c24c46e645296e713b2ea42 (diff) | |
download | binaryen-e2587f30827cd3d35dd409c2958b25a6c5517092.tar.gz binaryen-e2587f30827cd3d35dd409c2958b25a6c5517092.tar.bz2 binaryen-e2587f30827cd3d35dd409c2958b25a6c5517092.zip |
Multivalue type creation and inspection (#2459)
Adds the ability to create multivalue types from vectors of concrete value
types. All types are transparently interned, so their representation is still a
single uint32_t. Types can be extracted into vectors of their component parts,
and all the single value types expand into vectors containing themselves.
Multivalue types are not yet used in the IR, but their creation and inspection
functionality is exposed and tested in the C and JS APIs.
Also makes common type predicates methods of Type and improves the ergonomics of
type printing.
Diffstat (limited to 'src/ir/ReFinalize.cpp')
-rw-r--r-- | src/ir/ReFinalize.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp index b27b49bd4..9ee109f5e 100644 --- a/src/ir/ReFinalize.cpp +++ b/src/ir/ReFinalize.cpp @@ -50,12 +50,12 @@ void ReFinalize::visitBlock(Block* curr) { curr->type = curr->list.back()->type; // if concrete, it doesn't matter if we have an unreachable child, and we // don't need to look at breaks - if (isConcreteType(curr->type)) { + if (curr->type.isConcrete()) { // make sure our branches make sense for us - we may have just made // ourselves concrete for a value flowing out, while branches did not send a // value. such branches could not have been actually taken before, that is, // there were in unreachable code, but we do still need to fix them up here. - if (!isConcreteType(old)) { + if (!old.isConcrete()) { auto iter = breakValues.find(curr->name); if (iter != breakValues.end()) { // there is a break to here @@ -210,7 +210,7 @@ void ReFinalize::replaceUntaken(Expression* value, Expression* condition) { // the value is unreachable, and necessary since the type of // the condition did not have an impact before (the break/switch // type was unreachable), and might not fit in. - if (isConcreteType(condition->type)) { + if (condition->type.isConcrete()) { condition = builder.makeDrop(condition); } replacement = builder.makeSequence(value, condition); |