Moved class MachineCodeForBasicBlock to MachineCodeForBasicBlock.h.

This class is now an annotation on BasicBlock.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve 2002-07-08 23:03:10 +00:00
parent bf82a42d1c
commit 1dcfd3c1a6
2 changed files with 8 additions and 6 deletions

View File

@ -18,6 +18,7 @@
#include "llvm/CodeGen/InstrSelectionSupport.h" #include "llvm/CodeGen/InstrSelectionSupport.h"
#include "llvm/CodeGen/InstrForest.h" #include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
#include "llvm/CodeGen/MachineCodeForMethod.h" #include "llvm/CodeGen/MachineCodeForMethod.h"
#include "llvm/Target/MachineRegInfo.h" #include "llvm/Target/MachineRegInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -127,7 +128,7 @@ SelectInstructionsForMethod(Function *F, TargetMachine &target)
for (BasicBlock::iterator II = BI->begin(); II != BI->end(); ++II) { for (BasicBlock::iterator II = BI->begin(); II != BI->end(); ++II) {
MachineCodeForInstruction &mvec =MachineCodeForInstruction::get(II); MachineCodeForInstruction &mvec =MachineCodeForInstruction::get(II);
for (unsigned i=0; i < mvec.size(); i++) for (unsigned i=0; i < mvec.size(); i++)
BI->getMachineInstrVec().push_back(mvec[i]); MachineCodeForBasicBlock::get(BI).push_back(mvec[i]);
} }
// Insert phi elimination code -- added by Ruchira // Insert phi elimination code -- added by Ruchira
@ -162,7 +163,7 @@ InsertPhiElimInstructions(BasicBlock *BB, const std::vector<MachineInstr*>& CpVe
assert( FirstMIOfTerm && "No Machine Instrs for terminator" ); assert( FirstMIOfTerm && "No Machine Instrs for terminator" );
// get an iterator to machine instructions in the BB // get an iterator to machine instructions in the BB
MachineCodeForBasicBlock& bbMvec = BB->getMachineInstrVec(); MachineCodeForBasicBlock& bbMvec = MachineCodeForBasicBlock::get(BB);
MachineCodeForBasicBlock::iterator MCIt = bbMvec.begin(); MachineCodeForBasicBlock::iterator MCIt = bbMvec.begin();
// find the position of first machine instruction generated by the // find the position of first machine instruction generated by the
@ -217,7 +218,7 @@ InsertCode4AllPhisInMeth(Function *F, TargetMachine &target)
target.getRegInfo().cpValue2Value(PhiCpRes, PN, mvec); target.getRegInfo().cpValue2Value(PhiCpRes, PN, mvec);
// get an iterator to machine instructions in the BB // get an iterator to machine instructions in the BB
MachineCodeForBasicBlock& bbMvec = BB->getMachineInstrVec(); MachineCodeForBasicBlock& bbMvec = MachineCodeForBasicBlock::get(BB);
bbMvec.insert(bbMvec.begin(), mvec.begin(), mvec.end()); bbMvec.insert(bbMvec.begin(), mvec.begin(), mvec.end());
} // for each Phi Instr in BB } // for each Phi Instr in BB

View File

@ -18,6 +18,7 @@
#include "llvm/CodeGen/InstrSelectionSupport.h" #include "llvm/CodeGen/InstrSelectionSupport.h"
#include "llvm/CodeGen/InstrForest.h" #include "llvm/CodeGen/InstrForest.h"
#include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/CodeGen/MachineCodeForInstruction.h"
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
#include "llvm/CodeGen/MachineCodeForMethod.h" #include "llvm/CodeGen/MachineCodeForMethod.h"
#include "llvm/Target/MachineRegInfo.h" #include "llvm/Target/MachineRegInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -127,7 +128,7 @@ SelectInstructionsForMethod(Function *F, TargetMachine &target)
for (BasicBlock::iterator II = BI->begin(); II != BI->end(); ++II) { for (BasicBlock::iterator II = BI->begin(); II != BI->end(); ++II) {
MachineCodeForInstruction &mvec =MachineCodeForInstruction::get(II); MachineCodeForInstruction &mvec =MachineCodeForInstruction::get(II);
for (unsigned i=0; i < mvec.size(); i++) for (unsigned i=0; i < mvec.size(); i++)
BI->getMachineInstrVec().push_back(mvec[i]); MachineCodeForBasicBlock::get(BI).push_back(mvec[i]);
} }
// Insert phi elimination code -- added by Ruchira // Insert phi elimination code -- added by Ruchira
@ -162,7 +163,7 @@ InsertPhiElimInstructions(BasicBlock *BB, const std::vector<MachineInstr*>& CpVe
assert( FirstMIOfTerm && "No Machine Instrs for terminator" ); assert( FirstMIOfTerm && "No Machine Instrs for terminator" );
// get an iterator to machine instructions in the BB // get an iterator to machine instructions in the BB
MachineCodeForBasicBlock& bbMvec = BB->getMachineInstrVec(); MachineCodeForBasicBlock& bbMvec = MachineCodeForBasicBlock::get(BB);
MachineCodeForBasicBlock::iterator MCIt = bbMvec.begin(); MachineCodeForBasicBlock::iterator MCIt = bbMvec.begin();
// find the position of first machine instruction generated by the // find the position of first machine instruction generated by the
@ -217,7 +218,7 @@ InsertCode4AllPhisInMeth(Function *F, TargetMachine &target)
target.getRegInfo().cpValue2Value(PhiCpRes, PN, mvec); target.getRegInfo().cpValue2Value(PhiCpRes, PN, mvec);
// get an iterator to machine instructions in the BB // get an iterator to machine instructions in the BB
MachineCodeForBasicBlock& bbMvec = BB->getMachineInstrVec(); MachineCodeForBasicBlock& bbMvec = MachineCodeForBasicBlock::get(BB);
bbMvec.insert(bbMvec.begin(), mvec.begin(), mvec.end()); bbMvec.insert(bbMvec.begin(), mvec.begin(), mvec.end());
} // for each Phi Instr in BB } // for each Phi Instr in BB