This is an archive of the discontinued LLVM Phabricator instance.

[Internalize] Support glob patterns for API lists
ClosedPublic

Authored by jhuber6 on Jul 21 2022, 5:49 PM.

Details

Summary

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.

Diff Detail

Event Timeline

jhuber6 created this revision.Jul 21 2022, 5:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 5:49 PM
jhuber6 requested review of this revision.Jul 21 2022, 5:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 5:49 PM
MaskRay accepted this revision.Jul 21 2022, 7:23 PM
MaskRay added inline comments.
llvm/lib/Transforms/IPO/Internalize.cpp
53

Update comment

llvm/test/Transforms/Internalize/globs.ll
1

to avoid gotcha when a user runs the command in a shell.

You can drop <

This revision is now accepted and ready to land.Jul 21 2022, 7:23 PM
This revision was landed with ongoing or failed builds.Jul 22 2022, 5:24 AM
This revision was automatically updated to reflect the committed changes.