This is the mail archive of the gcc-help@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: conditional LABEL_EXPR


On Tue, Oct 9, 2012 at 4:47 AM, Philip Herron <redbrain@gcc.gnu.org> wrote:
>
>   tree label_decl = create_artificial_label (UNKNOWN_LOCATION);

>
> I can't see a good example on how to make an if statement hard to dig
> through front-end specifics. I wonder does this mean for every
> LABEL_EXPR it was DECL_CONTEXT(label) = current_fndecl?

When you call create_artificial_label, it will set DECL_CONTEXT of the
new label to point to current_function_decl.  So the simplest way to
get the right thing is to ensure that current_function_decl is correct
whenever you call create_artificial_label.

Ian


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