diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-16 15:58:54 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-09-16 15:58:54 +0000 |
commit | 504fc5b7b5a9ffa9f82e95e7212015575030c7a7 (patch) | |
tree | 3670d5c6d805be6c211ebf800f269797d75e688e /include | |
parent | d5af164f01aa968af7d98534e92cee386bac6889 (diff) | |
download | external_llvm-504fc5b7b5a9ffa9f82e95e7212015575030c7a7.zip external_llvm-504fc5b7b5a9ffa9f82e95e7212015575030c7a7.tar.gz external_llvm-504fc5b7b5a9ffa9f82e95e7212015575030c7a7.tar.bz2 |
Add method MachineOperand::hasAllocatedReg().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 9355048..a2190d8 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -136,14 +136,21 @@ public: inline bool opLoBits64 () const { return flags & LOFLAG64; } - - // used to get the reg number if when one is allocated (must be - // called only after reg alloc) + + // used to check if a machine register has been allocated to this operand + inline bool hasAllocatedReg() const { + return (regNum >= 0 && + (opType == MO_VirtualRegister || opType == MO_CCRegister || + opType == MO_MachineRegister)); + } + + // used to get the reg number if when one is allocated inline int getAllocatedRegNum() const { assert(opType == MO_VirtualRegister || opType == MO_CCRegister || opType == MO_MachineRegister); return regNum; } + public: friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); |