44b3bbb7a4155d8ebcc9644b74bb80ad915d5938
[oota-llvm.git] / include / llvm / Analysis / LiveVar / LiveVarMap.h
1 /* Title:   LiveVarMap.h
2    Author:  Ruchira Sasanka
3    Date:    Jun 30, 01
4    Purpose: This file contains the class for a map between the BasicBlock class
5             and the BBLiveVar class, which is a wrapper class of BasicBlock
6             used for the live variable analysis. The reverse mapping can
7             be found in the BBLiveVar class (It has a pointer to the 
8             corresponding BasicBlock)
9 */
10
11
12 #ifndef LIVE_VAR_MAP_H
13 #define LIVE_VAR_MAP_H
14
15 #include <ext/hash_map>
16
17 class BasicBlock;
18 class BBLiveVar;
19
20
21 struct hashFuncMInst {  // sturcture containing the hash function for MInst
22   inline size_t operator () (const MachineInstr *val) const { 
23     return (size_t) val;  
24   }
25 };
26
27
28 struct hashFuncBB {          // sturcture containing the hash function for BB
29   inline size_t operator () (const BasicBlock *val) const { 
30     return (size_t) val; 
31   }
32 };
33
34
35
36
37 typedef std::hash_map<const BasicBlock *,  
38                       BBLiveVar *, hashFuncBB > BBToBBLiveVarMapType;
39
40 typedef std::hash_map<const MachineInstr *,  const LiveVarSet *, 
41                       hashFuncMInst> MInstToLiveVarSetMapType;
42
43
44 #endif
45
46