Skip to content

Commit 702fe36

Browse files
committed
[BOLT][NFC] Const-ify getDynamicRelocationAt
Reviewed By: #bolt, maksfb Differential Revision: https://reviews.llvm.org/D152662
1 parent a9e0321 commit 702fe36

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ class BinaryContext {
11651165

11661166
/// Return a dynamic relocation registered at a given \p Address, or nullptr
11671167
/// if there is no dynamic relocation at such address.
1168-
const Relocation *getDynamicRelocationAt(uint64_t Address);
1168+
const Relocation *getDynamicRelocationAt(uint64_t Address) const;
11691169

11701170
/// Remove registered relocation at a given \p Address.
11711171
bool removeRelocationAt(uint64_t Address);

bolt/lib/Core/BinaryContext.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,8 +2100,9 @@ const Relocation *BinaryContext::getRelocationAt(uint64_t Address) const {
21002100
return Section->getRelocationAt(Address - Section->getAddress());
21012101
}
21022102

2103-
const Relocation *BinaryContext::getDynamicRelocationAt(uint64_t Address) {
2104-
ErrorOr<BinarySection &> Section = getSectionForAddress(Address);
2103+
const Relocation *
2104+
BinaryContext::getDynamicRelocationAt(uint64_t Address) const {
2105+
ErrorOr<const BinarySection &> Section = getSectionForAddress(Address);
21052106
if (!Section)
21062107
return nullptr;
21072108

0 commit comments

Comments
 (0)