This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [COMMITTED 1/3] Make TARGET_STATIC_CHAIN allow a function type
- From: Jeff Law <law at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Nov 2014 10:14:11 -0700
- Subject: Re: [COMMITTED 1/3] Make TARGET_STATIC_CHAIN allow a function type
- Authentication-results: sourceware.org; auth=none
- References: <1416409132-16336-1-git-send-email-rth at redhat dot com> <1416409132-16336-2-git-send-email-rth at redhat dot com>
On 11/19/14 07:58, Richard Henderson wrote:
As opposed to always being a decl. This is a prerequisite
to allowing the static chain to be loaded for indirect calls.
* targhooks.c (default_static_chain): Remove check for
DECL_STATIC_CHAIN.
* config/moxie/moxie.c (moxie_static_chain): Likewise.
* config/i386/i386.c (ix86_static_chain): Allow decl or type
as the first argument.
* config/xtensa/xtensa.c (xtensa_static_chain): Change the name
of the unused first parameter.
* doc/tm.texi (TARGET_STATIC_CHAIN): Document the first parameter
may be a type.
* target.def (static_chain): Likewise.
[ ... ]
- fntype = TREE_TYPE (fndecl);
+ if (TREE_CODE (fndecl_or_type) == FUNCTION_DECL)
+ {
+ fntype = TREE_TYPE (fndecl_or_type);
+ fndecl = fndecl_or_type;
+ }
+ else
+ {
+ fntype = fndecl_or_type;
+ fndecl = NULL;
+ }
+
Looks like there's some spaces vs tabs goof in the true arm of that
conditional. With that nit fixed, this is OK.
jeff