diff options
author | Dan Gohman <gohman@apple.com> | 2009-01-07 22:28:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-01-07 22:28:56 +0000 |
commit | 9157721904eefe2e2f895ff99e4035596ab48764 (patch) | |
tree | f0b8fd6e5b78ae699016d0683fb7d6af33608349 | |
parent | 682c3a6dd6018b9add5b8e7d12b80d017a02fc63 (diff) | |
download | bcm5719-llvm-9157721904eefe2e2f895ff99e4035596ab48764.tar.gz bcm5719-llvm-9157721904eefe2e2f895ff99e4035596ab48764.zip |
Add empty() methods for register def lists.
llvm-svn: 61890
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineRegisterInfo.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h index f477e86554e..b313fce182f 100644 --- a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h @@ -81,6 +81,10 @@ public: } static reg_iterator reg_end() { return reg_iterator(0); } + /// reg_empty - Return true if there are no instructions using or defining the + /// specified register (it may be live-in). + bool reg_empty(unsigned RegNo) const { return reg_begin(RegNo) == reg_end(); } + /// def_iterator/def_begin/def_end - Walk all defs of the specified register. typedef defusechain_iterator<false,true> def_iterator; def_iterator def_begin(unsigned RegNo) const { @@ -88,6 +92,10 @@ public: } static def_iterator def_end() { return def_iterator(0); } + /// def_empty - Return true if there are no instructions defining the + /// specified register (it may be live-in). + bool def_empty(unsigned RegNo) const { return def_begin(RegNo) == def_end(); } + /// use_iterator/use_begin/use_end - Walk all uses of the specified register. typedef defusechain_iterator<true,false> use_iterator; use_iterator use_begin(unsigned RegNo) const { |