* tree-ssa.h: Remove gimple-low.h from include list.
* gimple-low.c (gimple_check_call_arg, gimple_check_call_matching_types):
Move to cgraph.c.
* gimple-low.h: Remove prototype.
* cgraph.c: (gimple_check_call_arg, gimple_check_call_matching_types):
Relocate from gimple-low.c.
* cgraph.h: Add prototype,
* gimplify.c: Add gimple-low to include list.
* omp-low.c: Add gimple-low to include list.
* tree-eh.c: Add gimple-low to include list.
* tree-nested.c: Add gimple-low to include list.
*************** along with GCC; see the file COPYING3.
#include "tree-ssa-address.h"
#include "tree-ssa-loop.h"
#include "tree-into-ssa.h"
- #include "gimple-low.h"
#include "tree-dfa.h"
/* Mapping for redirected edges. */
*************** along with GCC; see the file COPYING3.
#include "diagnostic-core.h"
#include "tree-pass.h"
#include "langhooks.h"
+ #include "gimple-low.h"
/* The differences between High GIMPLE and Low GIMPLE are the
following:
*************** make_pass_lower_cf (gcc::context *ctxt)
return new pass_lower_cf (ctxt);
}
-
-
- /* Verify if the type of the argument matches that of the function
- declaration. If we cannot verify this or there is a mismatch,
- return false. */
-
- static bool
- gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match)
- {
- tree parms, p;
- unsigned int i, nargs;
-
- /* Calls to internal functions always match their signature. */
- if (gimple_call_internal_p (stmt))
- return true;
-
- nargs = gimple_call_num_args (stmt);
-
- /* Get argument types for verification. */
- if (fndecl)
- parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
- else
- parms = TYPE_ARG_TYPES (gimple_call_fntype (stmt));
-
- /* Verify if the type of the argument matches that of the function
- declaration. If we cannot verify this or there is a mismatch,
- return false. */
- if (fndecl && DECL_ARGUMENTS (fndecl))
- {
- for (i = 0, p = DECL_ARGUMENTS (fndecl);
- i < nargs;
- i++, p = DECL_CHAIN (p))
- {
- tree arg;
- /* We cannot distinguish a varargs function from the case
- of excess parameters, still deferring the inlining decision
- to the callee is possible. */
- if (!p)
- break;
- arg = gimple_call_arg (stmt, i);
- if (p == error_mark_node
- || arg == error_mark_node
- || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg))
- && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
- return false;
- }
- if (args_count_match && p)
- return false;
- }
- else if (parms)
- {
- for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
- {
- tree arg;
- /* If this is a varargs function defer inlining decision
- to callee. */
- if (!p)
- break;
- arg = gimple_call_arg (stmt, i);
- if (TREE_VALUE (p) == error_mark_node
- || arg == error_mark_node
- || TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
- || (!types_compatible_p (TREE_VALUE (p), TREE_TYPE (arg))
- && !fold_convertible_p (TREE_VALUE (p), arg)))
- return false;
- }
- }
- else
- {
- if (nargs != 0)
- return false;
- }
- return true;
- }
-
- /* Verify if the type of the argument and lhs of CALL_STMT matches
- that of the function declaration CALLEE. If ARGS_COUNT_MATCH is
- true, the arg count needs to be the same.
- If we cannot verify this or there is a mismatch, return false. */
-
- bool
- gimple_check_call_matching_types (gimple call_stmt, tree callee,
- bool args_count_match)
- {
- tree lhs;
-
- if ((DECL_RESULT (callee)
- && !DECL_BY_REFERENCE (DECL_RESULT (callee))
- && (lhs = gimple_call_lhs (call_stmt)) != NULL_TREE
- && !useless_type_conversion_p (TREE_TYPE (DECL_RESULT (callee)),
- TREE_TYPE (lhs))
- && !fold_convertible_p (TREE_TYPE (DECL_RESULT (callee)), lhs))
- || !gimple_check_call_args (call_stmt, callee, args_count_match))
- return false;
- return true;
- }
-
/* Lower sequence SEQ. Unlike gimplification the statements are not relowered
when they are changed -- if this has to be done, the lowering routine must
do it explicitly. DATA is passed through the recursion. */
*************** along with GCC; see the file COPYING3.
#ifndef GCC_GIMPLE_LOW_H
#define GCC_GIMPLE_LOW_H
- extern bool gimple_check_call_matching_types (gimple, tree, bool);
extern bool gimple_stmt_may_fallthru (gimple);
extern bool gimple_seq_may_fallthru (gimple_seq);
extern void record_vars_into (tree, tree);
*************** cgraph_get_body (struct cgraph_node *nod
return true;
}
+ /* Verify if the type of the argument matches that of the function
+ declaration. If we cannot verify this or there is a mismatch,
+ return false. */
+
+ static bool
+ gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match)
+ {
+ tree parms, p;
+ unsigned int i, nargs;
+
+ /* Calls to internal functions always match their signature. */
+ if (gimple_call_internal_p (stmt))
+ return true;
+
+ nargs = gimple_call_num_args (stmt);
+
+ /* Get argument types for verification. */
+ if (fndecl)
+ parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ else
+ parms = TYPE_ARG_TYPES (gimple_call_fntype (stmt));
+
+ /* Verify if the type of the argument matches that of the function
+ declaration. If we cannot verify this or there is a mismatch,
+ return false. */
+ if (fndecl && DECL_ARGUMENTS (fndecl))
+ {
+ for (i = 0, p = DECL_ARGUMENTS (fndecl);
+ i < nargs;
+ i++, p = DECL_CHAIN (p))
+ {
+ tree arg;
+ /* We cannot distinguish a varargs function from the case
+ of excess parameters, still deferring the inlining decision
+ to the callee is possible. */
+ if (!p)
+ break;
+ arg = gimple_call_arg (stmt, i);
+ if (p == error_mark_node
+ || arg == error_mark_node
+ || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg))
+ && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
+ return false;
+ }
+ if (args_count_match && p)
+ return false;
+ }
+ else if (parms)
+ {
+ for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
+ {
+ tree arg;
+ /* If this is a varargs function defer inlining decision
+ to callee. */
+ if (!p)
+ break;
+ arg = gimple_call_arg (stmt, i);
+ if (TREE_VALUE (p) == error_mark_node
+ || arg == error_mark_node
+ || TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
+ || (!types_compatible_p (TREE_VALUE (p), TREE_TYPE (arg))
+ && !fold_convertible_p (TREE_VALUE (p), arg)))
+ return false;
+ }
+ }
+ else
+ {
+ if (nargs != 0)
+ return false;
+ }
+ return true;
+ }
+
+ /* Verify if the type of the argument and lhs of CALL_STMT matches
+ that of the function declaration CALLEE. If ARGS_COUNT_MATCH is
+ true, the arg count needs to be the same.
+ If we cannot verify this or there is a mismatch, return false. */
+
+ bool
+ gimple_check_call_matching_types (gimple call_stmt, tree callee,
+ bool args_count_match)
+ {
+ tree lhs;
+
+ if ((DECL_RESULT (callee)
+ && !DECL_BY_REFERENCE (DECL_RESULT (callee))
+ && (lhs = gimple_call_lhs (call_stmt)) != NULL_TREE
+ && !useless_type_conversion_p (TREE_TYPE (DECL_RESULT (callee)),
+ TREE_TYPE (lhs))
+ && !fold_convertible_p (TREE_TYPE (DECL_RESULT (callee)), lhs))
+ || !gimple_check_call_args (call_stmt, callee, args_count_match))
+ return false;
+ return true;
+ }
+
#include "gt-cgraph.h"
*************** void cgraph_speculative_call_info (struc
struct cgraph_edge *&,
struct cgraph_edge *&,
struct ipa_ref *&);
+ extern bool gimple_check_call_matching_types (gimple, tree, bool);
/* In cgraphunit.c */
struct asm_node *add_asm_node (tree);
*************** along with GCC; see the file COPYING3.
#include "splay-tree.h"
#include "vec.h"
#include "omp-low.h"
+ #include "gimple-low.h"
#include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
#include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
*************** along with GCC; see the file COPYING3.
#include "cfgloop.h"
#include "target.h"
#include "omp-low.h"
+ #include "gimple-low.h"
/* Lowering of OpenMP parallel and workshare constructs proceeds in two
*************** along with GCC; see the file COPYING3.
#include "gimple.h"
#include "target.h"
#include "cfgloop.h"
+ #include "gimple-low.h"
/* In some instances a tree and a gimple need to be stored in a same table,
i.e. in hash tables. This is a structure to do this. */
***************
#include "expr.h" /* FIXME: For STACK_SAVEAREA_MODE and SAVE_NONLOCAL. */
#include "langhooks.h"
#include "pointer-set.h"
+ #include "gimple-low.h"
/* The object of this pass is to lower the representation of a set of nested