diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-01 23:28:30 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-01 23:28:30 +0000 |
commit | 396618b43a85e12d290a90b181c6af5d7c0c5f11 (patch) | |
tree | 324b0a889a15d7af2be25fb527333ba50139f453 /include | |
parent | 4a8fefaf8303f30514bc2a40d840a1709dae65cf (diff) | |
download | external_llvm-396618b43a85e12d290a90b181c6af5d7c0c5f11.zip external_llvm-396618b43a85e12d290a90b181c6af5d7c0c5f11.tar.gz external_llvm-396618b43a85e12d290a90b181c6af5d7c0c5f11.tar.bz2 |
Switch all register list clients to the new MC*Iterator interface.
No functional change intended.
Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.
This makes it possible to do so without changing all clients (again).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 2 | ||||
-rw-r--r-- | include/llvm/MC/MCRegisterInfo.h | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index 3272fbd..5a82caa 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -336,7 +336,7 @@ public: bool isPhysRegOrOverlapUsed(unsigned Reg) const { if (UsedPhysRegMask.test(Reg)) return true; - for (const uint16_t *AI = TRI->getOverlaps(Reg); *AI; ++AI) + for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) if (UsedPhysRegs.test(*AI)) return true; return false; diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h index a2ec7bc..956f5e6 100644 --- a/include/llvm/MC/MCRegisterInfo.h +++ b/include/llvm/MC/MCRegisterInfo.h @@ -361,12 +361,7 @@ public: /// getMatchingSuperReg - Return a super-register of the specified register /// Reg so its sub-register of index SubIdx is Reg. unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx, - const MCRegisterClass *RC) const { - for (const uint16_t *SRs = getSuperRegisters(Reg); unsigned SR = *SRs;++SRs) - if (Reg == getSubReg(SR, SubIdx) && RC->contains(SR)) - return SR; - return 0; - } + const MCRegisterClass *RC) const; /// getSubRegIndex - For a given register pair, return the sub-register index /// if the second register is a sub-register of the first. Return zero @@ -494,6 +489,15 @@ public: {} }; +inline +unsigned MCRegisterInfo::getMatchingSuperReg(unsigned Reg, unsigned SubIdx, + const MCRegisterClass *RC) const { + for (MCSuperRegIterator Supers(Reg, this); Supers.isValid(); ++Supers) + if (Reg == getSubReg(*Supers, SubIdx) && RC->contains(*Supers)) + return *Supers; + return 0; +} + //===----------------------------------------------------------------------===// // Register Units //===----------------------------------------------------------------------===// |