From 96b4b713fc9d501eaadee03ca13ed4dc11c15d0a Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Wed, 9 Nov 2016 10:14:55 +0000 Subject: [PATCH] [mips] Add non-const getter for the Elf_Mips_Options class. NFC llvm-svn: 286351 --- llvm/include/llvm/Object/ELFTypes.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h index fbb8ee12f23c..beba6f272c73 100644 --- a/llvm/include/llvm/Object/ELFTypes.h +++ b/llvm/include/llvm/Object/ELFTypes.h @@ -608,10 +608,13 @@ template struct Elf_Mips_Options { // or 0 for global options Elf_Word info; // Kind-specific information - const Elf_Mips_RegInfo &getRegInfo() const { + Elf_Mips_RegInfo &getRegInfo() { assert(kind == llvm::ELF::ODK_REGINFO); - return *reinterpret_cast *>( - (const uint8_t *)this + sizeof(Elf_Mips_Options)); + return *reinterpret_cast *>( + (uint8_t *)this + sizeof(Elf_Mips_Options)); + } + const Elf_Mips_RegInfo &getRegInfo() const { + return const_cast(this)->getRegInfo(); } };