summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-type.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index a7040b959..12b223707 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -372,7 +372,9 @@ template<typename Info> struct Store {
// Maps from constructed types to their canonical Type IDs.
std::unordered_map<std::reference_wrapper<const Info>, uintptr_t> typeIDs;
+#ifndef NDEBUG
bool isGlobalStore();
+#endif
TypeID recordCanonical(std::unique_ptr<Info>&& info);
typename Info::type_t canonicalize(const Info& info);
@@ -396,18 +398,24 @@ HeapTypeStore globalHeapTypeStore;
template<typename T> struct MetaTypeInfo {};
template<> struct MetaTypeInfo<Type> {
+#ifndef NDEBUG
constexpr static TypeStore& globalStore = globalTypeStore;
+#endif
static TypeInfo* getInfo(Type type) { return getTypeInfo(type); }
};
template<> struct MetaTypeInfo<HeapType> {
+#ifndef NDEBUG
constexpr static HeapTypeStore& globalStore = globalHeapTypeStore;
+#endif
static HeapTypeInfo* getInfo(HeapType ht) { return getHeapTypeInfo(ht); }
};
+#ifndef NDEBUG
template<typename Info> bool Store<Info>::isGlobalStore() {
return this == &MetaTypeInfo<typename Info::type_t>::globalStore;
}
+#endif
template<typename Info>
TypeID Store<Info>::recordCanonical(std::unique_ptr<Info>&& info) {