aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-01-27 18:24:59 -0800
committerGitHub <noreply@github.com>2025-01-27 18:24:59 -0800
commite0c7f081f1582d49f81ec4c6cdbf5d6ef13c58ba (patch)
tree4d4da42cde3e9b274a5f4fd875b3b3dbb93bd5cc /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
parentc4891089125d4ba312204cc9a666339abbfc4db2 (diff)
downloadllvm-e0c7f081f1582d49f81ec4c6cdbf5d6ef13c58ba.zip
llvm-e0c7f081f1582d49f81ec4c6cdbf5d6ef13c58ba.tar.gz
llvm-e0c7f081f1582d49f81ec4c6cdbf5d6ef13c58ba.tar.bz2
[lld-macho] Refactor BPSectionOrderer with CRTP. NFC
PR #117514 refactored BPSectionOrderer to be used by the ELF port but introduced some inefficiency: * BPSectionBase/BPSymbol are wrappers around a single pointer. The numbers of sections and symbols could be huge, and the extra allocations are memory inefficient. * Reconstructing the returned DenseMap (since BPSectionBase != InputSectin) is wasteful. This patch refactors BPSectionOrderer with Curiously Recurring Template Pattern and eliminates the inefficiency. In addition, `symbolToSectionIdxs` is removed and `rootSymbolToSectionIdxs` building is moved to lld/MachO: while getting sections for symbols is cheap in Mach-O, it is awkward and inefficient in the ELF port. While here, add a file-level comment and replace some `StringMap<*>` (which copies strings) with `DenseMap<CachedHashStringRef, *>`. Pull Request: https://github.com/llvm/llvm-project/pull/124482
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions