diff options
Diffstat (limited to 'src/binary.h')
-rw-r--r-- | src/binary.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/binary.h b/src/binary.h index eee09f66..747c28e2 100644 --- a/src/binary.h +++ b/src/binary.h @@ -41,6 +41,7 @@ V(Export, export, 7) \ V(Start, start, 8) \ V(Elem, elem, 9) \ + V(DataCount, data_count, 12) \ V(Code, code, 10) \ V(Data, data, 11) @@ -51,14 +52,23 @@ enum class BinarySection { #define V(Name, name, code) Name = code, WABT_FOREACH_BINARY_SECTION(V) #undef V - Invalid, + Invalid = ~0, First = Custom, - Last = Data, + Last = DataCount, }; /* clang-format on */ static const int kBinarySectionCount = WABT_ENUM_COUNT(BinarySection); +enum class BinarySectionOrder { +#define V(Name, name, code) Name, + WABT_FOREACH_BINARY_SECTION(V) +#undef V +}; + +BinarySectionOrder GetSectionOrder(BinarySection); +const char* GetSectionName(BinarySection); + enum class NameSectionSubsection { Module = 0, Function = 1, @@ -71,13 +81,6 @@ enum class SegmentFlags : uint8_t { IndexOther = 2, }; -extern const char* g_section_name[]; - -static WABT_INLINE const char* GetSectionName(BinarySection sec) { - assert(static_cast<int>(sec) < kBinarySectionCount); - return g_section_name[static_cast<size_t>(sec)]; -} - } // namespace wabt #endif /* WABT_BINARY_H_ */ |