9 int main(int argc
, char * argv
[])
12 isl_ctx
*ctx
= isl_ctx_alloc();
13 pdg
= PDG::Load(stdin
, ctx
);
15 for (int i
= 0; i
< pdg
->dependences
.size(); ++i
) {
16 pdg::dependence
*dep
= pdg
->dependences
[i
];
17 if (dep
->type
== pdg::dependence::uninitialized
)
19 pdg::node
* from
= dep
->from
;
20 pdg::node
* to
= dep
->to
;
21 int from_access
= dep
->from_access
? dep
->from_access
->nr
: -1;
22 int to_access
= dep
->to_access
? dep
->to_access
->nr
: -1;
23 const char *from_f
= from
->statement
->top_function
?
24 from
->statement
->top_function
->name
->s
.c_str() :
26 const char *to_f
= to
->statement
->top_function
?
27 to
->statement
->top_function
->name
->s
.c_str() : "(none)";
28 printf("%d,%d (%s,line %d) --(%s)--> %d,%d (%s,line %d): %s\n",
29 from
->nr
, from_access
, from_f
, from
->statement
->line
,
30 dep
->array
->name
->s
.c_str(),
31 to
->nr
, to_access
, to_f
, to
->statement
->line
,
32 dep
->size
? dep
->size
->s
->c_str() : "(unknown)"