[Internalize] Support glob patterns for API lists
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 22 Jul 2022 00:45:32 +0000 (20:45 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 22 Jul 2022 12:24:32 +0000 (08:24 -0400)
commit3d0ab8638ba4c29563a6bcc2379abbdbce34fd47
tree5b48054e70274620d73f02e0066085cd0ddb5ed2
parente82e07d74a7d9f262aa85fa4aebf99b5a62f386c
[Internalize] Support glob patterns for API lists

The internalize pass supports an option to provide a list of symbols
that should not be internalized. THis is useful retaining certain
defintions that should be kept alive. However, this interface is
somewhat difficult to use as it requires knowing every single symbol's
name and specifying it. Many APIs provide common prefixes for the
symbols exported by the library, so it would make sense to be able to
match these using a simple glob pattern. This patch changes the handling
from a simple string comparison to a glob pattern match.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D130319
llvm/lib/Transforms/IPO/Internalize.cpp
llvm/test/Transforms/Internalize/globs.ll [new file with mode: 0644]