diff options
author | Sam Clegg <sbc@chromium.org> | 2016-12-05 10:54:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-05 10:54:02 -0800 |
commit | 538f5e61d10b19a0d7283e765589432bbeedcfa8 (patch) | |
tree | 19942e3751ed008e88e8e903f1fc375c1610838e /src/binary-writer.c | |
parent | 06f824b34df0a953ad7969db95c28d93c0c41cd5 (diff) | |
download | wabt-538f5e61d10b19a0d7283e765589432bbeedcfa8.tar.gz wabt-538f5e61d10b19a0d7283e765589432bbeedcfa8.tar.bz2 wabt-538f5e61d10b19a0d7283e765589432bbeedcfa8.zip |
Add wasm_get_section_name to binary.h (#232)
This function is also useful for the linker proof-of-concept
I'm working on.
Diffstat (limited to 'src/binary-writer.c')
-rw-r--r-- | src/binary-writer.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/binary-writer.c b/src/binary-writer.c index c71ea75a..7d89792c 100644 --- a/src/binary-writer.c +++ b/src/binary-writer.c @@ -36,10 +36,6 @@ #define ALLOC_FAILURE \ fprintf(stderr, "%s:%d: allocation failed\n", __FILE__, __LINE__) -#define V(NAME, code) [code] = #NAME, -static const char* s_section_name[] = {WASM_FOREACH_BINARY_SECTION(V)}; -#undef V - typedef struct Context { WasmAllocator* allocator; WasmStream stream; @@ -228,7 +224,7 @@ static void begin_known_section(Context* ctx, assert(ctx->last_section_leb_size_guess == 0); char desc[100]; wasm_snprintf(desc, sizeof(desc), "section \"%s\" (%u)", - s_section_name[section_code], section_code); + wasm_get_section_name(section_code), section_code); write_header(ctx, desc, PRINT_HEADER_NO_INDEX); wasm_write_u8(&ctx->stream, section_code, "section code"); ctx->last_section_leb_size_guess = leb_size_guess; |