mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
Add TargetRegisterInfo::hasRegUnit().
This trivial helper function tests if a register contains a register unit. It is similar to regsOverlap(), but with asymmetric arguments. llvm-svn: 161180
This commit is contained in:
parent
4ab0d4a8d1
commit
ece141b6e3
@ -349,6 +349,14 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/// hasRegUnit - Returns true if Reg contains RegUnit.
|
||||
bool hasRegUnit(unsigned Reg, unsigned RegUnit) const {
|
||||
for (MCRegUnitIterator Units(Reg, this); Units.isValid(); ++Units)
|
||||
if (*Units == RegUnit)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// isSubRegister - Returns true if regB is a sub-register of regA.
|
||||
///
|
||||
bool isSubRegister(unsigned regA, unsigned regB) const {
|
||||
|
Loading…
Reference in New Issue
Block a user