This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: CALL_EXPR representation part 8/9 (OBJC front end)
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Brooks Moses <brooks dot moses at codesourcery dot com>, Lee Millward <lee dot millward at codesourcery dot com>
- Date: Sat, 10 Feb 2007 10:44:32 -0500
- Subject: PATCH: CALL_EXPR representation part 8/9 (OBJC front end)
This is part 8 of the patch to change the CALL_EXPR representation. This piece
contains the changes to the OBJC front end.
-Sandra
2007-02-09 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
Index: gcc/objc/objc-act.c
===================================================================
*** gcc/objc/objc-act.c (revision 121705)
--- gcc/objc/objc-act.c (working copy)
*************** receiver_is_class_object (tree receiver,
*** 6131,6137 ****
/* The receiver is a function call that returns an id. Check if
it is a call to objc_getClass, if so, pick up the class name. */
if (TREE_CODE (receiver) == CALL_EXPR
! && (exp = TREE_OPERAND (receiver, 0))
&& TREE_CODE (exp) == ADDR_EXPR
&& (exp = TREE_OPERAND (exp, 0))
&& TREE_CODE (exp) == FUNCTION_DECL
--- 6131,6137 ----
/* The receiver is a function call that returns an id. Check if
it is a call to objc_getClass, if so, pick up the class name. */
if (TREE_CODE (receiver) == CALL_EXPR
! && (exp = CALL_EXPR_FN (receiver))
&& TREE_CODE (exp) == ADDR_EXPR
&& (exp = TREE_OPERAND (exp, 0))
&& TREE_CODE (exp) == FUNCTION_DECL
*************** receiver_is_class_object (tree receiver,
*** 6141,6149 ****
&& TREE_TYPE (exp) == TREE_TYPE (objc_get_class_decl)
&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (exp)), TAG_GETCLASS)
/* We have a call to objc_get_class/objc_getClass! */
! && (arg = TREE_OPERAND (receiver, 1))
! && TREE_CODE (arg) == TREE_LIST
! && (arg = TREE_VALUE (arg)))
{
STRIP_NOPS (arg);
if (TREE_CODE (arg) == ADDR_EXPR
--- 6141,6147 ----
&& TREE_TYPE (exp) == TREE_TYPE (objc_get_class_decl)
&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (exp)), TAG_GETCLASS)
/* We have a call to objc_get_class/objc_getClass! */
! && (arg = CALL_EXPR_ARG (receiver, 0)))
{
STRIP_NOPS (arg);
if (TREE_CODE (arg) == ADDR_EXPR
*************** objc_gimplify_expr (tree *expr_p, tree *
*** 9517,9523 ****
tree
objc_get_callee_fndecl (tree call_expr)
{
! tree addr = TREE_OPERAND (call_expr, 0);
if (TREE_CODE (addr) != OBJ_TYPE_REF)
return 0;
--- 9515,9521 ----
tree
objc_get_callee_fndecl (tree call_expr)
{
! tree addr = CALL_EXPR_FN (call_expr);
if (TREE_CODE (addr) != OBJ_TYPE_REF)
return 0;