[WebAssembly] Simplify generation of "names" section
authorSam Clegg <sbc@chromium.org>
Wed, 17 Jan 2018 20:19:04 +0000 (20:19 +0000)
committerSam Clegg <sbc@chromium.org>
Wed, 17 Jan 2018 20:19:04 +0000 (20:19 +0000)
commit1963d71cb8b8b4e66d71d83cde3d23f059386bcc
treed5569898cfbdf1db3ccfdeb2924a7718c49a6e75
parent6d83f34afdb0833ae5d7173daf0f8e009e95afa0
[WebAssembly] Simplify generation of "names" section

Simplify generation of "names" section by simply iterating
over the DefinedFunctions array.

This even fixes some bugs, judging by the test changes required.
Some tests are asserting that functions are named multiple times,
other tests are asserting that the "names" section contains the
function's alias rather than its original name

Patch by Nicholas Wilson!

Differential Revision: https://reviews.llvm.org/D42076

llvm-svn: 322751
lld/test/wasm/alias.ll
lld/test/wasm/relocatable.ll
lld/test/wasm/weak-symbols.ll
lld/wasm/InputChunks.h
lld/wasm/Symbols.h
lld/wasm/Writer.cpp