Drop a few const to reduce the noise from the next patch. NFC.

llvm-svn: 251140
This commit is contained in:
Rafael Espindola 2015-10-23 19:55:11 +00:00
parent 58968ac83f
commit 48225b4433
3 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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;