[BOLT][NFC] Const-ify getDynamicRelocationAt

Reviewed By: #bolt, maksfb

Differential Revision: https://reviews.llvm.org/D152662
This commit is contained in:
Amir Ayupov
2023-06-12 09:54:42 -07:00
parent a9e0321ffe
commit 702fe36b70
2 changed files with 4 additions and 3 deletions

View File

@@ -1165,7 +1165,7 @@ public:
/// Return a dynamic relocation registered at a given \p Address, or nullptr
/// if there is no dynamic relocation at such address.
const Relocation *getDynamicRelocationAt(uint64_t Address);
const Relocation *getDynamicRelocationAt(uint64_t Address) const;
/// Remove registered relocation at a given \p Address.
bool removeRelocationAt(uint64_t Address);

View File

@@ -2100,8 +2100,9 @@ const Relocation *BinaryContext::getRelocationAt(uint64_t Address) const {
return Section->getRelocationAt(Address - Section->getAddress());
}
const Relocation *BinaryContext::getDynamicRelocationAt(uint64_t Address) {
ErrorOr<BinarySection &> Section = getSectionForAddress(Address);
const Relocation *
BinaryContext::getDynamicRelocationAt(uint64_t Address) const {
ErrorOr<const BinarySection &> Section = getSectionForAddress(Address);
if (!Section)
return nullptr;