Index: src/wasm/module-decoder.cc |
diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc |
index e0b3bba1e1aecef26ff973feb4b71f5c7c68536a..ee211ad57e2fff003dae3f398150e33979104903 100644 |
--- a/src/wasm/module-decoder.cc |
+++ b/src/wasm/module-decoder.cc |
@@ -28,6 +28,39 @@ namespace wasm { |
#define TRACE(...) |
#endif |
+const char* SectionName(WasmSectionCode code) { |
+ switch (code) { |
+ case kUnknownSectionCode: |
+ return "Unknown"; |
+ case kTypeSectionCode: |
+ return "Type"; |
+ case kImportSectionCode: |
+ return "Import"; |
+ case kFunctionSectionCode: |
+ return "Function"; |
+ case kTableSectionCode: |
+ return "Table"; |
+ case kMemorySectionCode: |
+ return "Memory"; |
+ case kGlobalSectionCode: |
+ return "Global"; |
+ case kExportSectionCode: |
+ return "Export"; |
+ case kStartSectionCode: |
+ return "Start"; |
+ case kCodeSectionCode: |
+ return "Code"; |
+ case kElementSectionCode: |
+ return "Element"; |
+ case kDataSectionCode: |
+ return "Data"; |
+ case kNameSectionCode: |
+ return "Name"; |
+ default: |
+ return "<unknown>"; |
+ } |
+} |
+ |
namespace { |
const char* kNameString = "name"; |