diff options
author | Alon Zakai <azakai@google.com> | 2021-01-28 22:09:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 14:09:31 -0800 |
commit | 6299471584ce74d365526e33ed0a662bd2ee3490 (patch) | |
tree | d3aa2132d0897ea84bacab31c4e424780009efad /src/ir/effects.h | |
parent | 53c471a445ef26eac7befc3f3a5e0a53870df8cb (diff) | |
download | binaryen-6299471584ce74d365526e33ed0a662bd2ee3490.tar.gz binaryen-6299471584ce74d365526e33ed0a662bd2ee3490.tar.bz2 binaryen-6299471584ce74d365526e33ed0a662bd2ee3490.zip |
[GC] Add br_on_func/data/i31 (#3525)
This expands the existing BrOnCast into BrOn that can also handle the
func/data/i31 variants. This is not as elegant as RefIs / RefAs in that BrOnCast
has an extra rtt field, but I think it is still the best option. We already have optional
fields on Break (the value and condition), so making rtt optional is not odd. And
it allows us to share all the behavior of br_on_* which aside from the cast or the
check itself, is identical - returning the value if the branch is not taken, etc.
Diffstat (limited to 'src/ir/effects.h')
-rw-r--r-- | src/ir/effects.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index ca440ce51..c7142dc34 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -565,9 +565,7 @@ private: // Traps if the ref is not null and it has an invalid rtt. parent.implicitTrap = true; } - void visitBrOnCast(BrOnCast* curr) { - parent.breakTargets.insert(curr->name); - } + void visitBrOn(BrOn* curr) { parent.breakTargets.insert(curr->name); } void visitRttCanon(RttCanon* curr) {} void visitRttSub(RttSub* curr) {} void visitStructNew(StructNew* curr) {} |