aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-01 15:58:55 +0000
committerChris Lattner <sabre@nondot.org>2005-01-01 15:58:55 +0000
commit801abe663f55e974cfcfd46c2a8022561aa76e47 (patch)
treea93d1394e6059b98f47e51beccff48794ef400dd /include/llvm/CodeGen
parentfd1cbc095ad34b9ae9e65b15465c570e1b6ff3fb (diff)
downloadexternal_llvm-801abe663f55e974cfcfd46c2a8022561aa76e47.zip
external_llvm-801abe663f55e974cfcfd46c2a8022561aa76e47.tar.gz
external_llvm-801abe663f55e974cfcfd46c2a8022561aa76e47.tar.bz2
Add a useful accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/LiveVariables.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h
index 7820f74..17c1e2a 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);
}