summaryrefslogtreecommitdiff
path: root/src/passes/Heap2Local.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-12-20 17:45:47 -0800
committerGitHub <noreply@github.com>2024-12-21 01:45:47 +0000
commit6ddacde514af7cc546caa07fede4baa3e429c33c (patch)
tree3436a22906ae3b94d3308e738a31d3db559bf246 /src/passes/Heap2Local.cpp
parent4d8a933e1136159160f2b45ad3a9a1c82021a75b (diff)
downloadbinaryen-6ddacde514af7cc546caa07fede4baa3e429c33c.tar.gz
binaryen-6ddacde514af7cc546caa07fede4baa3e429c33c.tar.bz2
binaryen-6ddacde514af7cc546caa07fede4baa3e429c33c.zip
[NFC] Make MemoryOrder parameters non-optional (#7171)
Update Builder and IRBuilder makeStructGet and makeStructSet functions to require the memory order to be explicitly supplied. This is slightly more verbose, but will reduce the chances that we forget to properly consider synchronization when implementing new features in the future.
Diffstat (limited to 'src/passes/Heap2Local.cpp')
-rw-r--r--src/passes/Heap2Local.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/passes/Heap2Local.cpp b/src/passes/Heap2Local.cpp
index a6223d4fc..b050c4a76 100644
--- a/src/passes/Heap2Local.cpp
+++ b/src/passes/Heap2Local.cpp
@@ -1066,7 +1066,9 @@ struct Array2Struct : PostWalker<Array2Struct> {
}
// Convert the ArraySet into a StructSet.
- replaceCurrent(builder.makeStructSet(index, curr->ref, curr->value));
+ // TODO: Handle atomic array accesses.
+ replaceCurrent(builder.makeStructSet(
+ index, curr->ref, curr->value, MemoryOrder::Unordered));
}
void visitArrayGet(ArrayGet* curr) {
@@ -1085,8 +1087,9 @@ struct Array2Struct : PostWalker<Array2Struct> {
}
// Convert the ArrayGet into a StructGet.
- replaceCurrent(
- builder.makeStructGet(index, curr->ref, curr->type, curr->signed_));
+ // TODO: Handle atomic array accesses.
+ replaceCurrent(builder.makeStructGet(
+ index, curr->ref, MemoryOrder::Unordered, curr->type, curr->signed_));
}
// Some additional operations need special handling