[llvm-commits] [llvm] r61890 - /llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h

Dan Gohman gohman at apple.com
Wed Jan 7 14:28:56 PST 2009


Author: djg
Date: Wed Jan  7 16:28:56 2009
New Revision: 61890

URL: http://llvm.org/viewvc/llvm-project?rev=61890&view=rev
Log:
Add empty() methods for register def lists.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h?rev=61890&r1=61889&r2=61890&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h Wed Jan  7 16:28:56 2009
@@ -81,6 +81,10 @@
   }
   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 @@
   }
   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 {





More information about the llvm-commits mailing list