summaryrefslogtreecommitdiff
path: root/src/ir/block-utils.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-11-22 12:46:04 -0800
committerGitHub <noreply@github.com>2019-11-22 12:46:04 -0800
commite2587f30827cd3d35dd409c2958b25a6c5517092 (patch)
tree22a372a3986cbfbc6db09df45bffe00631083f69 /src/ir/block-utils.h
parenta0c423ef501ea7267c24c46e645296e713b2ea42 (diff)
downloadbinaryen-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/block-utils.h')
-rw-r--r--src/ir/block-utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir/block-utils.h b/src/ir/block-utils.h
index 120178a47..1ed9ee413 100644
--- a/src/ir/block-utils.h
+++ b/src/ir/block-utils.h
@@ -39,7 +39,7 @@ simplifyToContents(Block* block, T* parent, bool allowTypeChange = false) {
auto* singleton = list[0];
auto sideEffects =
EffectAnalyzer(parent->getPassOptions(), singleton).hasSideEffects();
- if (!sideEffects && !isConcreteType(singleton->type)) {
+ if (!sideEffects && !singleton->type.isConcrete()) {
// no side effects, and singleton is not returning a value, so we can
// throw away the block and its contents, basically
return Builder(*parent->getModule()).replaceWithIdenticalType(block);
@@ -50,7 +50,7 @@ simplifyToContents(Block* block, T* parent, bool allowTypeChange = false) {
// inside is unreachable (if both concrete, must match, and since no name
// on block, we can't be branched to, so if singleton is unreachable, so
// is the block)
- assert(isConcreteType(block->type) && singleton->type == unreachable);
+ assert(block->type.isConcrete() && singleton->type == unreachable);
// we could replace with unreachable, but would need to update all
// the parent's types
}