]> granicus.if.org Git - llvm/commitdiff
Simplify interface to creating a register
authorChris Lattner <sabre@nondot.org>
Mon, 13 Jan 2003 00:19:18 +0000 (00:19 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 13 Jan 2003 00:19:18 +0000 (00:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5211 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SSARegMap.h

index 720424d4e148303d980bb64c1b86e1b0c6f52970..08fa672a816e085b5d06581c02aca62105f0e817 100644 (file)
@@ -28,10 +28,12 @@ class SSARegMap {
     return RegClassMap[actualReg];
   }
 
-  void addRegMap(unsigned Reg, const TargetRegisterClass* RegClass) {
-    assert(rescale(Reg) == RegClassMap.size() && 
-           "Register mapping not added in sequential order!");
+  /// createVirtualRegister - Create and return a new virtual register in the
+  /// function with the specified register class.
+  ///
+  unsigned createVirtualRegister(const TargetRegisterClass *RegClass) {
     RegClassMap.push_back(RegClass);
+    return RegClassMap.size()+MRegisterInfo::FirstVirtualRegister-1;
   }
 };