diff options
Diffstat (limited to 'contrib/gcc/cp/tree.c')
-rw-r--r-- | contrib/gcc/cp/tree.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/contrib/gcc/cp/tree.c b/contrib/gcc/cp/tree.c index d39ff76..2e41211 100644 --- a/contrib/gcc/cp/tree.c +++ b/contrib/gcc/cp/tree.c @@ -1,6 +1,6 @@ /* Language-dependent node constructors for parse phase of GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -1546,6 +1546,12 @@ cp_tree_equal (tree t1, tree t2) case IDENTIFIER_NODE: return false; + case BASELINK: + return (BASELINK_BINFO (t1) == BASELINK_BINFO (t2) + && BASELINK_ACCESS_BINFO (t1) == BASELINK_ACCESS_BINFO (t2) + && cp_tree_equal (BASELINK_FUNCTIONS (t1), + BASELINK_FUNCTIONS (t2))); + case TEMPLATE_PARM_INDEX: return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2) && TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2) @@ -1598,6 +1604,11 @@ cp_tree_equal (tree t1, tree t2) return same_type_p (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2)); + case OVERLOAD: + if (OVL_FUNCTION (t1) != OVL_FUNCTION (t2)) + return false; + return cp_tree_equal (OVL_CHAIN (t1), OVL_CHAIN (t2)); + default: break; } @@ -1764,6 +1775,8 @@ pod_type_p (tree t) return 1; /* pointer to non-member */ if (TYPE_PTR_TO_MEMBER_P (t)) return 1; /* pointer to member */ + if (TREE_CODE (t) == VECTOR_TYPE) + return 1; /* vectors are (small) arrays of scalars */ if (! CLASS_TYPE_P (t)) return 0; /* other non-class type (reference or function) */ @@ -2494,6 +2507,8 @@ stabilize_init (tree init, tree *initp) t = TREE_OPERAND (t, 1); if (TREE_CODE (t) == TARGET_EXPR) t = TARGET_EXPR_INITIAL (t); + if (TREE_CODE (t) == COMPOUND_EXPR) + t = expr_last (t); if (TREE_CODE (t) == CONSTRUCTOR && CONSTRUCTOR_ELTS (t) == NULL_TREE) { @@ -2507,12 +2522,28 @@ stabilize_init (tree init, tree *initp) if (TREE_CODE (t) == COND_EXPR) return false; - stabilize_call (t, initp); + /* The TARGET_EXPR might be initializing via bitwise copy from + another variable; leave that alone. */ + if (TREE_SIDE_EFFECTS (t)) + stabilize_call (t, initp); } return true; } +/* Like "fold", but should be used whenever we might be processing the + body of a template. */ + +tree +fold_if_not_in_template (tree expr) +{ + /* In the body of a template, there is never any need to call + "fold". We will call fold later when actually instantiating the + template. Integral constant expressions in templates will be + evaluated via fold_non_dependent_expr, as necessary. */ + return (processing_template_decl ? expr : fold (expr)); +} + #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) /* Complain that some language-specific thing hanging off a tree |