]> granicus.if.org Git - llvm/commit
[support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places
authorJordan Rupprecht <rupprecht@google.com>
Wed, 16 Oct 2019 22:31:16 +0000 (22:31 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Wed, 16 Oct 2019 22:31:16 +0000 (22:31 +0000)
commit1b6d9ac9fa8e50387b28694d74d8ce149dd4c379
treebda53b2a9fb8b1d7a011872e76c1e98f0d0dd1ec
parentf5f2c97ffa8c6839c440f18f99e0c18e6179eb6f
[support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

Summary: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy.

This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon.

Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

Reviewed By: MaskRay

Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66613

undo objcopy changes to make this libsupport only

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375051 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/GlobPattern.h
lib/Support/GlobPattern.cpp
unittests/Support/GlobPatternTest.cpp