diff mbox

remove C_EXPR_APPEND macro

Message ID CAJXstsBL27WsvAQ-neEg_txSc8ytt5w7vExEwdLma2drKr8OZg@mail.gmail.com
State New
Headers show

Commit Message

Prathamesh Kulkarni Feb. 7, 2014, 9:21 p.m. UTC
On Sat, Feb 8, 2014 at 2:22 AM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Sat, 8 Feb 2014, Prathamesh Kulkarni wrote:
>
>> This patch removes C_EXPR_APPEND macro in c-tree.h
>> OK for trunk ?
>
> Thanks, this is OK with the orphan comment "A varray of c_expr_t." also
> removed (please send the revised patch if you'd like someone to commit it
> for you).
Ah, I missed that, sorry.
Here's the revised patch:

* c-parser.c (c_parser_get_builtin_args): replace calls to
C_EXPR_APPEND (cexpr_list, expr) by vec_safe_push (cexpr_list, expr)

* c-tree.h (C_EXPR_APPEND): removed

>
> Although this is small enough to go in without a copyright assignment,
> it's a good idea to start on the paperwork if you might be making larger
> changes in future.
>
> http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/Copyright/request-assign.future
Thanks
>
> --
> Joseph S. Myers
> joseph@codesourcery.com

Comments

Marek Polacek Feb. 7, 2014, 9:36 p.m. UTC | #1
On Sat, Feb 08, 2014 at 02:51:03AM +0530, Prathamesh Kulkarni wrote:
> On Sat, Feb 8, 2014 at 2:22 AM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> > On Sat, 8 Feb 2014, Prathamesh Kulkarni wrote:
> >
> >> This patch removes C_EXPR_APPEND macro in c-tree.h
> >> OK for trunk ?
> >
> > Thanks, this is OK with the orphan comment "A varray of c_expr_t." also
> > removed (please send the revised patch if you'd like someone to commit it
> > for you).
> Ah, I missed that, sorry.
> Here's the revised patch:
> 
> * c-parser.c (c_parser_get_builtin_args): replace calls to
> C_EXPR_APPEND (cexpr_list, expr) by vec_safe_push (cexpr_list, expr)
> 
> * c-tree.h (C_EXPR_APPEND): removed

I'll fix up the CL and commit it for you.  I suppose you tested this
patch.

	Marek
Prathamesh Kulkarni Feb. 7, 2014, 9:50 p.m. UTC | #2
On Sat, Feb 8, 2014 at 3:06 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Sat, Feb 08, 2014 at 02:51:03AM +0530, Prathamesh Kulkarni wrote:
>> On Sat, Feb 8, 2014 at 2:22 AM, Joseph S. Myers <joseph@codesourcery.com> wrote:
>> > On Sat, 8 Feb 2014, Prathamesh Kulkarni wrote:
>> >
>> >> This patch removes C_EXPR_APPEND macro in c-tree.h
>> >> OK for trunk ?
>> >
>> > Thanks, this is OK with the orphan comment "A varray of c_expr_t." also
>> > removed (please send the revised patch if you'd like someone to commit it
>> > for you).
>> Ah, I missed that, sorry.
>> Here's the revised patch:
>>
>> * c-parser.c (c_parser_get_builtin_args): replace calls to
>> C_EXPR_APPEND (cexpr_list, expr) by vec_safe_push (cexpr_list, expr)
>>
>> * c-tree.h (C_EXPR_APPEND): removed
>
> I'll fix up the CL and commit it for you.  I suppose you tested this
> patch.
Yes, bootstrapped/reg tested on x86_64-linux-gnu
>
>         Marek
diff mbox

Patch

Index: gcc/c/c-parser.c
===================================================================
--- gcc/c/c-parser.c    (revision 207610)
+++ gcc/c/c-parser.c    (working copy)
@@ -6659,12 +6659,12 @@  c_parser_get_builtin_args (c_parser *par
   force_folding_builtin_constant_p
     = saved_force_folding_builtin_constant_p;
   vec_alloc (cexpr_list, 1);
-  C_EXPR_APPEND (cexpr_list, expr);
+  vec_safe_push (cexpr_list, expr);
   while (c_parser_next_token_is (parser, CPP_COMMA))
     {
       c_parser_consume_token (parser);
       expr = c_parser_expr_no_commas (parser, NULL);
-      C_EXPR_APPEND (cexpr_list, expr);
+      vec_safe_push (cexpr_list, expr);
     }

   if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"))
Index: gcc/c/c-tree.h
===================================================================
--- gcc/c/c-tree.h    (revision 207610)
+++ gcc/c/c-tree.h    (working copy)
@@ -132,15 +132,6 @@  struct c_expr
    inside the VEC types.  */
 typedef struct c_expr c_expr_t;

-/* A varray of c_expr_t.  */
-
-/* Append a new c_expr_t element to V.  */
-#define C_EXPR_APPEND(V, ELEM) \
-  do { \
-    c_expr_t __elem = (ELEM); \
-    vec_safe_push (V, __elem); \
-  } while (0)
-
 /* A kind of type specifier.  Note that this information is currently
    only used to distinguish tag definitions, tag references and typeof
    uses.  */