diff options
author | Andrew Trick <atrick@apple.com> | 2012-07-30 23:48:12 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-07-30 23:48:12 +0000 |
commit | 269120cd9b45b24665433ea28eb7d092c138ca76 (patch) | |
tree | 6a73aa67f1466868f6915110cb9ae48bf9cb575b /include/llvm/CodeGen/MachineRegisterInfo.h | |
parent | 5eb301740c4ee5d978535caa917cc004733a7fca (diff) | |
download | external_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/llvm/CodeGen/MachineRegisterInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 7 |
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. |