summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/LiveVariables.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-30 22:08:09 +0000
committerChris Lattner <sabre@nondot.org>2004-01-30 22:08:09 +0000
commit43549f710aed19431df93d893aee1ade9a33245d (patch)
tree36a55214dde79d0a721a0a79360feae15fea165b /include/llvm/CodeGen/LiveVariables.h
parent09caa3751f3c53a8c8a7a81c2a60d6c8ddf5a980 (diff)
downloadllvm-43549f710aed19431df93d893aee1ade9a33245d.tar.gz
llvm-43549f710aed19431df93d893aee1ade9a33245d.tar.bz2
llvm-43549f710aed19431df93d893aee1ade9a33245d.tar.xz
Add a new lazily constructed mapping from Idx's the MBB they represent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveVariables.h')
-rw-r--r--include/llvm/CodeGen/LiveVariables.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h
index 71dd437d99..454205afbe 100644
--- a/include/llvm/CodeGen/LiveVariables.h
+++ b/include/llvm/CodeGen/LiveVariables.h
@@ -103,6 +103,12 @@ private: // Intermediate data structures
/// BBMap - Maps LLVM basic blocks to their corresponding machine basic block.
/// This also provides a numbering of the basic blocks in the function.
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;
@@ -126,6 +132,9 @@ public:
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
///
@@ -243,6 +252,7 @@ public:
RegistersKilled.clear();
RegistersDead.clear();
BBMap.clear();
+ BBIdxMap.clear();
}
/// getVarInfo - Return the VarInfo structure for the specified VIRTUAL