aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/LiveVar/LiveVarMap.h
blob: bc00d4f2815b3269a0e020b5582f53869c4c60c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Title:   LiveVarMap.h
   Author:  Ruchira Sasanka
   Date:    Jun 30, 01
   Purpose: This file contains the class for a map between the BasicBlock class
            and the BBLiveVar class, which is a wrapper class of BasicBlock
	    used for the live variable analysis. The reverse mapping can
	    be found in the BBLiveVar class (It has a pointer to the 
	    corresponding BasicBlock)
*/


#ifndef LIVE_VAR_MAP_H
#define LIVE_VAR_MAP_H

#include <hash_map>

class BasicBlock;
class BBLiveVar;


struct hashFuncMInst {  // sturcture containing the hash function for MInst
  inline size_t operator () (const MachineInstr *val) const { 
    return (size_t) val;  
  }
};


struct hashFuncBB {          // sturcture containing the hash function for BB
  inline size_t operator () (const BasicBlock *val) const { 
    return (size_t) val; 
  }
};




typedef hash_map<const BasicBlock *,  
		 BBLiveVar *, hashFuncBB > BBToBBLiveVarMapType;

typedef hash_map<const MachineInstr *,  const LiveVarSet *, 
		 hashFuncMInst> MInstToLiveVarSetMapType;


#endif