]> granicus.if.org Git - llvm/commit
[llvm-objcopy][NFC] Refactor symbol/section matching
authorJordan Rupprecht <rupprecht@google.com>
Thu, 22 Aug 2019 19:17:50 +0000 (19:17 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Thu, 22 Aug 2019 19:17:50 +0000 (19:17 +0000)
commitb795783d2720c02c0ca18df9d4c22aba7ef3ac49
tree7273991395ead8ca9b61ff8ae7e06feae1037194
parentc89a2e38905edc7ebc51e1dcf83436147ef70d12
[llvm-objcopy][NFC] Refactor symbol/section matching

Summary:
The matchers for section/symbol related flags (e.g. `--keep-symbol=Name` or `--regex --keep-symbol=foo.*`) are currently just vectors that are matched linearlly. However, adding wildcard support would require negative matching too, e.g. a symbol should be removed if it matches a wildcard *but* doesn't match some other wildcard.

To make the next patch simpler, consolidate matching logic to a class defined in CopyConfig that takes care of matching.

Reviewers: jhenderson, seiya, MaskRay, espindola, alexshap

Reviewed By: jhenderson, MaskRay

Subscribers: emaste, arichardson, jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369689 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-objcopy/COFF/COFFObjcopy.cpp
tools/llvm-objcopy/CopyConfig.cpp
tools/llvm-objcopy/CopyConfig.h
tools/llvm-objcopy/ELF/ELFObjcopy.cpp