From 74de8b1b26b12fda3364382946e519a2e37b6709 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Jul 2004 07:04:55 +0000 Subject: There is no need to store the MBB along with the MI any more, we can now ask instructions for their parent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14998 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/LiveVariables.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'include/llvm/CodeGen/LiveVariables.h') diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 80cbb41950..4eec1d6612 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -48,11 +48,10 @@ public: /// std::vector AliveBlocks; - /// Kills - List of MachineBasicblock's which contain the last use of this - /// virtual register (kill it). This also includes the specific instruction - /// which kills the value. + /// Kills - List of MachineInstruction's which are the last use of this + /// virtual register (kill it) in their basic block. /// - std::vector > Kills; + std::vector Kills; VarInfo() : DefInst(0) {} @@ -60,13 +59,12 @@ public: /// machine instruction. Returns true if there was a kill /// corresponding to this instruction, false otherwise. bool removeKill(MachineInstr *MI) { - for (std::vector >::iterator - i = Kills.begin(); i != Kills.end(); ++i) { - if (i->second == MI) { + for (std::vector::iterator i = Kills.begin(), + e = Kills.end(); i != e; ++i) + if (*i == MI) { Kills.erase(i); return true; } - } return false; } }; @@ -153,7 +151,7 @@ public: /// void addVirtualRegisterKilled(unsigned IncomingReg, MachineInstr *MI) { RegistersKilled.insert(std::make_pair(MI, IncomingReg)); - getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MI->getParent(),MI)); + getVarInfo(IncomingReg).Kills.push_back(MI); } /// removeVirtualRegisterKilled - Remove the specified virtual @@ -189,7 +187,7 @@ public: /// void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI) { RegistersDead.insert(std::make_pair(MI, IncomingReg)); - getVarInfo(IncomingReg).Kills.push_back(std::make_pair(MI->getParent(),MI)); + getVarInfo(IncomingReg).Kills.push_back(MI); } /// removeVirtualRegisterDead - Remove the specified virtual -- cgit v1.2.3