mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 03:06:28 +00:00
Add a useful accessor
llvm-svn: 19209
This commit is contained in:
parent
7f004e59d8
commit
70d0a6155b
@ -125,6 +125,16 @@ public:
|
||||
return RegistersKilled.equal_range(MI);
|
||||
}
|
||||
|
||||
/// KillsRegister - Return true if the specified instruction kills the
|
||||
/// specified register.
|
||||
bool KillsRegister(MachineInstr *MI, unsigned Reg) {
|
||||
std::pair<killed_iterator, killed_iterator> KIP = killed_range(MI);
|
||||
for (; KIP.first != KIP.second; ++KIP.first)
|
||||
if (KIP.first->second == Reg)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
killed_iterator dead_begin(MachineInstr *MI) {
|
||||
return RegistersDead.lower_bound(MI);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user