From 02566c439c8124b6e5bcd657d3de2e28aa40efa5 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 --- include/llvm/Object/ELFTypes.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/llvm/Object/ELFTypes.h b/include/llvm/Object/ELFTypes.h index fbb8ee12f23..beba6f272c7 100644 --- a/include/llvm/Object/ELFTypes.h +++ b/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(); } };