[JITLink][NFC] Add TableManager to replace PerGraph...Builder pass
authorluxufan <932494295@qq.com>
Wed, 6 Oct 2021 07:52:25 +0000 (15:52 +0800)
committerluxufan <932494295@qq.com>
Wed, 6 Oct 2021 13:24:34 +0000 (21:24 +0800)
commit50a278c2aef21bf9b78865ad7c7554e506434b9c
tree4f58d21bb74a4db90d8df68a611e613cea1f3009
parentf98df8a38b00b207b5f5deda607fd6862ad550f0
[JITLink][NFC] Add TableManager to replace PerGraph...Builder pass

This patch add a TableManager which reponsible for fixing edges that need entries to reference the target symbol and constructing such entries.

In the past, the PerGraphGOTAndPLTStubsBuilder pass was used to build GOT and PLT entry, and the PerGraphTLSInfoEntryBuilder pass was used to build TLSInfo entry. By generalizing the behavior of building entry, I added a TableManager which could be reused when built GOT, PLT and TLSInfo entries.

If this patch makes sense and can be accepted, I will apply the TableManager to other targets(MachO_x86_64, MachO_arm64, ELF_riscv), and delete the file PerGraphGOTAndPLTStubsBuilder.h

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D110383
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
llvm/lib/ExecutionEngine/JITLink/PerGraphTLSInfoEntryBuilder.h [deleted file]
llvm/lib/ExecutionEngine/JITLink/TableManager.h [new file with mode: 0644]