MCPcopy Create free account
hub / github.com/csmith-project/csmith / Output

Method Output

src/Function.cpp:562–602  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

560 *
561 */
562void
563Function::Output(std::ostream &out)
564{
565 if (is_builtin)
566 return;
567 OutputMgr::set_curr_func(name);
568 output_comment_line(out, "------------------------------------------");
569 if (!CGOptions::concise()) {
570 feffect.Output(out);
571 }
572 OutputHeader(out);
573 outputln(out);
574
575 if (CGOptions::depth_protect()) {
576 out << "if (DEPTH < MAX_DEPTH) ";
577 outputln(out);
578 }
579
580 FactMgr* fm = get_fact_mgr_for_func(this);
581 // if nothing interesting happens, we don't want to see facts for statements
582 if (!fact_changed && !union_field_read && !is_pointer_referenced()) {
583 fm = 0;
584 }
585 body->Output(out, fm);
586
587 if (CGOptions::depth_protect()) {
588 out << "else";
589 outputln(out);
590
591 // TODO: Needs to be fixed when return types are no longer simple
592 // types.
593
594 out << "return ";
595 ret_c->Output(out);
596 out << ";";
597 outputln(out);
598 }
599
600 outputln(out);
601 outputln(out);
602}
603
604/*
605 * Used for protecting depth

Callers 2

OutputFormalParamListMethod · 0.45
OutputFunctionFunction · 0.45

Calls 3

output_comment_lineFunction · 0.85
outputlnFunction · 0.85
get_fact_mgr_for_funcFunction · 0.85

Tested by

no test coverage detected