diff options
author | Derek Schuff <dschuff@chromium.org> | 2017-08-24 12:43:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 12:43:12 -0700 |
commit | e60fcd0ba97ed75440c6f838619455be7a5e90a3 (patch) | |
tree | dbf187ed1eefcc9e16d5f5fac4be38b3fb539f94 /src/ast/effects.h | |
parent | b07fafcebebab82dba46012256edc6445862cfce (diff) | |
download | binaryen-e60fcd0ba97ed75440c6f838619455be7a5e90a3.tar.gz binaryen-e60fcd0ba97ed75440c6f838619455be7a5e90a3.tar.bz2 binaryen-e60fcd0ba97ed75440c6f838619455be7a5e90a3.zip |
Add support for atomic wait and wake operators (#1140)
According to spec at https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
Diffstat (limited to 'src/ast/effects.h')
-rw-r--r-- | src/ast/effects.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ast/effects.h b/src/ast/effects.h index 2db671b5e..1ae27d2a7 100644 --- a/src/ast/effects.h +++ b/src/ast/effects.h @@ -208,6 +208,24 @@ struct EffectAnalyzer : public PostWalker<EffectAnalyzer> { isAtomic = true; if (!ignoreImplicitTraps) implicitTrap = true; } + void visitAtomicWait(AtomicWait* curr) { + readsMemory = true; + // AtomicWait doesn't strictly write memory, but it does modify the waiters + // list associated with the specified address, which we can think of as a + // write. + writesMemory = true; + isAtomic = true; + if (!ignoreImplicitTraps) implicitTrap = true; + } + void visitAtomicWake(AtomicWake* curr) { + // AtomicWake doesn't strictly write memory, but it does modify the waiters + // list associated with the specified address, which we can think of as a + // write. + readsMemory = true; + writesMemory = true; + isAtomic = true; + if (!ignoreImplicitTraps) implicitTrap = true; + }; void visitUnary(Unary *curr) { if (!ignoreImplicitTraps) { switch (curr->op) { |