pn2adg.cc: edge_name: allocate enough space for edge name
[ppn.git] / dump_schedules.cc
blobb23a3187da175430a4ab86b9ad971a25e9bb8e70
1 #include <isl/map.h>
3 #include <isa/yaml.h>
4 #include <isa/pdg.h>
6 using namespace pdg;
8 int main(int argc, char * argv[])
10 PDG *pdg;
11 isl_ctx *ctx = isl_ctx_alloc();
12 isl_printer *p;
13 pdg = PDG::Load(stdin, ctx);
15 p = isl_printer_to_file(ctx, stdout);
17 for (int i = 0; i < pdg->nodes.size(); ++i) {
18 pdg::node *node = pdg->nodes[i];
19 isl_map *map = node->schedule->get_isl_map(ctx);
20 p = isl_printer_print_str(p, "node ");
21 p = isl_printer_print_int(p, node->nr);
22 p = isl_printer_print_str(p, ": ");
23 p = isl_printer_print_map(p, map);
24 p = isl_printer_end_line(p);
25 isl_map_free(map);
28 pdg->free();
29 delete pdg;
30 isl_printer_free(p);
31 isl_ctx_free(ctx);
33 return 0;