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

Method get_direct_invocation

src/Statement.cpp:760–780  ·  view source on GitHub ↗

* find all the functions directly called in this statement */

Source from the content-addressed store, hash-verified

758 * find all the functions directly called in this statement
759 */
760const FunctionInvocation*
761Statement::get_direct_invocation(void) const
762{
763 if (eType == eAssign) {
764 const Expression* e = ((const StatementAssign*)this)->get_expr();
765 if (e->term_type == eFunction) {
766 return ((const ExpressionFuncall*)e)->get_invoke();
767 }
768 }
769 else if (eType == eInvoke) {
770 return ((const StatementExpr*)this)->get_invoke();
771 }
772 else if (eType == eIfElse) {
773 const StatementIf* si = (const StatementIf*)this;
774 const Expression* e = si->get_test();
775 if (e->term_type == eFunction) {
776 return ((const ExpressionFuncall*)e)->get_invoke();
777 }
778 }
779 return NULL;
780}
781
782/*
783 * find all the function calls in this statement

Callers 4

output_alt_exprsMethod · 0.80
rewrite_func_callsMethod · 0.80

Calls 3

get_exprMethod · 0.80
get_invokeMethod · 0.45
get_testMethod · 0.45

Tested by

no test coverage detected