aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-07-30 23:48:12 +0000
committerAndrew Trick <atrick@apple.com>2012-07-30 23:48:12 +0000
commit269120cd9b45b24665433ea28eb7d092c138ca76 (patch)
tree6a73aa67f1466868f6915110cb9ae48bf9cb575b /include
parent5eb301740c4ee5d978535caa917cc004733a7fca (diff)
downloadexternal_llvm-269120cd9b45b24665433ea28eb7d092c138ca76.zip
external_llvm-269120cd9b45b24665433ea28eb7d092c138ca76.tar.gz
external_llvm-269120cd9b45b24665433ea28eb7d092c138ca76.tar.bz2
Inline MachineRegisterInfo::hasOneUse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineRegisterInfo.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h
index 2bcd1c7..1c2baef 100644
--- a/include/llvm/CodeGen/MachineRegisterInfo.h
+++ b/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -185,7 +185,12 @@ public:
/// hasOneUse - Return true if there is exactly one instruction using the
/// specified register.
- bool hasOneUse(unsigned RegNo) const;
+ bool hasOneUse(unsigned RegNo) const {
+ use_iterator UI = use_begin(RegNo);
+ if (UI == use_end())
+ return false;
+ return ++UI == use_end();
+ }
/// use_nodbg_iterator/use_nodbg_begin/use_nodbg_end - Walk all uses of the
/// specified register, skipping those marked as Debug.