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]

Re: [RFA] Implement DW_TAG_*_parameter_pack


On 09/18/2009 03:34 PM, Dodji Seketeli wrote:
Le 18/09/2009 19:57, Jason Merrill a écrit :
I don't see why it wouldn't. DECL_PARM_INDEX is set at parse time, so
all parms expanded from a single function parameter pack will have the
same value.

It makes sense. The attached patch does that.

No, it doesn't; I still see


+    /* OK, this is a hack. We know that if PARAM_DECL is expanded from PACK,
+       its name (built with make_ith_pack_parameter_name) is the string "<foo>#N"
+       where <foo> is the name of PACK and N is a number.
+       So we just check that naming pattern.  */
+    if (! strncmp (IDENTIFIER_POINTER (DECL_NAME (param_decl)),
+		   IDENTIFIER_POINTER (DECL_NAME (pack)),
+		   IDENTIFIER_LENGTH (DECL_NAME (pack)))
+	&& (IDENTIFIER_LENGTH (DECL_NAME (pack))
+	    < IDENTIFIER_LENGTH (DECL_NAME (param_decl)))
+	&& (IDENTIFIER_POINTER
+	    (DECL_NAME (param_decl))[IDENTIFIER_LENGTH (DECL_NAME (pack))]
+	    == '#'))
+      return true;

Jason



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