-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFlowGraph.h
More file actions
31 lines (31 loc) · 750 Bytes
/
Copy pathFlowGraph.h
File metadata and controls
31 lines (31 loc) · 750 Bytes
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
#pragma once
#include<vector>
#include<set>
#include"Block.h"
#include"MidCodeContainer.h"
#include"OptimizeSwitch.h"
using namespace std;
class FlowGraph {
public:
~FlowGraph();
set<int>globalVariable;
set<int>tmpVariable;
set<int>allVariable;
string functionName;
int functionId;
vector<Block*>graph;
vector<vector<int>>conflictEdges;
static vector<Block*>allGraph;
FlowGraph(MidCodeContainer& container);
friend ostream& operator<<(ostream& out, FlowGraph& f);
void optimize();
void addLink(Block* from, Block* to);
void activeVariableAnalyze();
void conflictEdgeAnalyze();
void variableSummary();
void DAGoptimize();
void eliminateDeadCode();
void blockOptimize();
void activeVariablePerLine();
void peepholeOptimize();
};