[PATCH] D152662: [BOLT][NFC] Const-ify getDynamicRelocationAt

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 11 17:24:39 PDT 2023

Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

  rG LLVM Github Monorepo



Index: bolt/lib/Core/BinaryContext.cpp
--- bolt/lib/Core/BinaryContext.cpp
+++ bolt/lib/Core/BinaryContext.cpp
@@ -2100,8 +2100,9 @@
   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;
Index: bolt/include/bolt/Core/BinaryContext.h
--- bolt/include/bolt/Core/BinaryContext.h
+++ bolt/include/bolt/Core/BinaryContext.h
@@ -1165,7 +1165,7 @@
   /// 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);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152662.530352.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230612/21b0f51f/attachment.bin>

More information about the llvm-commits mailing list