mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 15:11:00 +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
528a4fa860
commit
232ae7cc20
@ -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