summaryrefslogtreecommitdiff
path: root/src/ir/possible-contents.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-06-29 16:05:10 -0700
committerGitHub <noreply@github.com>2022-06-29 16:05:10 -0700
commit19f4db6ef5263a578baef7e64bf9c9169bb771e6 (patch)
treed9608e8483415332b744701a714ec83d8e8009fb /src/ir/possible-contents.cpp
parentd252c3e9e5dee98150c5ac625b6deb0e95139ede (diff)
downloadbinaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.tar.gz
binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.tar.bz2
binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.zip
[Strings] Add string.new* instructions (#4761)
This is the first instruction from the Strings proposal. This includes everything but interpreter support.
Diffstat (limited to 'src/ir/possible-contents.cpp')
-rw-r--r--src/ir/possible-contents.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index 94c22aacc..d10f2b4ac 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -672,6 +672,13 @@ struct InfoCollector
visitArraySet(set);
}
+ void visitStringNew(StringNew* curr) {
+ if (curr->type == Type::unreachable) {
+ return;
+ }
+ addRoot(curr, PossibleContents::exactType(curr->type));
+ }
+
// TODO: Model which throws can go to which catches. For now, anything thrown
// is sent to the location of that tag, and any catch of that tag can
// read them.