Add empty() member functions to a few container-like classes.
authorDan Gohman <gohman@apple.com>
Mon, 1 Oct 2007 16:01:23 +0000 (16:01 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 1 Oct 2007 16:01:23 +0000 (16:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42487 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Support/CallSite.h

index 4f4ce0e9f1a3b841c0258bbff118362f85134351..203288dc9a05b96d3bd0f02100337991c3a57ed9 100644 (file)
@@ -189,6 +189,7 @@ public:
   inline iterator end()   { return CalledFunctions.end();   }
   inline const_iterator begin() const { return CalledFunctions.begin(); }
   inline const_iterator end()   const { return CalledFunctions.end();   }
+  inline bool empty() const { return CalledFunctions.empty(); }
   inline unsigned size() const { return CalledFunctions.size(); }
 
   // Subscripting operator - Return the i'th called function...
index acb5fd6c7a4a23b022574fbdc4e0549ef1dd5e05..86dc571fd4ced2a8f58a1d896d3ed053699555cf 100644 (file)
@@ -79,6 +79,7 @@ public:
   typedef std::vector<Loop*>::const_iterator iterator;
   iterator begin() const { return SubLoops.begin(); }
   iterator end() const { return SubLoops.end(); }
+  bool empty() const { return SubLoops.empty(); }
 
   /// getBlocks - Get a list of the basic blocks which make up this loop.
   ///
index e14caad642c1a061ed45a275cb8328094f3019b4..fec7efc4cbb55f348f2158d7e884d71ca1bf7ae3 100644 (file)
@@ -110,6 +110,7 @@ public:
       return I->op_begin()+3; // Skip Function, BB, BB
   }
   arg_iterator arg_end() const { return I->op_end(); }
+  bool arg_empty() const { return arg_end() == arg_begin(); }
   unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
 
   bool operator<(const CallSite &CS) const {