From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13162 invoked by alias); 22 Sep 2010 02:07:32 -0000 Received: (qmail 13152 invoked by uid 22791); 22 Sep 2010 02:07:31 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Sep 2010 02:07:24 +0000 Received: by qyk4 with SMTP id 4so129597qyk.20 for ; Tue, 21 Sep 2010 19:07:23 -0700 (PDT) Received: by 10.224.27.210 with SMTP id j18mr7509492qac.164.1285121242885; Tue, 21 Sep 2010 19:07:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.1.81 with HTTP; Tue, 21 Sep 2010 19:07:02 -0700 (PDT) In-Reply-To: <20100921210829.5f2ea8b0.basile@starynkevitch.net> References: <20100921210301.d92889be.basile@starynkevitch.net> <20100921210829.5f2ea8b0.basile@starynkevitch.net> From: Laurynas Biveinis Date: Wed, 22 Sep 2010 11:11:00 -0000 Message-ID: Subject: Re: gengtype improvements for plugins, thirdround! patch 2/7 [verbosity] To: Basile Starynkevitch Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-09/txt/msg01769.txt.bz2 2010/9/21 Basile Starynkevitch : > In addition of verbose messages, we added a tiny but useful feature to > gengtype. When given a backup directory thru the -B program option and > when it is generating a file gt-foo.h, gengtype renames the old > version into the backup directory so that the user could compare the > old version with the current one. =C2=A0Verbosity & backing up of old fil= es > go together (in verbose mode, the renaming is told to the > user). Backing up is no longer by default. =C2=A0Per Laurynas' wish, it > should be enabled by its program option. Although I agree that if backups go in, they should have their own switch, my wish was to remove the backup feature altogether. Merits of backups aside, since now backup is independent from verbosity, it should be submitted in a separate patch. @@ -1511,8 +1520,15 @@ static void set_gc_used (pair_p variables) { pair_p p; + int nbvars =3D 0; for (p =3D variables; p; p =3D p->next) + { + DBGPRINTF ("set_gc_used p %p '%s' nbvars %d", (void*) p, p->name, nbvars); set_gc_used_type (p->type, GC_USED, NULL); Indentation is wrong. + if (!is_file_equal (of)) + { Indentation is wrong. @@ -2894,11 +2941,26 @@ write_types (outf_p output_header, type_ { type_p ss; for (ss =3D s->u.s.lang_struct; ss; ss =3D ss->next) + { + nbfun++; + DBGPRINTF ("writing func #%d lang_struct ss @ %p '%s'", + nbfun, (void*) ss, ss->u.s.tag); write_func_for_structure (s, ss, NULL, wtd); } + } else + { + nbfun++; + DBGPRINTF ("writing func #%d struct s @ %p '%s'", + nbfun, (void*) s, s->u.s.tag); write_func_for_structure (s, s, NULL, wtd); } + } Indentation is wrong. + DBGPRINTF ("write_enum_defn s %p #%d is unionorstruct tagged %s", union or struct. Also indentation is wrong in the code surrounding this lin= e. > 2010-09-20 =C2=A0Jeremie Salvucci =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Basile Starynkevitch =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0* gengtype.c (verbosity_level, backup_dir): Ad= ded variables. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(set_gc_used): Count variables for verbosity. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(close_output_files): Backing up files, counti= ng written ones > =C2=A0 =C2=A0 =C2=A0 =C2=A0verbosily. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(write_types): Count emitted functions for ver= bosity. Added > =C2=A0 =C2=A0 =C2=A0 =C2=A0debug messages. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(write_enum_defn): Count structures for verbos= ity. Added debug > =C2=A0 =C2=A0 =C2=A0 =C2=A0messages. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(gengtype_long_options): Added "verbose". > =C2=A0 =C2=A0 =C2=A0 =C2=A0(print_usage): Ditto. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(main): Verbose display of parsed files. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0* gengtype.h (verbosity_level): Added declarat= ion. --=20 Laurynas