From: Chris Lattner Date: Sat, 1 Jan 2005 15:58:55 +0000 (+0000) Subject: Add a useful accessor X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=801abe663f55e974cfcfd46c2a8022561aa76e47;p=oota-llvm.git Add a useful accessor git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19209 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 7820f7414d4..17c1e2a7704 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 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); }