8 int main(int argc
, char * argv
[])
11 isl_ctx
*ctx
= isl_ctx_alloc();
13 pdg
= PDG::Load(stdin
, ctx
);
15 p
= isl_printer_to_file(ctx
, stdout
);
17 for (int i
= 0; i
< pdg
->dependences
.size(); ++i
) {
18 pdg::dependence
*dep
= pdg
->dependences
[i
];
19 if (dep
->type
!= pdg::dependence::uninitialized
)
21 pdg::node
* to
= dep
->to
;
22 int to_access
= dep
->to_access
? dep
->to_access
->nr
: -1;
23 const char *to_f
= to
->statement
->top_function
?
24 to
->statement
->top_function
->name
->s
.c_str() : "(none)";
25 pdg::IslMap
*rel
= dep
->relation
;
26 isl_map
*map
= rel
->get_isl_map(ctx
);
27 p
= isl_printer_print_str(p
, dep
->array
->name
->s
.c_str());
28 p
= isl_printer_print_str(p
, " uninitialized at ");
29 p
= isl_printer_print_int(p
, to
->nr
);
30 p
= isl_printer_print_str(p
, ",");
31 p
= isl_printer_print_int(p
, to_access
);
32 p
= isl_printer_print_str(p
, " (");
33 p
= isl_printer_print_str(p
, to_f
);
34 p
= isl_printer_print_str(p
, ",line ");
35 p
= isl_printer_print_int(p
, to
->statement
->line
);
36 p
= isl_printer_print_str(p
, "): ");
37 p
= isl_printer_print_map(p
, map
);
38 p
= isl_printer_end_line(p
);
42 for (int i
= 0; i
< pdg
->dependences
.size(); ++i
) {
43 pdg::dependence
*dep
= pdg
->dependences
[i
];
44 if (dep
->type
== pdg::dependence::uninitialized
)
46 pdg::node
* from
= dep
->from
;
47 pdg::node
* to
= dep
->to
;
48 int from_access
= dep
->from_access
? dep
->from_access
->nr
: -1;
49 int to_access
= dep
->to_access
? dep
->to_access
->nr
: -1;
50 const char *from_f
= from
->statement
->top_function
?
51 from
->statement
->top_function
->name
->s
.c_str() :
53 const char *to_f
= to
->statement
->top_function
?
54 to
->statement
->top_function
->name
->s
.c_str() : "(none)";
55 pdg::IslMap
*rel
= dep
->relation
;
56 isl_map
*map
= rel
->get_isl_map(ctx
);
57 p
= isl_printer_print_str(p
, "type: ");
58 p
= isl_printer_print_int(p
, dep
->type
);
59 p
= isl_printer_end_line(p
);
60 p
= isl_printer_print_int(p
, from
->nr
);
61 p
= isl_printer_print_str(p
, ",");
62 p
= isl_printer_print_int(p
, from_access
);
63 p
= isl_printer_print_str(p
, " (");
64 p
= isl_printer_print_str(p
, from_f
);
65 p
= isl_printer_print_str(p
, ",line ");
66 p
= isl_printer_print_int(p
, from
->statement
->line
);
67 p
= isl_printer_print_str(p
, ") --(");
69 p
= isl_printer_print_str(p
, dep
->array
->name
->s
.c_str());
70 for (int j
= 0; j
< dep
->from_controls
.size(); ++j
) {
72 p
= isl_printer_print_str(p
, ",");
73 p
= isl_printer_print_str(p
, dep
->from_controls
[j
]->s
.c_str());
75 for (int j
= 0; j
< dep
->to_controls
.size(); ++j
) {
77 p
= isl_printer_print_str(p
, ",");
79 p
= isl_printer_print_str(p
, "; ");
80 p
= isl_printer_print_str(p
, dep
->to_controls
[j
]->s
.c_str());
82 p
= isl_printer_print_str(p
, ")--> ");
83 p
= isl_printer_print_int(p
, to
->nr
);
84 p
= isl_printer_print_str(p
, ",");
85 p
= isl_printer_print_int(p
, to_access
);
86 p
= isl_printer_print_str(p
, " (");
87 p
= isl_printer_print_str(p
, to_f
);
88 p
= isl_printer_print_str(p
, ",line ");
89 p
= isl_printer_print_int(p
, to
->statement
->line
);
90 p
= isl_printer_print_str(p
, "): ");
91 p
= isl_printer_print_map(p
, map
);
92 p
= isl_printer_end_line(p
);
94 if (dep
->extended_relation
) {
95 pdg::IslMap
*rel
= dep
->extended_relation
;
96 isl_map
*map
= rel
->get_isl_map(ctx
);
97 p
= isl_printer_print_str(p
, "extended: ");
98 p
= isl_printer_print_map(p
, map
);
99 p
= isl_printer_end_line(p
);
102 if (dep
->controlled_relation
) {
103 isl_map
*map
= dep
->controlled_relation
->map
;
104 p
= isl_printer_print_str(p
, "controlled: ");
105 p
= isl_printer_print_map(p
, map
);
106 p
= isl_printer_end_line(p
);