include "llvm/Option/OptParser.td" // Convenience classes for long options which only accept two dashes. For lld // specific or newer long options, we prefer two dashes to avoid collision with // short options. For many others, we have to accept both forms to be compatible // with GNU ld. class FF : Flag<["--"], name>; class JJ: Joined<["--"], name>; multiclass EEq { def NAME: Separate<["--"], name>; def NAME # _eq: Joined<["--"], name # "=">, Alias(NAME)>, HelpText; } multiclass BB { def NAME: Flag<["--"], name>, HelpText; def no_ # NAME: Flag<["--"], "no-" # name>, HelpText; } // For options whose names are multiple letters, either one dash or // two can precede the option name except those that start with 'o'. class F: Flag<["--", "-"], name>; class J: Joined<["--", "-"], name>; class S: Separate<["--", "-"], name>; multiclass Eq { def NAME: Separate<["--", "-"], name>; def NAME # _eq: Joined<["--", "-"], name # "=">, Alias(NAME)>, HelpText; } multiclass B { def NAME: Flag<["--", "-"], name>, HelpText; def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText; } // The following flags are shared with the ELF linker def Bsymbolic: F<"Bsymbolic">, HelpText<"Bind defined symbols locally">; def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries (default)">; def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">; defm color_diagnostics: B<"color-diagnostics", "Alias for --color-diagnostics=always", "Alias for --color-diagnostics=never">; def color_diagnostics_eq: J<"color-diagnostics=">, HelpText<"Use colors in diagnostics (default: auto)">, MetaVarName<"[auto,always,never]">; def compress_relocations: F<"compress-relocations">, HelpText<"Compress the relocation targets in the code section.">; defm demangle: B<"demangle", "Demangle symbol names", "Do not demangle symbol names">; def emit_relocs: F<"emit-relocs">, HelpText<"Generate relocations in output">; def error_unresolved_symbols: F<"error-unresolved-symbols">, HelpText<"Report unresolved symbols as errors">; defm export_dynamic: B<"export-dynamic", "Put symbols in the dynamic symbol table", "Do not put symbols in the dynamic symbol table (default)">; def entry: S<"entry">, MetaVarName<"">, HelpText<"Name of entry point symbol">; defm error_limit: EEq<"error-limit", "Maximum number of errors to emit before stopping (0 = no limit)">; def fatal_warnings: F<"fatal-warnings">, HelpText<"Treat warnings as errors">; defm gc_sections: B<"gc-sections", "Enable garbage collection of unused sections", "Disable garbage collection of unused sections">; defm merge_data_segments: BB<"merge-data-segments", "Enable merging data segments", "Disable merging data segments">; def help: F<"help">, HelpText<"Print option help">; def library: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, HelpText<"Root name of library to use">; def library_path: JoinedOrSeparate<["-"], "L">, MetaVarName<"">, HelpText<"Add a directory to the library search path">; def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; defm mllvm: Eq<"mllvm", "Additional arguments to forward to LLVM's option processing">; defm Map: Eq<"Map", "Print a link map to the specified file">; def no_fatal_warnings: F<"no-fatal-warnings">; def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"">, HelpText<"Path to file to write output">; def O: JoinedOrSeparate<["-"], "O">, HelpText<"Optimize output file size">; defm pie: B<"pie", "Create a position independent executable", "Do not create a position independent executable (default)">; defm print_gc_sections: B<"print-gc-sections", "List removed unused sections", "Do not list removed unused sections">; def print_map: F<"print-map">, HelpText<"Print a link map to the standard output">; def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">; defm reproduce: EEq<"reproduce", "Dump linker invocation and input files for debugging">; defm rsp_quoting: Eq<"rsp-quoting", "Quoting style for response files">, MetaVarName<"[posix,windows]">; def shared: F<"shared">, HelpText<"Build a shared object">; def strip_all: F<"strip-all">, HelpText<"Strip all symbols">; def strip_debug: F<"strip-debug">, HelpText<"Strip debugging information">; defm threads : Eq<"threads", "Number of threads. '1' disables multi-threading. By " "default all available hardware threads are used">; def trace: F<"trace">, HelpText<"Print the names of the input files">; defm trace_symbol: Eq<"trace-symbol", "Trace references to symbols">; defm undefined: Eq<"undefined", "Force undefined symbol during linking">; defm unresolved_symbols: Eq<"unresolved-symbols", "Determine how to handle unresolved symbols">; def v: Flag<["-"], "v">, HelpText<"Display the version number">; def verbose: F<"verbose">, HelpText<"Verbose mode">; def version: F<"version">, HelpText<"Display the version number and exit">; def warn_unresolved_symbols: F<"warn-unresolved-symbols">, HelpText<"Report unresolved symbols as warnings">; defm wrap: Eq<"wrap", "Use wrapper functions for symbol">, MetaVarName<"=">; def z: JoinedOrSeparate<["-"], "z">, MetaVarName<"