9 int main(int argc
, char * argv
[])
12 isl_ctx
*ctx
= isl_ctx_alloc();
13 pdg
= PDG::Load(stdin
, ctx
);
15 printf("digraph dummy {\n");
16 for (int i
= 0; i
< pdg
->nodes
.size(); ++i
) {
17 pdg::node
*node
= pdg
->nodes
[i
];
18 if (node
->statement
->top_function
)
19 printf("ND_%d [label = \"%s\"];\n",
20 node
->nr
, node
->statement
->top_function
->name
->s
.c_str());
22 printf("ND_%d;\n", node
->nr
);
24 for (int i
= 0; i
< pdg
->dependences
.size(); ++i
) {
25 pdg::dependence
*dep
= pdg
->dependences
[i
];
26 if (dep
->type
== pdg::dependence::uninitialized
)
28 if (dep
->type
== pdg::dependence::pn_part
)
30 pdg::node
* from
= dep
->from
;
31 pdg::node
* to
= dep
->to
;
32 printf("ND_%d -> ND_%d [label = \"", from
->nr
, to
->nr
);
34 printf("%s", dep
->array
->name
->s
.c_str());
35 for (int j
= 0; j
< dep
->from_controls
.size(); ++j
) {
38 printf("%s", dep
->from_controls
[j
]->s
.c_str());
40 for (int j
= 0; j
< dep
->to_controls
.size(); ++j
) {
45 printf("%s", dep
->to_controls
[j
]->s
.c_str());
47 printf(": %s\"%s];\n",
48 dep
->size
? dep
->size
->s
->c_str() : "?",
49 dep
->type
== pdg::dependence::pn_union
? " color=\"blue\"" :
50 dep
->type
== pdg::dependence::pn_hold
? " color=\"cyan\"" :
51 dep
->type
== pdg::dependence::pn_shift
? " color=\"magenta\"" :
53 (dep
->multiplicity
? " color=\"yellow\"": " color=\"green\"") :
54 (dep
->multiplicity
? " color=\"red\"": ""));