From 23ed37a6b76e79272194fb46597f7280661b828f Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 31 May 2013 23:45:26 +0000 Subject: Make SubRegIndex size mandatory, following r183020. This also makes TableGen able to compute sizes/offsets of synthesized indices representing tuples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183061 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCRegisterInfo.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lib/MC') diff --git a/lib/MC/MCRegisterInfo.cpp b/lib/MC/MCRegisterInfo.cpp index 06d6d9680d..ce79cd5c2c 100644 --- a/lib/MC/MCRegisterInfo.cpp +++ b/lib/MC/MCRegisterInfo.cpp @@ -46,17 +46,16 @@ unsigned MCRegisterInfo::getSubRegIndex(unsigned Reg, unsigned SubReg) const { return 0; } -bool MCRegisterInfo::getSubRegIdxCoveredBits(unsigned Idx, unsigned &Offset, - unsigned &Size) const { +unsigned MCRegisterInfo::getSubRegIdxSize(unsigned Idx) const { assert(Idx && Idx < getNumSubRegIndices() && "This is not a subregister index"); - // Get a pointer to the corresponding SubRegIdxRanges struct. - const SubRegCoveredBits *Bits = &SubRegIdxRanges[Idx]; - if (Bits->Offset == (uint16_t)-1 || Bits->Size == (uint16_t)-1) - return false; - Offset = Bits->Offset; - Size = Bits->Size; - return true; + return SubRegIdxRanges[Idx].Size; +} + +unsigned MCRegisterInfo::getSubRegIdxOffset(unsigned Idx) const { + assert(Idx && Idx < getNumSubRegIndices() && + "This is not a subregister index"); + return SubRegIdxRanges[Idx].Offset; } int MCRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const { -- cgit v1.2.3