[PATCH] D66613: [support][llvm-objcopy] Add support for shell wildcards

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 12:22:53 PDT 2019


rupprecht created this revision.
rupprecht added reviewers: jhenderson, MaskRay, evgeny777.
Herald added subscribers: llvm-commits, seiya, abrachet, jakehehrlich, hiraditya, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.

GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags).

The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag.

Instead of writing a new regex class, add a helper to llvm's Regex that translates a wildcard syntax into a general regular expression.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66613

Files:
  llvm/docs/CommandGuide/llvm-objcopy.rst
  llvm/docs/CommandGuide/llvm-strip.rst
  llvm/include/llvm/Support/Regex.h
  llvm/lib/Support/Regex.cpp
  llvm/test/tools/llvm-objcopy/ELF/wildcard-flags.test
  llvm/test/tools/llvm-objcopy/ELF/wildcard-syntax.test
  llvm/tools/llvm-objcopy/CommonOpts.td
  llvm/tools/llvm-objcopy/CopyConfig.cpp
  llvm/tools/llvm-objcopy/CopyConfig.h
  llvm/unittests/Support/RegexTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66613.216686.patch
Type: text/x-patch
Size: 30789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190822/45efd653/attachment.bin>


More information about the llvm-commits mailing list