summaryrefslogtreecommitdiffstats
path: root/lld/wasm/WriterUtils.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-02-20 04:26:26 +0000
committerRui Ueyama <ruiu@google.com>2018-02-20 04:26:26 +0000
commitbf450d905deab93377c68ba796d8c9744fed8861 (patch)
tree21c42a324b39b13956154f7244e33206525a8fcd /lld/wasm/WriterUtils.cpp
parent41f64c3204e90b8d82ea06804f954e6624635ae1 (diff)
downloadbcm5719-llvm-bf450d905deab93377c68ba796d8c9744fed8861.tar.gz
bcm5719-llvm-bf450d905deab93377c68ba796d8c9744fed8861.zip
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
Diffstat (limited to 'lld/wasm/WriterUtils.cpp')
-rw-r--r--lld/wasm/WriterUtils.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/lld/wasm/WriterUtils.cpp b/lld/wasm/WriterUtils.cpp
index 561d970833f..a4537e436d1 100644
--- a/lld/wasm/WriterUtils.cpp
+++ b/lld/wasm/WriterUtils.cpp
@@ -162,23 +162,6 @@ void wasm::writeExport(raw_ostream &OS, const WasmExport &Export) {
fatal("unsupported export type: " + Twine(Export.Kind));
}
}
-
-void wasm::writeReloc(raw_ostream &OS, const OutputRelocation &Reloc) {
- writeUleb128(OS, Reloc.Reloc.Type, "reloc type");
- writeUleb128(OS, Reloc.Reloc.Offset, "reloc offset");
- writeUleb128(OS, Reloc.NewIndex, "reloc index");
-
- switch (Reloc.Reloc.Type) {
- case R_WEBASSEMBLY_MEMORY_ADDR_LEB:
- case R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
- case R_WEBASSEMBLY_MEMORY_ADDR_I32:
- writeUleb128(OS, Reloc.Reloc.Addend, "reloc addend");
- break;
- default:
- break;
- }
-}
-
} // namespace lld
std::string lld::toString(ValType Type) {
OpenPOWER on IntegriCloud