diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-01-31 19:57:11 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-01-31 19:57:11 +0000 |
| commit | f5e7107425c62eeb671fa24cadf64233c8e95475 (patch) | |
| tree | a7c1b5a0bb9a67c3deaa179eeb2d122bb3d3bb6f | |
| parent | cdf48ab2946f58eeec075ef3611e968e53db58f9 (diff) | |
| download | bcm5719-llvm-f5e7107425c62eeb671fa24cadf64233c8e95475.tar.gz bcm5719-llvm-f5e7107425c62eeb671fa24cadf64233c8e95475.zip | |
Add two static methods to avoid having client code explicitly compare against
FirstVirtualRegister
llvm-svn: 11031
| -rw-r--r-- | llvm/include/llvm/Target/MRegisterInfo.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/MRegisterInfo.h b/llvm/include/llvm/Target/MRegisterInfo.h index 3217b47b729..3d67d8c4091 100644 --- a/llvm/include/llvm/Target/MRegisterInfo.h +++ b/llvm/include/llvm/Target/MRegisterInfo.h @@ -136,6 +136,18 @@ public: FirstVirtualRegister = 1024, }; + /// isPhysicalRegister - Return true if the specified register number is in + /// the physical register namespace. + static bool isPhysicalRegister(unsigned Reg) { + return Reg < FirstVirtualRegister; + } + + /// isVirtualRegister - Return true if the specified register number is in + /// the virtual register namespace. + static bool isVirtualRegister(unsigned Reg) { + return Reg >= FirstVirtualRegister; + } + const MRegisterDesc &operator[](unsigned RegNo) const { assert(RegNo < NumRegs && "Attempting to access record for invalid register number!"); |

