[PATCH] D122106: [BOLT] Fix dynamic relocation offset for constant islands
Vladislav Khmelevsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 28 15:47:39 PDT 2022
yota9 marked an inline comment as done.
yota9 added inline comments.
================
Comment at: bolt/include/bolt/Core/BinarySection.h:290
- /// Iterate over all non-pending relocations for this section.
- iterator_range<RelocationSetType::iterator> relocations() {
- return make_range(Relocations.begin(), Relocations.end());
----------------
rafauler wrote:
> Here you remove the accessors to the non-const version of relocs, but I suspect we will need them to avoid using the mutable hack.
The problem is deeper as I understand. I'm not c++ expert, but the relocations are stored in std::set<Relocation, std::less<>>container, which does not give the in container edit abilities due to the std::less sorting. The mutable fields are hacky, but AFAIU such fields are not not participated in the container sorting mechanisms and though might be edited in place. Correct me if I wrong, I really don't like c++ some times like this :) Maybe you can suggest some of the alternatives to change the container type for example :)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122106/new/
https://reviews.llvm.org/D122106
More information about the llvm-commits
mailing list