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: [Patch, Fortran] gfc_get_code cleanup


Le 06/08/2013 17:12, Janus Weil a écrit :
> Hi all,
> 
> attached is a cleanup patch which concerns the gfc_code structure and
> gfc_get_code function (in st.c). It basically does two things:
> 
> 1) It replaces the many occurrences of "XCNEW (gfc_code)" in class.c
> by "gfc_get_code ()", which internally sets the locus and saves us
> from doing it manually afterward.
> 
> 2) It adds an argument "op" to gfc_get_code to directly set the .op
> component of gfc_code. Every time we set up a new gfc_code structure,
> we certainly want to set its op.
> 
> 2b) There are a few instances where we do not set the op after calling
> gfc_get_code, but instead copy the whole structure from someplace
> else. For those cases I'm using "XCNEW (gfc_code)" now (which also
> avoids setting the locus twice).
> 
> 2c) In one place I'm using "gfc_get_code (EXEC_NOP)" for technical
> reasons, see 'new_level' in parse.c.
> 
> Both items (1) and (2) result in more compact code and save a few
> extra lines (see diffstat below). Regtested on
> x86_64-unknown-linux-gnu. Ok for trunk with a suitable ChangeLog?
> 
Yes, thanks

Mikael


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