Add a new lazily constructed mapping from Idx's the MBB they represent

llvm-svn: 11017
This commit is contained in:
Chris Lattner 2004-01-30 22:08:09 +00:00
parent 845c0dd196
commit bc699a10d1
1 changed files with 10 additions and 0 deletions

View File

@ -104,6 +104,12 @@ private: // Intermediate data structures
/// This also provides a numbering of the basic blocks in the function. /// This also provides a numbering of the basic blocks in the function.
std::map<const BasicBlock*, std::pair<MachineBasicBlock*, unsigned> > BBMap; std::map<const BasicBlock*, std::pair<MachineBasicBlock*, unsigned> > BBMap;
/// BBIdxMap - This contains the inverse mapping of BBMap, going from block ID
/// numbers to the corresponding MachineBasicBlock. This is lazily computed
/// when the getIndexMachineBasicBlock() method is called.
std::vector<MachineBasicBlock*> BBIdxMap;
const MRegisterInfo *RegInfo; const MRegisterInfo *RegInfo;
MachineInstr **PhysRegInfo; MachineInstr **PhysRegInfo;
@ -126,6 +132,9 @@ public:
return BBMap.find(BB)->second; return BBMap.find(BB)->second;
} }
/// getIndexMachineBasicBlock() - Given a block index, return the
/// MachineBasicBlock corresponding to it.
MachineBasicBlock *getIndexMachineBasicBlock(unsigned Idx);
/// killed_iterator - Iterate over registers killed by a machine instruction /// killed_iterator - Iterate over registers killed by a machine instruction
/// ///
@ -243,6 +252,7 @@ public:
RegistersKilled.clear(); RegistersKilled.clear();
RegistersDead.clear(); RegistersDead.clear();
BBMap.clear(); BBMap.clear();
BBIdxMap.clear();
} }
/// getVarInfo - Return the VarInfo structure for the specified VIRTUAL /// getVarInfo - Return the VarInfo structure for the specified VIRTUAL