Re: Help with TREE_PUBLIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ajay Kumar <nitk.ajay@xxxxxxxxx> writes:

>                    FOR_EACH_BB (bb)
>                   {
>                        for(gsi = gsi_start_bb (bb); !gsi_end_p(gsi);
> gsi_next(&gsi))
>                       {
>                                gimple stmt = gsi_stmt(gsi);
>                                if(is_gimple_assign(stmt))
>                                {
>
> if(TREE_PUBLIC(gimple_assign_lhs(stmt)) ||
> TREE_PUBLIC(gimple_assign_rhs1(stmt)))
>                                        {
>                                        tree temp;
>                                        if(TREE_PUBLIC(gimple_assign_lhs(stmt)))
>                                        temp = gimple_assign_lhs(stmt);
>                                        else
>                                        temp = gimple_assign_rhs1(stmt);
>
> printf("%s\n",IDENTIFIER_POINTER(DECL_NAME(temp)));
>                                        }
>                                }
>                        }
>                    }
>
> This is working fine for normal datatypes but failing for data structures.

You should make sure that you are looking at a VAR_DECL before
checking TREE_PUBLIC.  In particular, it's likely that some of the
gimple_assign_lhs values are actually COMPONENT_REF, so you aren't
looking at the right node.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux