/// Print a source code representation of the program. void Cloog::pprint(raw_ostream &OS) { FileToString *Output = new FileToString(); clast_pprint(Output->getInputFile(), ClastRoot, 0, Options); Output->closeInput(); OS << Output->getOutput(); delete (Output); }
void cseed_scop_print_to_c(FILE* output, osl_scop_p scop) { CloogState* state; CloogOptions* options; CloogInput* input; struct clast_stmt* clast; state = cloog_state_malloc(); options = cloog_options_malloc(state); options->openscop = 1; cloog_options_copy_from_osl_scop(scop, options); input = cloog_input_from_osl_scop(options->state, scop); clast = cloog_clast_create_from_input(input, options); clast_pprint(output, clast, 0, options); cloog_clast_free(clast); options->scop = NULL; // don't free the scop cloog_options_free(options); cloog_state_free(state); // the input is freed inside }
int main() { CloogState *state; CloogInput *input; CloogOptions * options ; struct clast_stmt *root; state = cloog_state_malloc(); options = cloog_options_malloc(state); input = cloog_input_read(stdin, options); root = cloog_clast_create_from_input(input, options); clast_pprint(stdout, root, 0, options); cloog_clast_free(root); cloog_options_free(options) ; cloog_state_free(state); return 0 ; }