public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Geoffrey Keating <geoffk@apple.com>
To: gcc List <gcc@gcc.gnu.org>
Subject: attribute data structure rewrite
Date: Fri, 24 Sep 2004 00:15:00 -0000	[thread overview]
Message-ID: <FA388EC7-0DBB-11D9-8B78-000A95B1F520@apple.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4178 bytes --]

As a precondition for other compile speed improvements, I've been 
rewriting the way that GCC represents attributes.  The result is a 
medium-size patch that touches every language and many targets (a 
surprising number of targets don't define any special attributes at 
all).

The basic principle is that DECL_ATTRIBUTES and TREE_ATTRIBUTES now 
point to an attribute_list:

/* A structure representing 'attributes' on a DECL or TYPE node.
    Each attribute has a NAME (an IDENTIFIER_NODE) and possibly a VALUE. 
  */
struct one_attribute GTY(())
{
   tree name;
   tree value;
};

/* A counted list of attributes.  */
struct attribute_list_s GTY(())
{
   attribute_count n_attributes;
   /* There are 16 bits free here.  */
   struct one_attribute GTY((length ("%h.n_attributes"))) attribs[1];
};

This has many benefits, mostly flowing from the fact that it's not a 
TREE_LIST any more.

1. Do we think this would be acceptable for stage 3, or should I make a 
branch?
2. Would anyone be interested in helping me test it, especially on the 
more difficult architectures like alpha-vms or i386-netware?

diffstat on my current patch looks like:

  ada/gigi.h                 |    2
  ada/utils.c                |    2
  attribs.c                  |  347 
++++++++++++++++++++++++++-------------------
  builtin-attrs.def          |   62 +++-----
  c-common.c                 |  116 +++++++++------
  c-common.h                 |    4
  c-decl.c                   |   76 +++++----
  c-format.c                 |   25 +--
  c-objc-common.c            |    4
  c-parse.in                 |   98 ++++++------
  c-pragma.c                 |   10 -
  c-tree.h                   |   28 +--
  c-typeck.c                 |   12 -
  cgraphunit.c               |    2
  config/alpha/alpha.c       |    6
  config/arm/arm.c           |   37 ++--
  config/arm/pe.c            |   12 -
  config/avr/avr.c           |   14 -
  config/c4x/c4x.c           |    6
  config/frv/frv.c           |    2
  config/h8300/h8300.c       |   35 ----
  config/i386/i386.c         |   42 ++---
  config/i386/netware.c      |    8 -
  config/i386/winnt.c        |   22 +-
  config/ia64/ia64.c         |   10 -
  config/ip2k/ip2k.c         |    5
  config/m32r/m32r.c         |   10 -
  config/m68hc11/m68hc11.c   |   28 +--
  config/m68k/m68k.c         |    5
  config/mcore/mcore.c       |    6
  config/ns32k/ns32k.c       |    4
  config/rs6000/rs6000.c     |   22 +-
  config/sh/sh.c             |   10 -
  config/sh/symbian.c        |   28 +--
  config/sol2.c              |    8 -
  config/stormy16/stormy16.c |    6
  config/v850/v850.c         |   20 --
  coretypes.h                |    6
  cp/call.c                  |    2
  cp/class.c                 |    2
  cp/cp-tree.h               |   29 ++-
  cp/decl.c                  |   59 +++----
  cp/decl.h                  |    2
  cp/decl2.c                 |   14 -
  cp/friend.c                |    2
  cp/method.c                |    4
  cp/name-lookup.c           |   10 -
  cp/name-lookup.h           |    2
  cp/optimize.c              |    2
  cp/parser.c                |  176 ++++++++++++----------
  cp/pt.c                    |    2
  cp/tree.c                  |    4
  cp/typeck.c                |    8 -
  fold-const.c               |    4
  gengtype-lex.l             |    6
  integrate.c                |    9 -
  java/decl.c                |   46 ++---
  java/java-tree.h           |    2
  java/jcf-reader.c          |   12 -
  langhooks.c                |    4
  langhooks.h                |    2
  objc/objc-act.c            |   90 ++++++-----
  passes.c                   |    5
  print-tree.c               |   23 ++
  system.h                   |    2
  target-def.h               |    4
  target.h                   |   10 -
  targhooks.c                |   10 +
  targhooks.h                |    4
  tree-browser.c             |    9 -
  tree-inline.c              |    6
  tree.c                     |  307 
+++++++++++++++++++++++++--------------
  tree.h                     |   81 ++++++++--
  treelang/treetree.c        |    6
  varasm.c                   |    6
  75 files changed, 1171 insertions, 935 deletions

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2408 bytes --]

             reply	other threads:[~2004-09-23 23:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-24  0:15 Geoffrey Keating [this message]
2004-09-24  0:34 ` Andrew Pinski
2004-09-24  1:30   ` Joseph S. Myers
2004-09-24  1:47   ` Zack Weinberg
2004-09-24  6:52   ` Geoffrey Keating
2004-09-24  1:40 ` Gabriel Dos Reis
2004-09-24  2:34   ` Giovanni Bajo
2004-09-24  2:59     ` Gabriel Dos Reis
2004-09-24  4:17       ` Giovanni Bajo
2004-09-24  4:18         ` Gabriel Dos Reis
2004-09-24  8:40     ` Andreas Schwab
2004-09-24  8:40       ` Andreas Schwab
2004-09-24  9:17     ` Joseph S. Myers
2004-09-24 14:45       ` Giovanni Bajo
2004-09-24  8:36   ` Geoffrey Keating
2004-09-24 14:03     ` Joseph S. Myers
2004-09-24  2:35 ` Giovanni Bajo
2004-09-24  8:33   ` Geoffrey Keating
2004-09-24 12:24     ` Nathan Sidwell
2004-09-24 22:29 ` Mark Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FA388EC7-0DBB-11D9-8B78-000A95B1F520@apple.com \
    --to=geoffk@apple.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).