diff options
Diffstat (limited to 'include/llvm/CodeGen/LiveVariables.h')
-rw-r--r-- | include/llvm/CodeGen/LiveVariables.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 7820f7414d..17c1e2a770 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -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); } |