From 14d9ce7892c7c0008c7cc38894ee3f71e4104d94 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 15 Oct 2003 16:39:04 +0000 Subject: [PATCH] Add new hasOneUse() method. Remove explicit inline qualifiers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9132 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Value.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 628e32cedbd..7b50c949541 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -97,18 +97,22 @@ public: typedef std::vector::iterator use_iterator; typedef std::vector::const_iterator use_const_iterator; - inline unsigned use_size() const { return Uses.size(); } - inline bool use_empty() const { return Uses.empty(); } - inline use_iterator use_begin() { return Uses.begin(); } - inline use_const_iterator use_begin() const { return Uses.begin(); } - inline use_iterator use_end() { return Uses.end(); } - inline use_const_iterator use_end() const { return Uses.end(); } - inline User *use_back() { return Uses.back(); } - inline const User *use_back() const { return Uses.back(); } + unsigned use_size() const { return Uses.size(); } + bool use_empty() const { return Uses.empty(); } + use_iterator use_begin() { return Uses.begin(); } + use_const_iterator use_begin() const { return Uses.begin(); } + use_iterator use_end() { return Uses.end(); } + use_const_iterator use_end() const { return Uses.end(); } + User *use_back() { return Uses.back(); } + const User *use_back() const { return Uses.back(); } + + /// hasOneUse - Return true if there is exactly one user of this value. + /// + bool hasOneUse() const { return use_size() == 1; } /// addUse/killUse - These two methods should only be used by the Use class /// below. - inline void addUse(User *I) { Uses.push_back(I); } + void addUse(User *I) { Uses.push_back(I); } void killUse(User *I); };