Dear all, i'm using cil-1.5.1 and would like to know if it is possible to emit a three-address code representation that is actually flattened. For instance, while statements should not be allowed by replaced equivalent code using goto.
I have used --domakeCFG and --dosimplify, however the generated C code is not flattened; hierarchy and some high-level features are visible. The same applies to if-statements; is it possible to emit if-statements only as conditional jumps and not as basic block guards? I have an example to showcase what I mean, which comprises of a simple loop. // loop1.c (initial C source) for (ix = 0; ix < inp; ix++) ; // loop1.cil.c (generated by CIL) ix = 0; { while (1) { while_continue: /* CIL Label */ ; if (! (ix < inp)) { goto while_break; } ix ++; } while_break: /* CIL Label */ ; } // loop1.nac.c (lower-level C for loop1) #include <stdio.h> #include <math.h> #include "main.h" ix = 0; goto D_1362; D_1361: ix = ix + 1; goto D_1362; D_1362: if (ix < inp) {goto D_1361;} else {goto D_1363;} D_1363: Best regards Nikolaos Kavvadias ------------------------------------------------------------------------------ The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ CIL-users mailing list CIL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cil-users