Do not create a temporary data structure for relocations.
authorRui Ueyama <ruiu@google.com>
Tue, 20 Feb 2018 04:26:26 +0000 (04:26 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 20 Feb 2018 04:26:26 +0000 (04:26 +0000)
commitbf450d905deab93377c68ba796d8c9744fed8861
tree21c42a324b39b13956154f7244e33206525a8fcd
parent41f64c3204e90b8d82ea06804f954e6624635ae1
Do not create a temporary data structure for relocations.

This patch removes `OutRelocations` vector from the InputChunk and
directly consume `Relocations` vector instead. This should make the linker
faster because we don't create a temporary data structure, and it matches
the lld's design principle that we don't create temporary data structures
for object files but instead directly consume mmap'ed data whenever possible.

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

llvm-svn: 325549
lld/wasm/InputChunks.cpp
lld/wasm/InputChunks.h
lld/wasm/OutputSections.cpp
lld/wasm/WriterUtils.cpp
lld/wasm/WriterUtils.h