aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-31 19:57:11 +0000
committerChris Lattner <sabre@nondot.org>2004-01-31 19:57:11 +0000
commitbd490d919bd36d2ab956031b524a55dd8519eb64 (patch)
tree1b60b8004d6d69e1b1f8508d35eea0689530a9c2 /include
parent97017de1872e08ffcdde2fccdfd399647c1ccc4a (diff)
downloadexternal_llvm-bd490d919bd36d2ab956031b524a55dd8519eb64.zip
external_llvm-bd490d919bd36d2ab956031b524a55dd8519eb64.tar.gz
external_llvm-bd490d919bd36d2ab956031b524a55dd8519eb64.tar.bz2
Add two static methods to avoid having client code explicitly compare against
FirstVirtualRegister git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/MRegisterInfo.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h
index 3217b47..3d67d8c 100644
--- a/include/llvm/Target/MRegisterInfo.h
+++ b/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!");