Cyndy Ishida 7189219ec9
[readtapi] Add support for stubify-ing directories (#76885)
When given a directory input `llvm-readtapi` traverses through the
directory to find dylibs or tbd files to operate on. TBD files will be
created with the same base file name as the dylib. Symlinks should be
created if the input is one.

This also introduces options to delete input files which are defined as
library files that existed before `readtapi -stubify` was invoked. Also
the ability to delete private libraries where private libraries are in a
predefined file system locations on darwin based platforms.
2024-02-03 09:33:42 -08:00

38 lines
1.8 KiB
TableGen

// Include the common option parsing interfaces.
include "llvm/Option/OptParser.td"
class FF<string name, string help>: Flag<["-", "--"], name>, HelpText<help>;
multiclass JS<string name, string help, string var = ""> {
def NAME #_EQ : Joined<["--"], name #"=">, HelpText<help>, MetaVarName<var>;
def : Separate<["-", "--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
}
//
// Top level operations
//
def action_group : OptionGroup<"action group">, HelpText<"COMMANDS">;
def compare : FF<"compare", "compare tapi files for library differences">, Group<action_group>;
def merge : FF<"merge", "merge the input files that represent the same library">, Group<action_group>;
def extract: FF<"extract", "extract <architecture> from input file">, Group<action_group>;
def remove: FF<"remove", "remove <architecture> from input file">, Group<action_group>;
def stubify: FF<"stubify", "create a tapi file from a dynamic library or framework">, Group<action_group>;
//
// General Driver options
//
def help : FF<"help", "display this help">;
def version: FF<"version", "print the llvm-readtapi version">;
def v: FF<"v", "alias for --version">, Alias<version>;
defm output: JS<"o", "write output to <file>","<file>">;
def compact: FF<"compact", "write compact tapi output file">;
defm filetype: JS<"filetype", "specify the output file type (tbd-v3, tbd-v4 or tbd-v5)","<value>">;
defm arch: JS<"arch", "specify the <architecture>", "<architecture>">;
//
// Stub options
//
def delete_input : FF<"delete-input", "delete and replace input file on success">;
def delete_private_libraries : FF<"delete-private-libraries", "delete private system dynamic libraries and frameworks">;
def t: FF<"t", "logs each library loaded, useful for debugging problems with search paths where the wrong library is loaded">;