* */
| 560 | * |
| 561 | */ |
| 562 | void |
| 563 | Function::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 |
no test coverage detected