From patchwork Mon Aug 9 12:59:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: use stdarg_p more Date: Mon, 09 Aug 2010 02:59:50 -0000 From: Nathan Froyd X-Patchwork-Id: 61269 Message-Id: <20100809125950.GK4130@codesourcery.com> To: gcc-patches@gcc.gnu.org Cc: mark@codesourcery.com On Sun, Aug 08, 2010 at 09:00:04PM -0700, Nathan Froyd wrote: > The patch below converts several places that poke directly at the > internal representation of TYPE_ARG_TYPES to determine varargs-ness to > use stdarg_p instead. The old LTO branch did this, but it didn't touch > all the backends. I identified relevant backends by grep'ing for '[=!]= > void_type_node' and starting at the matches found. I did the same thing > for *.[ch] in gcc/, but there weren't any other likely candidates other > than the places already identified. It's possible that I missed some. > > Tested on x86_64-unknown-linux-gnu and cross to > arm-eabi/powerpc-eabispe. OK to commit? Apparently I missed a hunk in generating my diff. Mark, does this look OK for the C++ frontend? -Nathan gcc/cp/ * tree.c (varargs_function_p): Use stdarg_p. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 5441448..af5a82f 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2284,11 +2284,7 @@ error_type (tree arg) int varargs_function_p (const_tree function) { - const_tree parm = TYPE_ARG_TYPES (TREE_TYPE (function)); - for (; parm; parm = TREE_CHAIN (parm)) - if (TREE_VALUE (parm) == void_type_node) - return 0; - return 1; + return stdarg_p (TREE_TYPE (function)); } /* Returns 1 if decl is a member of a class. */