[WebAssembly] Optimise relocation processing. NFC.
authorSam Clegg <sbc@chromium.org>
Wed, 22 Aug 2018 17:50:51 +0000 (17:50 +0000)
committerSam Clegg <sbc@chromium.org>
Wed, 22 Aug 2018 17:50:51 +0000 (17:50 +0000)
commit47078f56f2150105f2b13c31ce6c373d34343c64
tree8057597dcde4928c9920c9536873973b055408c7
parenta65d943e334a861e446a153d1da1d0b54ae79f4f
[WebAssembly] Optimise relocation processing. NFC.

This is a rebased version https://reviews.llvm.org/D42176 which is patch
by Nicolas Wilson.

Addresses issue:
https://github.com/WebAssembly/tool-conventions/issues/32, and
https://bugs.llvm.org/show_bug.cgi?id=38650

Previously, for each function/segment we iterated over every relocation
to find the relevant ones, which is an n^2 operation. Now, we just make
a single pass.

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

llvm-svn: 340428
lld/wasm/InputChunks.cpp
lld/wasm/InputChunks.h
lld/wasm/InputFiles.cpp