This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: remove cxx_expand_expr


Near as I can tell, the cxx_expand_expr function no longer performs
useful work.  This patch removes it.

Tested with a C/C++/Java bootstrap and testsuite on i686-pc-linux-gnu.

Ollie


:ADDPATCH c++:

2007-10-11  Ollie Wild  <aaw@google.com>

    * expr.c (cxx_expand_expr): Removed.
    * cp-tree.h (cxx_expand_expr): Removed.
    * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
    with c_expand_expr.
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 60d7818..8fc6987 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -51,7 +51,7 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
 #undef LANG_HOOKS_GET_ALIAS_SET
 #define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
 #undef LANG_HOOKS_EXPAND_EXPR
-#define LANG_HOOKS_EXPAND_EXPR cxx_expand_expr
+#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
 #undef LANG_HOOKS_EXPAND_DECL
 #define LANG_HOOKS_EXPAND_DECL c_expand_decl
 #undef LANG_HOOKS_PARSE_FILE
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index bd9292a..64fb180 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4335,9 +4335,6 @@ extern void choose_personality_routine		(enum languages);
 extern tree eh_type_info			(tree);
 
 /* in expr.c */
-extern rtx cxx_expand_expr			(tree, rtx,
-						 enum machine_mode,
-						 int, rtx *);
 extern tree cplus_expand_constant		(tree);
 
 /* friend.c */
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index b518646..feafd70 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -82,46 +82,3 @@ cplus_expand_constant (tree cst)
 
   return cst;
 }
-
-/* Hook used by expand_expr to expand language-specific tree codes.  */
-/* ??? The only thing that should be here are things needed to expand
-   constant initializers; everything else should be handled by the
-   gimplification routines.  Are EMPTY_CLASS_EXPR or BASELINK needed?  */
-
-rtx
-cxx_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier,
-		 rtx *alt_rtl)
-{
-  tree type = TREE_TYPE (exp);
-  enum machine_mode mode = TYPE_MODE (type);
-  enum tree_code code = TREE_CODE (exp);
-
-  /* No sense saving up arithmetic to be done
-     if it's all in the wrong mode to form part of an address.
-     And force_operand won't know whether to sign-extend or zero-extend.  */
-
-  if (mode != Pmode && modifier == EXPAND_SUM)
-    modifier = EXPAND_NORMAL;
-
-  switch (code)
-    {
-    case PTRMEM_CST:
-      return expand_expr (cplus_expand_constant (exp),
-			  target, tmode, modifier);
-
-    case OFFSET_REF:
-      /* Offset refs should not make it through to here.  */
-      gcc_unreachable ();
-
-    case EMPTY_CLASS_EXPR:
-      /* We don't need to generate any code for an empty class.  */
-      return const0_rtx;
-
-    case BASELINK:
-      return expand_expr (BASELINK_FUNCTIONS (exp), target, tmode,
-			  modifier);
-
-    default:
-      return c_expand_expr (exp, target, tmode, modifier, alt_rtl);
-    }
-}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]