[mips] Add non-const getter for the Elf_Mips_Options class. NFC
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 9 Nov 2016 10:14:55 +0000 (10:14 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 9 Nov 2016 10:14:55 +0000 (10:14 +0000)
llvm-svn: 286351

llvm/include/llvm/Object/ELFTypes.h

index fbb8ee1..beba6f2 100644 (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();
   }
 };