VEC re-write [patch 05/25]
Diego Novillo
dnovillo@google.com
Sun Nov 18 15:09:00 GMT 2012
On Fri, Nov 16, 2012 at 6:29 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Thu, Nov 15, 2012 at 1:53 PM, Diego Novillo <dnovillo@google.com> wrote:
>> 2012-11-15 Diego Novillo <dnovillo@google.com>
>>
>> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
>>
>> * c-common.c: Use new vec API in vec.h.
>> * c-common.h: Likewise.
>> * c-gimplify.c: Likewise.
>> * c-pragma.c: Likewise.
>> * c-pretty-print.c: Likewise.
>> * c-pretty-print.h: Likewise.
>> * c-semantics.c: Likewise.
>> * c-decl.c: Likewise.
>> * c-parser.c: Likewise.
>> * c-tree.h: Likewise.
>> * c-typeck.c: Likewise.
>
>
>> {
>> gcc_assert (decl && DECL_P (decl) && TREE_STATIC (decl));
>>
>> - while (!VEC_empty (tree, types_used_by_cur_var_decl))
>> + while (types_used_by_cur_var_decl && !types_used_by_cur_var_decl->is_empty ())
>
> vec_safe_is_empty?
Strictly speaking, yes. But in this case, the call to ->is_empty() is
already protected by a non-NULL test for types_used_by_cur_var_decl.
So you can save yourself the duplicated test.
Diego.
More information about the Gcc-patches
mailing list