public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Michael Matz <matz@suse.de>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] Special case more simple patterns
Date: Mon, 28 Nov 2022 12:42:39 +1030	[thread overview]
Message-ID: <Y4QZF+zskHzcVwrQ@squeak.grove.modra.org> (raw)
In-Reply-To: <alpine.LSU.2.20.2211251600280.24878@wotan.suse.de>

On Fri, Nov 25, 2022 at 04:01:58PM +0000, Michael Matz via Binutils wrote:
> fnmatch is slow, so avoiding it in more cases is good.  This implements
> a more generic version of match_simple_wild which needs some
> pre-processing of patterns.  In particular it supports patterns of the
> form PREFIX*SUFFIX (where all parts are optional), i.e. a super set of
> what's handled now.  Most section matchers of this form and hence don't
> need any calls to fnmatch anymore.
> 
> We retain the implementation of match_simple_wild for the filename
> matchers (they aren't called often enough to matter).
> ---
> This is independendly useful, but will be used in the next-to-be-posted 
> series about section-select.

OK, but please do put the comment for rstrcspn from your later patch
in with this one, and don't commit the following two hunks.

> @@ -645,6 +672,7 @@ walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
>      {
>        const char *sname = bfd_section_name (s);
>        bool skip = !match_simple_wild (wildsec0->spec.name, sname);
> +      //bool skip = !!spec_match (&wildsec0->spec, sname);
>  
>        if (!skip)
>  	walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
> @@ -682,6 +710,7 @@ walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
>  	{
>  	  const char *sname = bfd_section_name (s);
>  	  bool skip = !match_simple_wild (wildsec1->spec.name, sname);
> +	  //bool skip = !!spec_match (&wildsec1->spec, sname);
>  
>  	  if (!skip)
>  	    walk_wild_consider_section (ptr, file, s, wildsec1, callback,

-- 
Alan Modra
Australia Development Lab, IBM

      reply	other threads:[~2022-11-28  2:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 16:01 Michael Matz
2022-11-28  2:12 ` Alan Modra [this message]

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=Y4QZF+zskHzcVwrQ@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=matz@suse.de \
    /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).