diff options
author | Dan Gohman <gohman@apple.com> | 2007-10-01 16:01:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-10-01 16:01:23 +0000 |
commit | 21c276d2fa99914d5ed958ac0aec7d78e3dd87cf (patch) | |
tree | e207902088791d6d41ce8f9138fc47c157e7b5dc | |
parent | d89b117850d1ebcc1390f23891b6ac0b64c99045 (diff) |
Add empty() member functions to a few container-like classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42487 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/CallGraph.h | 1 | ||||
-rw-r--r-- | include/llvm/Analysis/LoopInfo.h | 1 | ||||
-rw-r--r-- | include/llvm/Support/CallSite.h | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h index 4f4ce0e9f1..203288dc9a 100644 --- a/include/llvm/Analysis/CallGraph.h +++ b/include/llvm/Analysis/CallGraph.h @@ -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... diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index acb5fd6c7a..86dc571fd4 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -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. /// diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index e14caad642..fec7efc4cb 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -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 { |