diff options
Diffstat (limited to 'src/ir/possible-contents.h')
-rw-r--r-- | src/ir/possible-contents.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ir/possible-contents.h b/src/ir/possible-contents.h index 5ec4f758f..7b88483cf 100644 --- a/src/ir/possible-contents.h +++ b/src/ir/possible-contents.h @@ -473,6 +473,15 @@ struct TagLocation { } }; +// The location of an exnref materialized by a catch_ref or catch_all_ref clause +// of a try_table. No data is stored here. exnrefs contain a tag and a payload +// at run-time, as well as potential metadata such as stack traces, but we don't +// track that. So this is the same as NullLocation in a way: we just need *a* +// source of contents for places that receive an exnref. +struct CaughtExnRefLocation { + bool operator==(const CaughtExnRefLocation& other) const { return true; } +}; + // A null value. This is used as the location of the default value of a var in a // function, a null written to a struct field in struct.new_with_default, etc. struct NullLocation { @@ -520,6 +529,7 @@ using Location = std::variant<ExpressionLocation, SignatureResultLocation, DataLocation, TagLocation, + CaughtExnRefLocation, NullLocation, ConeReadLocation>; @@ -608,6 +618,12 @@ template<> struct hash<wasm::TagLocation> { } }; +template<> struct hash<wasm::CaughtExnRefLocation> { + size_t operator()(const wasm::CaughtExnRefLocation& loc) const { + return std::hash<const char*>()("caught-exnref-location"); + } +}; + template<> struct hash<wasm::NullLocation> { size_t operator()(const wasm::NullLocation& loc) const { return std::hash<wasm::Type>{}(loc.type); |