summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-10-23 19:55:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-10-23 19:55:11 +0000
commit48225b4433b579bac466e1baa34dd68dbf891485 (patch)
tree51bd431456bdafeaf504120511406df7a3b54985
parent58968ac83f23c2987d7bdd349d5b0a82f4a2e812 (diff)
downloadbcm5719-llvm-48225b4433b579bac466e1baa34dd68dbf891485.tar.gz
bcm5719-llvm-48225b4433b579bac466e1baa34dd68dbf891485.zip
Drop a few const to reduce the noise from the next patch. NFC.
llvm-svn: 251140
-rw-r--r--lld/ELF/InputSection.cpp4
-rw-r--r--lld/ELF/InputSection.h4
-rw-r--r--lld/ELF/OutputSections.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 8d6d40b3073..881b19d1e98 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -43,7 +43,7 @@ ArrayRef<uint8_t> InputSectionBase<ELFT>::getSectionData() const {
template <class ELFT>
typename ELFFile<ELFT>::uintX_t
-InputSectionBase<ELFT>::getOffset(const Elf_Sym &Sym) const {
+InputSectionBase<ELFT>::getOffset(const Elf_Sym &Sym) {
if (auto *S = dyn_cast<InputSection<ELFT>>(this))
return S->OutSecOff + Sym.st_value;
return cast<MergeInputSection<ELFT>>(this)->getOffset(Sym.st_value);
@@ -132,7 +132,7 @@ bool MergeInputSection<ELFT>::classof(const InputSectionBase<ELFT> *S) {
// FIXME: Optimize this by keeping an offset for each element.
template <class ELFT>
typename MergeInputSection<ELFT>::uintX_t
-MergeInputSection<ELFT>::getOffset(uintX_t Offset) const {
+MergeInputSection<ELFT>::getOffset(uintX_t Offset) {
ArrayRef<uint8_t> Data = this->getSectionData();
uintX_t EntSize = this->Header->sh_entsize;
uintX_t Addend = Offset % EntSize;
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 434384e84f0..4c84ea7b3e2 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -61,7 +61,7 @@ public:
return std::max<uintX_t>(Header->sh_addralign, 1);
}
- uintX_t getOffset(const Elf_Sym &Sym) const;
+ uintX_t getOffset(const Elf_Sym &Sym);
ArrayRef<uint8_t> getSectionData() const;
};
@@ -80,7 +80,7 @@ template <class ELFT> class MergeInputSection : public InputSectionBase<ELFT> {
public:
MergeInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header);
static bool classof(const InputSectionBase<ELFT> *S);
- uintX_t getOffset(uintX_t Offset) const;
+ uintX_t getOffset(uintX_t Offset);
};
// This corresponds to a non SHF_MERGE section of an input file.
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 25b533b2070..5b0d7a8963e 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -610,7 +610,7 @@ typename ELFFile<ELFT>::uintX_t lld::elf2::getSymVA(const SymbolBody &S) {
return cast<DefinedAbsolute<ELFT>>(S).Sym.st_value;
case SymbolBody::DefinedRegularKind: {
const auto &DR = cast<DefinedRegular<ELFT>>(S);
- const InputSectionBase<ELFT> &SC = DR.Section;
+ InputSectionBase<ELFT> &SC = DR.Section;
return SC.OutSec->getVA() + SC.getOffset(DR.Sym);
}
case SymbolBody::DefinedCommonKind:
@@ -903,7 +903,7 @@ void SymbolTableSection<ELFT>::writeLocalSymbols(uint8_t *&Buf) {
ESym->st_shndx = SHN_ABS;
VA = Sym.st_value;
} else {
- const InputSectionBase<ELFT> *Section = File->getSection(Sym);
+ InputSectionBase<ELFT> *Section = File->getSection(Sym);
if (!Section->isLive())
continue;
const OutputSectionBase<ELFT> *OutSec = Section->OutSec;
OpenPOWER on IntegriCloud