You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "config.h"
#include "system.h"
ipa_method_tree_map_create (struct cgraph_node *mt)
{
IPA_NODE_REF (mt)->ipa_param_tree =
- xcalloc (ipa_method_formal_count (mt), sizeof (tree));
+ XCNEWVEC (tree, ipa_method_formal_count (mt));
}
/* Create modify structure for MT. */
ipa_method_modify_create (struct cgraph_node *mt)
{
((struct ipa_node *) mt->aux)->ipa_mod =
- xcalloc (ipa_method_formal_count (mt), sizeof (bool));
+ XCNEWVEC (bool, ipa_method_formal_count (mt));
}
/* Set modify of I-th formal of MT to VAL. */
ipa_callsite_param_map_create (struct cgraph_edge *cs)
{
IPA_EDGE_REF (cs)->ipa_param_map =
- xcalloc (ipa_callsite_param_count (cs), sizeof (struct ipa_jump_func));
+ XCNEWVEC (struct ipa_jump_func, ipa_callsite_param_count (cs));
}
/* Return the call expr tree related to callsite CS. */
ipa_callsite_compute_param (struct cgraph_edge *cs)
{
tree call_tree;
- tree arg, cst_decl, arg_type, formal_type;
+ tree arg, cst_decl;
int arg_num;
int i;
struct cgraph_node *mt;
ipa_callsite_param_set_type (cs, arg_num, UNKNOWN_IPATYPE);
else
{
- arg_type = TREE_TYPE (TREE_VALUE (arg));
- formal_type = TREE_TYPE (ipa_method_get_tree (cs->callee, arg_num));
- if (TYPE_NAME (arg_type) == TYPE_NAME (formal_type)
- && TYPE_CONTEXT (arg_type) == TYPE_CONTEXT (formal_type)
- && attribute_list_equal (TYPE_ATTRIBUTES (arg_type),
- TYPE_ATTRIBUTES (formal_type)))
- {
- ipa_callsite_param_set_type (cs, arg_num, FORMAL_IPATYPE);
- ipa_callsite_param_set_info_type_formal (cs, arg_num, i);
- }
- else
- ipa_callsite_param_set_type (cs, arg_num, UNKNOWN_IPATYPE);
+ ipa_callsite_param_set_type (cs, arg_num, FORMAL_IPATYPE);
+ ipa_callsite_param_set_info_type_formal (cs, arg_num, i);
}
}
/* If a constant value was passed as argument,
else if (TREE_CODE (TREE_VALUE (arg)) == INTEGER_CST
|| TREE_CODE (TREE_VALUE (arg)) == REAL_CST)
{
- arg_type = TREE_TYPE (TREE_VALUE (arg));
- formal_type = TREE_TYPE (ipa_method_get_tree (cs->callee, arg_num));
- if (TYPE_NAME (arg_type) == TYPE_NAME (formal_type)
- && TYPE_CONTEXT (arg_type) == TYPE_CONTEXT (formal_type)
- && attribute_list_equal (TYPE_ATTRIBUTES (arg_type),
- TYPE_ATTRIBUTES (formal_type)))
- {
- ipa_callsite_param_set_type (cs, arg_num, CONST_IPATYPE);
- ipa_callsite_param_set_info_type (cs, arg_num, TREE_VALUE (arg));
- }
- else
- ipa_callsite_param_set_type (cs, arg_num, UNKNOWN_IPATYPE);
+ ipa_callsite_param_set_type (cs, arg_num, CONST_IPATYPE);
+ ipa_callsite_param_set_info_type (cs, arg_num,
+ TREE_VALUE (arg));
}
/* This is for the case of Fortran. If the address of a const_decl
was passed as argument then we store
- CONST_IPATYPE_REF/CONST_IPATYPE_REF and the costant
+ CONST_IPATYPE_REF/CONST_IPATYPE_REF and the constant
value as the jump function corresponding to this argument. */
else if (TREE_CODE (TREE_VALUE (arg)) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (TREE_VALUE (arg), 0)) ==
CONST_DECL)
{
cst_decl = TREE_OPERAND (TREE_VALUE (arg), 0);
- arg_type = TREE_TYPE (DECL_INITIAL (cst_decl));
- formal_type =
- TREE_TYPE (TREE_TYPE (ipa_method_get_tree (cs->callee, arg_num)));
if (TREE_CODE (DECL_INITIAL (cst_decl)) == INTEGER_CST
|| TREE_CODE (DECL_INITIAL (cst_decl)) == REAL_CST)
{
- if (TYPE_NAME (arg_type) == TYPE_NAME (formal_type)
- && TYPE_CONTEXT (arg_type) == TYPE_CONTEXT (formal_type)
- && attribute_list_equal (TYPE_ATTRIBUTES (arg_type),
- TYPE_ATTRIBUTES (formal_type)))
-
- {
- ipa_callsite_param_set_type (cs, arg_num,
- CONST_IPATYPE_REF);
- ipa_callsite_param_set_info_type (cs, arg_num, DECL_INITIAL (cst_decl));
-
- }
- else
- ipa_callsite_param_set_type (cs, arg_num, UNKNOWN_IPATYPE);
+ ipa_callsite_param_set_type (cs, arg_num,
+ CONST_IPATYPE_REF);
+ ipa_callsite_param_set_info_type (cs, arg_num,
+ DECL_INITIAL (cst_decl));
}
}
else