Give RemoveRegOperandFromRegInfo a comment and move the
authorDan Gohman <gohman@apple.com>
Wed, 15 Apr 2009 01:17:37 +0000 (01:17 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 15 Apr 2009 01:17:37 +0000 (01:17 +0000)
code out of line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69124 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineOperand.h
lib/CodeGen/MachineInstr.cpp

index 820c6ef3834ac685f8f508e307cb987bbf4c8435..7a4168447b62e76e96811269385d964fa225e575 100644 (file)
@@ -427,18 +427,9 @@ private:
   /// explicitly nulled out.
   void AddRegOperandToRegInfo(MachineRegisterInfo *RegInfo);
 
-  void RemoveRegOperandFromRegInfo() {
-    assert(isOnRegUseList() && "Reg operand is not on a use list");
-    // Unlink this from the doubly linked list of operands.
-    MachineOperand *NextOp = Contents.Reg.Next;
-    *Contents.Reg.Prev = NextOp; 
-    if (NextOp) {
-      assert(NextOp->getReg() == getReg() && "Corrupt reg use/def chain!");
-      NextOp->Contents.Reg.Prev = Contents.Reg.Prev;
-    }
-    Contents.Reg.Prev = 0;
-    Contents.Reg.Next = 0;
-  }
+  /// RemoveRegOperandFromRegInfo - Remove this register operand from the
+  /// MachineRegisterInfo it is linked with.
+  void RemoveRegOperandFromRegInfo();
 };
 
 inline std::ostream &operator<<(std::ostream &OS, const MachineOperand &MO) {
index a227f25190a4f5951ff52520952259c95333c56a..a934b76b6d5cbf79b1ea3fe9320a590c6fba990c 100644 (file)
@@ -68,6 +68,21 @@ void MachineOperand::AddRegOperandToRegInfo(MachineRegisterInfo *RegInfo) {
   *Head = this;
 }
 
+/// RemoveRegOperandFromRegInfo - Remove this register operand from the
+/// MachineRegisterInfo it is linked with.
+void MachineOperand::RemoveRegOperandFromRegInfo() {
+  assert(isOnRegUseList() && "Reg operand is not on a use list");
+  // Unlink this from the doubly linked list of operands.
+  MachineOperand *NextOp = Contents.Reg.Next;
+  *Contents.Reg.Prev = NextOp; 
+  if (NextOp) {
+    assert(NextOp->getReg() == getReg() && "Corrupt reg use/def chain!");
+    NextOp->Contents.Reg.Prev = Contents.Reg.Prev;
+  }
+  Contents.Reg.Prev = 0;
+  Contents.Reg.Next = 0;
+}
+
 void MachineOperand::setReg(unsigned Reg) {
   if (getReg() == Reg) return; // No change.