summaryrefslogtreecommitdiff
path: root/src/ir/possible-contents.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/possible-contents.h')
-rw-r--r--src/ir/possible-contents.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ir/possible-contents.h b/src/ir/possible-contents.h
index 2fd6c39c7..2773c1d31 100644
--- a/src/ir/possible-contents.h
+++ b/src/ir/possible-contents.h
@@ -380,6 +380,15 @@ struct ParamLocation {
}
};
+// The location of a value in a local.
+struct LocalLocation {
+ Function* func;
+ Index index;
+ bool operator==(const LocalLocation& other) const {
+ return func == other.func && index == other.index;
+ }
+};
+
// The location of one of the results of a function.
struct ResultLocation {
Function* func;
@@ -494,6 +503,7 @@ struct ConeReadLocation {
// have.
using Location = std::variant<ExpressionLocation,
ParamLocation,
+ LocalLocation,
ResultLocation,
BreakTargetLocation,
GlobalLocation,
@@ -534,6 +544,13 @@ template<> struct hash<wasm::ParamLocation> {
}
};
+template<> struct hash<wasm::LocalLocation> {
+ size_t operator()(const wasm::LocalLocation& loc) const {
+ return std::hash<std::pair<size_t, wasm::Index>>{}(
+ {size_t(loc.func), loc.index});
+ }
+};
+
template<> struct hash<wasm::ResultLocation> {
size_t operator()(const wasm::ResultLocation& loc) const {
return std::hash<std::pair<size_t, wasm::Index>>{}(