[mips] Add non-const getter for the Elf_Mips_Options class. NFC

llvm-svn: 286351
This commit is contained in:
Simon Atanasyan 2016-11-09 10:14:55 +00:00
parent 28f29487b9
commit 96b4b713fc
1 changed files with 6 additions and 3 deletions

View File

@ -608,10 +608,13 @@ template <class ELFT> struct Elf_Mips_Options {
// or 0 for global options
Elf_Word info; // Kind-specific information
const Elf_Mips_RegInfo<ELFT> &getRegInfo() const {
Elf_Mips_RegInfo<ELFT> &getRegInfo() {
assert(kind == llvm::ELF::ODK_REGINFO);
return *reinterpret_cast<const Elf_Mips_RegInfo<ELFT> *>(
(const uint8_t *)this + sizeof(Elf_Mips_Options));
return *reinterpret_cast<Elf_Mips_RegInfo<ELFT> *>(
(uint8_t *)this + sizeof(Elf_Mips_Options));
}
const Elf_Mips_RegInfo<ELFT> &getRegInfo() const {
return const_cast<Elf_Mips_Options *>(this)->getRegInfo();
}
};