-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmongac.cpp
More file actions
41 lines (29 loc) · 705 Bytes
/
Copy pathmongac.cpp
File metadata and controls
41 lines (29 loc) · 705 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
32
33
34
35
36
37
38
39
40
#include <cstdlib>
#include <iostream>
#include <vector>
#include "cfg/cfg_gen.h"
#include "ssa/ssa.h"
#include "ssa/rm_movs.h"
extern "C" {
#include "parser/driver.h"
#include "parser/type_checker.h"
}
using namespace std;
int main(int argc, char **argv)
{
DeclrListNode *ast;
vector<int> r;
ast = read_ast(argc, argv);
check_prog(ast);
Prog program = gen_prog(ast);
for (vector<CFG *>::iterator cfg = program.cfgs.begin(); cfg != program.cfgs.end(); ++cfg)
{
full_ssa(*cfg);
}
for (vector<CFG *>::iterator cfg = program.cfgs.begin(); cfg != program.cfgs.end(); ++cfg)
{
remove_move_operations(*cfg);
}
cout << program;
return 0;
}