-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdataflow.h
42 lines (38 loc) · 1.12 KB
/
dataflow.h
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
#ifndef DATAFLOW_H
#define DATAFLOW_H
#include "em.h"
class AcrossBlockDataFlowAnalysis
{
public:
std::map<EBasicBlock*, std::set<Variable*> > liveIns;
std::map<EBasicBlock*, std::set<Variable*> > liveOuts;
ENode * e;
std::vector<EBasicBlock*> Blocks;
AcrossBlockDataFlowAnalysis(ENode * e,
std::vector<EBasicBlock*> Blocks) :
e(e),
Blocks(Blocks) {};
void connectBlocks();
void connectBlocksRecursive(std::list<EBasicBlock*> & blockStack,
ENode * e, EBasicBlock * & currentBlock,
int &uuid);
void doAnalysis();
void dumpGraph();
};
class WithinBlockDataFlowAnalysis
{
public:
std::map<EStmt*, std::set<Variable*> > liveIns;
std::map<EStmt*, std::set<Variable*> > liveOuts;
EBasicBlock * BB;
std::set<Variable*> blockLiveIns;
std::set<Variable*> blockLiveOuts;
WithinBlockDataFlowAnalysis(EBasicBlock * BB,
std::set<Variable*> blockLiveIns,
std::set<Variable*> blockLiveOuts) :
BB(BB),
blockLiveIns(blockLiveIns),
blockLiveOuts(blockLiveOuts) {};
void doAnalysis();
};
#endif