ELF: Make some functions constant. NFC.
authorRui Ueyama <ruiu@google.com>
Wed, 24 Feb 2016 00:23:13 +0000 (00:23 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 24 Feb 2016 00:23:13 +0000 (00:23 +0000)
This is a preparation for ICF.

llvm-svn: 261710

lld/ELF/InputSection.cpp
lld/ELF/InputSection.h

index ad81780..1bf467b 100644 (file)
@@ -68,7 +68,7 @@ InputSectionBase<ELFT>::getOffset(const Elf_Sym &Sym) {
 // Returns a section that Rel relocation is pointing to.
 template <class ELFT>
 InputSectionBase<ELFT> *
-InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) {
+InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) const {
   // Global symbol
   uint32_t SymIndex = Rel.getSymbol(Config->Mips64EL);
   if (SymbolBody *B = File->getSymbolBody(SymIndex))
@@ -83,7 +83,7 @@ InputSectionBase<ELFT>::getRelocTarget(const Elf_Rel &Rel) {
 
 template <class ELFT>
 InputSectionBase<ELFT> *
-InputSectionBase<ELFT>::getRelocTarget(const Elf_Rela &Rel) {
+InputSectionBase<ELFT>::getRelocTarget(const Elf_Rela &Rel) const {
   return getRelocTarget(reinterpret_cast<const Elf_Rel &>(Rel));
 }
 
index f0d4972..5c5ec2a 100644 (file)
@@ -73,8 +73,8 @@ public:
   ArrayRef<uint8_t> getSectionData() const;
 
   // Returns a section that Rel is pointing to. Used by the garbage collector.
-  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rel &Rel);
-  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel);
+  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rel &Rel) const;
+  InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel) const;
 
   template <bool isRela>
   using RelIteratorRange =