diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-26 10:03:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-26 10:03:55 -0700 |
commit | 62ed39b5806e75c3c8835b6d996cd3b07a6cec23 (patch) | |
tree | d7393534101e2cce44f8db2016bcb77b2119a798 /src | |
parent | 1db57d5b4275a107f43e29c16a4e87a9abd15845 (diff) | |
download | binaryen-62ed39b5806e75c3c8835b6d996cd3b07a6cec23.tar.gz binaryen-62ed39b5806e75c3c8835b6d996cd3b07a6cec23.tar.bz2 binaryen-62ed39b5806e75c3c8835b6d996cd3b07a6cec23.zip |
BreakSeeker needs to look at br_table too
Diffstat (limited to 'src')
-rw-r--r-- | src/ast_utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ast_utils.h b/src/ast_utils.h index 5cda48578..55499d808 100644 --- a/src/ast_utils.h +++ b/src/ast_utils.h @@ -32,6 +32,12 @@ struct BreakSeeker : public PostWalker<BreakSeeker, Visitor<BreakSeeker>> { if (curr->name == target) found++; } + void visitSwitch(Switch *curr) { + for (auto name : curr->targets) { + if (name == target) found++; + } + } + static bool has(Expression* tree, Name target) { BreakSeeker breakSeeker(target); breakSeeker.walk(tree); |