void parseCallExprNode(CallExprNode *node) { fillType(node); fillExprLocation(node); Log::dump(node); // not recommended // fillExprOperands(node); if (CALL_EXPR_FN(node->gccNode) != NULL_TREE) { node->function = createParseNode( node, CALL_EXPR_FN(node->gccNode), "function"); } else { node->functionName = internal_fn_name(CALL_EXPR_IFN (node->gccNode)); Log::dump(node, "- function: %s", node->functionName.c_str()); } // if (node->parseChilds <= 0) // return; const int argsCount = call_expr_nargs(node->gccNode); for (int f = 0; f < argsCount; f ++) { node->args.push_back(createParseNode( node, CALL_EXPR_ARG(node->gccNode, f), "arg")); } node->chain = createParseNode( node, CALL_EXPR_STATIC_CHAIN(node->gccNode), "chain"); if (node->functionName == "LOAD_LANES") return; }
void expr_hash_elt::print (FILE *stream) { fprintf (stream, "STMT "); if (m_lhs) { print_generic_expr (stream, m_lhs, 0); fprintf (stream, " = "); } switch (m_expr.kind) { case EXPR_SINGLE: print_generic_expr (stream, m_expr.ops.single.rhs, 0); break; case EXPR_UNARY: fprintf (stream, "%s ", get_tree_code_name (m_expr.ops.unary.op)); print_generic_expr (stream, m_expr.ops.unary.opnd, 0); break; case EXPR_BINARY: print_generic_expr (stream, m_expr.ops.binary.opnd0, 0); fprintf (stream, " %s ", get_tree_code_name (m_expr.ops.binary.op)); print_generic_expr (stream, m_expr.ops.binary.opnd1, 0); break; case EXPR_TERNARY: fprintf (stream, " %s <", get_tree_code_name (m_expr.ops.ternary.op)); print_generic_expr (stream, m_expr.ops.ternary.opnd0, 0); fputs (", ", stream); print_generic_expr (stream, m_expr.ops.ternary.opnd1, 0); fputs (", ", stream); print_generic_expr (stream, m_expr.ops.ternary.opnd2, 0); fputs (">", stream); break; case EXPR_CALL: { size_t i; size_t nargs = m_expr.ops.call.nargs; gcall *fn_from; fn_from = m_expr.ops.call.fn_from; if (gimple_call_internal_p (fn_from)) fputs (internal_fn_name (gimple_call_internal_fn (fn_from)), stream); else print_generic_expr (stream, gimple_call_fn (fn_from), 0); fprintf (stream, " ("); for (i = 0; i < nargs; i++) { print_generic_expr (stream, m_expr.ops.call.args[i], 0); if (i + 1 < nargs) fprintf (stream, ", "); } fprintf (stream, ")"); } break; case EXPR_PHI: { size_t i; size_t nargs = m_expr.ops.phi.nargs; fprintf (stream, "PHI <"); for (i = 0; i < nargs; i++) { print_generic_expr (stream, m_expr.ops.phi.args[i], 0); if (i + 1 < nargs) fprintf (stream, ", "); } fprintf (stream, ">"); } break; } if (m_vop) { fprintf (stream, " with "); print_generic_expr (stream, m_vop, 0); } fprintf (stream, "\n"); }