Move createVirtualRegister out-of-line.
authorDan Gohman <gohman@apple.com>
Mon, 8 Dec 2008 04:54:11 +0000 (04:54 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 8 Dec 2008 04:54:11 +0000 (04:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60684 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/MachineRegisterInfo.cpp

index 2f25a5e140bf40bc1e16efc6d01fc92b21ba1635..f477e86554e2be6b443aceb6170b69b7a7bd1f0d 100644 (file)
@@ -164,19 +164,7 @@ public:
   /// createVirtualRegister - Create and return a new virtual register in the
   /// function with the specified register class.
   ///
-  unsigned createVirtualRegister(const TargetRegisterClass *RegClass) {
-    assert(RegClass && "Cannot create register without RegClass!");
-    // Add a reg, but keep track of whether the vector reallocated or not.
-    void *ArrayBase = VRegInfo.empty() ? 0 : &VRegInfo[0];
-    VRegInfo.push_back(std::make_pair(RegClass, (MachineOperand*)0));
-
-    if (!((&VRegInfo[0] == ArrayBase || VRegInfo.size() == 1)))
-      // The vector reallocated, handle this now.
-      HandleVRegListReallocation();
-    unsigned VR = getLastVirtReg();
-    RegClass2VRegMap[RegClass->getID()].push_back(VR);
-    return VR;
-  }
+  unsigned createVirtualRegister(const TargetRegisterClass *RegClass);
 
   /// getLastVirtReg - Return the highest currently assigned virtual register.
   ///
index 5e20689e0f6b0218e6ee943f0ee4d4ada1f1ae1f..e5148e74be820f3660e5da1babf1480da0b8eba1 100644 (file)
@@ -35,6 +35,24 @@ MachineRegisterInfo::~MachineRegisterInfo() {
   delete [] PhysRegUseDefLists;
 }
 
+/// createVirtualRegister - Create and return a new virtual register in the
+/// function with the specified register class.
+///
+unsigned
+MachineRegisterInfo::createVirtualRegister(const TargetRegisterClass *RegClass){
+  assert(RegClass && "Cannot create register without RegClass!");
+  // Add a reg, but keep track of whether the vector reallocated or not.
+  void *ArrayBase = VRegInfo.empty() ? 0 : &VRegInfo[0];
+  VRegInfo.push_back(std::make_pair(RegClass, (MachineOperand*)0));
+
+  if (!((&VRegInfo[0] == ArrayBase || VRegInfo.size() == 1)))
+    // The vector reallocated, handle this now.
+    HandleVRegListReallocation();
+  unsigned VR = getLastVirtReg();
+  RegClass2VRegMap[RegClass->getID()].push_back(VR);
+  return VR;
+}
+
 /// HandleVRegListReallocation - We just added a virtual register to the
 /// VRegInfo info list and it reallocated.  Update the use/def lists info
 /// pointers.