From: Michael J. Spencer Date: Mon, 22 Oct 2012 22:13:48 +0000 (+0000) Subject: [Options] Add prefixes to options. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c635710bcbb9598acd5a14647ba7ca28bee89a68;p=clang [Options] Add prefixes to options. Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166444 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Arg.h b/include/clang/Driver/Arg.h index bd4fa872ea..6be80d32c6 100644 --- a/include/clang/Driver/Arg.h +++ b/include/clang/Driver/Arg.h @@ -45,6 +45,9 @@ namespace driver { /// argument translation), if any. const Arg *BaseArg; + /// \brief How this instance of the option was spelled. + StringRef Spelling; + /// \brief The index at which this argument appears in the containing /// ArgList. unsigned Index; @@ -61,14 +64,16 @@ namespace driver { SmallVector Values; public: - Arg(const Option Opt, unsigned Index, const Arg *BaseArg = 0); - Arg(const Option Opt, unsigned Index, + Arg(const Option Opt, StringRef Spelling, unsigned Index, + const Arg *BaseArg = 0); + Arg(const Option Opt, StringRef Spelling, unsigned Index, const char *Value0, const Arg *BaseArg = 0); - Arg(const Option Opt, unsigned Index, + Arg(const Option Opt, StringRef Spelling, unsigned Index, const char *Value0, const char *Value1, const Arg *BaseArg = 0); ~Arg(); const Option getOption() const { return Opt; } + StringRef getSpelling() const { return Spelling; } unsigned getIndex() const { return Index; } /// \brief Return the base argument which generated this arg. diff --git a/include/clang/Driver/CC1AsOptions.h b/include/clang/Driver/CC1AsOptions.h index 05082132ce..420a10138c 100644 --- a/include/clang/Driver/CC1AsOptions.h +++ b/include/clang/Driver/CC1AsOptions.h @@ -17,11 +17,13 @@ namespace driver { namespace cc1asoptions { enum ID { OPT_INVALID = 0, // This is not an option ID. -#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ +#define PREFIX(NAME, VALUE) +#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ HELPTEXT, METAVAR) OPT_##ID, #include "clang/Driver/CC1AsOptions.inc" LastOption #undef OPTION +#undef PREFIX }; } diff --git a/include/clang/Driver/CC1AsOptions.td b/include/clang/Driver/CC1AsOptions.td index 37ba6027e2..858deb14a7 100644 --- a/include/clang/Driver/CC1AsOptions.td +++ b/include/clang/Driver/CC1AsOptions.td @@ -18,22 +18,22 @@ include "OptParser.td" // Target Options //===----------------------------------------------------------------------===// -def triple : Separate<"-triple">, +def triple : Separate<["-"], "triple">, HelpText<"Specify target triple (e.g. x86_64-pc-linux-gnu)">; -def target_cpu : Separate<"-target-cpu">, +def target_cpu : Separate<["-"], "target-cpu">, HelpText<"Target a specific cpu type">; -def target_feature : Separate<"-target-feature">, +def target_feature : Separate<["-"], "target-feature">, HelpText<"Target specific attributes">; //===----------------------------------------------------------------------===// // Language Options //===----------------------------------------------------------------------===// -def I : JoinedOrSeparate<"-I">, MetaVarName<"">, +def I : JoinedOrSeparate<["-"], "I">, MetaVarName<"">, HelpText<"Add directory to include search path">; -def n : Flag<"-n">, +def n : Flag<["-"], "n">, HelpText<"Don't automatically start assembly file with a text section">; -def L : Flag<"-L">, +def L : Flag<["-"], "L">, HelpText<"Save temporary labels in the symbol table. " "Note this may change .s semantics, it should almost never be used " "on compiler generated code!">; @@ -42,50 +42,49 @@ def L : Flag<"-L">, // Frontend Options //===----------------------------------------------------------------------===// -def o : Separate<"-o">, MetaVarName<"">, HelpText<"Specify output file">; +def o : Separate<["-"], "o">, MetaVarName<"">, + HelpText<"Specify output file">; -def filetype : Separate<"-filetype">, +def filetype : Separate<["-"], "filetype">, HelpText<"Specify the output file type ('asm', 'null', or 'obj')">; -def help : Flag<"-help">, +def help : Flag<["-", "--"], "-help">, HelpText<"Print this help text">; -def _help : Flag<"--help">, Alias; -def version : Flag<"-version">, +def version : Flag<["-", "--"], "version">, HelpText<"Print the assembler version">; -def _version : Flag<"--version">, Alias; -def v : Flag<"-v">, Alias; +def v : Flag<["-"], "v">, Alias; // Generic forwarding to LLVM options. This should only be used for debugging // and experimental features. -def mllvm : Separate<"-mllvm">, +def mllvm : Separate<["-"], "mllvm">, HelpText<"Additional arguments to forward to LLVM's option processing">; //===----------------------------------------------------------------------===// // Transliterate Options //===----------------------------------------------------------------------===// -def output_asm_variant : Separate<"-output-asm-variant">, +def output_asm_variant : Separate<["-"], "output-asm-variant">, HelpText<"Select the asm variant index to use for output">; -def show_encoding : Flag<"-show-encoding">, +def show_encoding : Flag<["-"], "show-encoding">, HelpText<"Show instruction encoding information in transliterate mode">; -def show_inst : Flag<"-show-inst">, +def show_inst : Flag<["-"], "show-inst">, HelpText<"Show internal instruction representation in transliterate mode">; //===----------------------------------------------------------------------===// // Assemble Options //===----------------------------------------------------------------------===// -def relax_all : Flag<"-relax-all">, +def relax_all : Flag<["-"], "relax-all">, HelpText<"Relax all fixups (for performance testing)">; -def no_exec_stack : Flag<"--noexecstack">, +def no_exec_stack : Flag<["-"], "-noexecstack">, HelpText<"Mark the file as not needing an executable stack">; -def fatal_warnings : Flag<"--fatal-warnings">, +def fatal_warnings : Flag<["--"], "fatal-warnings">, HelpText<"Consider warnings as errors">; -def g : Flag<"-g">, HelpText<"Generate source level debug information">; +def g : Flag<["-"], "g">, HelpText<"Generate source level debug information">; -def dwarf_debug_flags : Separate<"-dwarf-debug-flags">, +def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">, HelpText<"The string to embed in the Dwarf debug flags record.">; diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 32b7a5e6f4..e260beab81 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -17,232 +17,234 @@ let Flags = [CC1Option] in { // Target Options //===----------------------------------------------------------------------===// -def cxx_abi : Separate<"-cxx-abi">, +def cxx_abi : Separate<["-"], "cxx-abi">, HelpText<"Target a particular C++ ABI type">; -def target_abi : Separate<"-target-abi">, +def target_abi : Separate<["-"], "target-abi">, HelpText<"Target a particular ABI type">; -def target_cpu : Separate<"-target-cpu">, +def target_cpu : Separate<["-"], "target-cpu">, HelpText<"Target a specific cpu type">; -def target_feature : Separate<"-target-feature">, +def target_feature : Separate<["-"], "target-feature">, HelpText<"Target specific attributes">; -def target_linker_version : Separate<"-target-linker-version">, +def target_linker_version : Separate<["-"], "target-linker-version">, HelpText<"Target linker version">; -def triple : Separate<"-triple">, +def triple : Separate<["-"], "triple">, HelpText<"Specify target triple (e.g. i686-apple-darwin9)">; -def triple_EQ : Joined<"-triple=">, Alias; +def triple_EQ : Joined<["-"], "triple=">, Alias; //===----------------------------------------------------------------------===// // Analyzer Options //===----------------------------------------------------------------------===// -def analysis_UnoptimizedCFG : Flag<"-unoptimized-cfg">, +def analysis_UnoptimizedCFG : Flag<["-"], "unoptimized-cfg">, HelpText<"Generate unoptimized CFGs for all analyses">; +def analysis_CFGAddImplicitDtors : Flag<["-"], "cfg-add-implicit-dtors">, + HelpText<"Add C++ implicit destructors to CFGs for all analyses">; -def analyzer_store : Separate<"-analyzer-store">, +def analyzer_store : Separate<["-"], "analyzer-store">, HelpText<"Source Code Analysis - Abstract Memory Store Models">; -def analyzer_store_EQ : Joined<"-analyzer-store=">, Alias; +def analyzer_store_EQ : Joined<["-"], "analyzer-store=">, Alias; -def analyzer_constraints : Separate<"-analyzer-constraints">, +def analyzer_constraints : Separate<["-"], "analyzer-constraints">, HelpText<"Source Code Analysis - Symbolic Constraint Engines">; -def analyzer_constraints_EQ : Joined<"-analyzer-constraints=">, +def analyzer_constraints_EQ : Joined<["-"], "analyzer-constraints=">, Alias; -def analyzer_output : Separate<"-analyzer-output">, +def analyzer_output : Separate<["-"], "analyzer-output">, HelpText<"Source Code Analysis - Output Options">; -def analyzer_output_EQ : Joined<"-analyzer-output=">, +def analyzer_output_EQ : Joined<["-"], "analyzer-output=">, Alias; -def analyzer_purge : Separate<"-analyzer-purge">, +def analyzer_purge : Separate<["-"], "analyzer-purge">, HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">; -def analyzer_purge_EQ : Joined<"-analyzer-purge=">, Alias; +def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias; -def analyzer_opt_analyze_headers : Flag<"-analyzer-opt-analyze-headers">, +def analyzer_opt_analyze_headers : Flag<["-"], "analyzer-opt-analyze-headers">, HelpText<"Force the static analyzer to analyze functions defined in header files">; -def analyzer_opt_analyze_nested_blocks : Flag<"-analyzer-opt-analyze-nested-blocks">, +def analyzer_opt_analyze_nested_blocks : Flag<["-"], "analyzer-opt-analyze-nested-blocks">, HelpText<"Analyze the definitions of blocks in addition to functions">; -def analyzer_display_progress : Flag<"-analyzer-display-progress">, +def analyzer_display_progress : Flag<["-"], "analyzer-display-progress">, HelpText<"Emit verbose output about the analyzer's progress">; -def analyze_function : Separate<"-analyze-function">, +def analyze_function : Separate<["-"], "analyze-function">, HelpText<"Run analysis on specific function">; -def analyze_function_EQ : Joined<"-analyze-function=">, Alias; -def analyzer_eagerly_assume : Flag<"-analyzer-eagerly-assume">, +def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias; +def analyzer_eagerly_assume : Flag<["-"], "analyzer-eagerly-assume">, HelpText<"Eagerly assume the truth/falseness of some symbolic constraints">; -def analyzer_no_eagerly_trim_egraph : Flag<"-analyzer-no-eagerly-trim-egraph">, +def analyzer_no_eagerly_trim_egraph : Flag<["-"], "analyzer-no-eagerly-trim-egraph">, HelpText<"Don't eagerly remove uninteresting ExplodedNodes from the ExplodedGraph">; -def trim_egraph : Flag<"-trim-egraph">, +def trim_egraph : Flag<["-"], "trim-egraph">, HelpText<"Only show error-related paths in the analysis graph">; -def analyzer_viz_egraph_graphviz : Flag<"-analyzer-viz-egraph-graphviz">, +def analyzer_viz_egraph_graphviz : Flag<["-"], "analyzer-viz-egraph-graphviz">, HelpText<"Display exploded graph using GraphViz">; -def analyzer_viz_egraph_ubigraph : Flag<"-analyzer-viz-egraph-ubigraph">, +def analyzer_viz_egraph_ubigraph : Flag<["-"], "analyzer-viz-egraph-ubigraph">, HelpText<"Display exploded graph using Ubigraph">; -def analyzer_inline_max_stack_depth : Separate<"-analyzer-inline-max-stack-depth">, +def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack-depth">, HelpText<"Bound on stack depth while inlining (4 by default)">; -def analyzer_inline_max_stack_depth_EQ : Joined<"-analyzer-inline-max-stack-depth=">, +def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">, Alias; -def analyzer_inline_max_function_size : Separate<"-analyzer-inline-max-function-size">, +def analyzer_inline_max_function_size : Separate<["-"], "analyzer-inline-max-function-size">, HelpText<"Bound on the number of basic blocks in an inlined function (200 by default)">; -def analyzer_inline_max_function_size_EQ : Joined<"-analyzer-inline-max-function-size=">, +def analyzer_inline_max_function_size_EQ : Joined<["-"], "analyzer-inline-max-function-size=">, Alias; -def analyzer_ipa : Separate<"-analyzer-ipa">, +def analyzer_ipa : Separate<["-"], "analyzer-ipa">, HelpText<"Specify the inter-procedural analysis mode">; -def analyzer_ipa_EQ : Joined<"-analyzer-ipa=">, Alias; +def analyzer_ipa_EQ : Joined<["-"], "analyzer-ipa=">, Alias; -def analyzer_inlining_mode : Separate<"-analyzer-inlining-mode">, +def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">, HelpText<"Specify the function selection heuristic used during inlining">; -def analyzer_inlining_mode_EQ : Joined<"-analyzer-inlining-mode=">, Alias; +def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias; -def analyzer_disable_retry_exhausted : Flag<"-analyzer-disable-retry-exhausted">, +def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">, HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">; -def analyzer_max_nodes : Separate<"-analyzer-max-nodes">, +def analyzer_max_nodes : Separate<["-"], "analyzer-max-nodes">, HelpText<"The maximum number of nodes the analyzer can generate (150000 default, 0 = no limit)">; -def analyzer_max_loop : Separate<"-analyzer-max-loop">, +def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">, HelpText<"The maximum number of times the analyzer will go through a loop">; -def analyzer_stats : Flag<"-analyzer-stats">, +def analyzer_stats : Flag<["-"], "analyzer-stats">, HelpText<"Print internal analyzer statistics.">; -def analyzer_checker : Separate<"-analyzer-checker">, +def analyzer_checker : Separate<["-"], "analyzer-checker">, HelpText<"Choose analyzer checkers to enable">; -def analyzer_checker_EQ : Joined<"-analyzer-checker=">, +def analyzer_checker_EQ : Joined<["-"], "analyzer-checker=">, Alias; -def analyzer_disable_checker : Separate<"-analyzer-disable-checker">, +def analyzer_disable_checker : Separate<["-"], "analyzer-disable-checker">, HelpText<"Choose analyzer checkers to disable">; -def analyzer_disable_checker_EQ : Joined<"-analyzer-disable-checker=">, +def analyzer_disable_checker_EQ : Joined<["-"], "analyzer-disable-checker=">, Alias; -def analyzer_checker_help : Flag<"-analyzer-checker-help">, +def analyzer_checker_help : Flag<["-"], "analyzer-checker-help">, HelpText<"Display the list of analyzer checkers that are available">; -def analyzer_config : Separate<"-analyzer-config">, +def analyzer_config : Separate<["-"], "analyzer-config">, HelpText<"Choose analyzer options to enable">; //===----------------------------------------------------------------------===// // Migrator Options //===----------------------------------------------------------------------===// -def migrator_no_nsalloc_error : Flag<"-no-ns-alloc-error">, +def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">, HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">; -def migrator_no_finalize_removal : Flag<"-no-finalize-removal">, +def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">, HelpText<"Do not remove finalize method in gc mode">; //===----------------------------------------------------------------------===// // CodeGen Options //===----------------------------------------------------------------------===// -def disable_llvm_optzns : Flag<"-disable-llvm-optzns">, +def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">, HelpText<"Don't run LLVM optimization passes">; -def disable_llvm_verifier : Flag<"-disable-llvm-verifier">, +def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">, HelpText<"Don't run the LLVM IR verifier pass">; -def disable_red_zone : Flag<"-disable-red-zone">, +def disable_red_zone : Flag<["-"], "disable-red-zone">, HelpText<"Do not emit code that uses the red zone.">; -def fdebug_compilation_dir : Separate<"-fdebug-compilation-dir">, +def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">, HelpText<"The compilation directory to embed in the debug info.">; -def dwarf_debug_flags : Separate<"-dwarf-debug-flags">, +def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">, HelpText<"The string to embed in the Dwarf debug flags record.">; -def dwarf_column_info : Flag<"-dwarf-column-info">, +def dwarf_column_info : Flag<["-"], "dwarf-column-info">, HelpText<"Turn on column location information.">; -def fforbid_guard_variables : Flag<"-fforbid-guard-variables">, +def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">, HelpText<"Emit an error if a C++ static local initializer would need a guard variable">; -def no_implicit_float : Flag<"-no-implicit-float">, +def no_implicit_float : Flag<["-"], "no-implicit-float">, HelpText<"Don't generate implicit floating point instructions">; -def fdump_vtable_layouts : Flag<"-fdump-vtable-layouts">, +def fdump_vtable_layouts : Flag<["-"], "fdump-vtable-layouts">, HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">; -def femit_coverage_notes : Flag<"-femit-coverage-notes">, +def femit_coverage_notes : Flag<["-"], "femit-coverage-notes">, HelpText<"Emit a gcov coverage notes file when compiling.">; -def femit_coverage_data: Flag<"-femit-coverage-data">, +def femit_coverage_data: Flag<["-"], "femit-coverage-data">, HelpText<"Instrument the program to emit gcov coverage data when run.">; -def coverage_file : Separate<"-coverage-file">, +def coverage_file : Separate<["-"], "coverage-file">, HelpText<"Emit coverage data to this filename. The extension will be replaced.">; -def coverage_file_EQ : Joined<"-coverage-file=">, Alias; -def fuse_register_sized_bitfield_access: Flag<"-fuse-register-sized-bitfield-access">, +def coverage_file_EQ : Joined<["-"], "coverage-file=">, Alias; +def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">, HelpText<"Use register sized accesses to bit-fields, when possible.">; -def relaxed_aliasing : Flag<"-relaxed-aliasing">, +def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">, HelpText<"Turn off Type Based Alias Analysis">; -def masm_verbose : Flag<"-masm-verbose">, +def masm_verbose : Flag<["-"], "masm-verbose">, HelpText<"Generate verbose assembly output">; -def mcode_model : Separate<"-mcode-model">, +def mcode_model : Separate<["-"], "mcode-model">, HelpText<"The code model to use">; -def mdebug_pass : Separate<"-mdebug-pass">, +def mdebug_pass : Separate<["-"], "mdebug-pass">, HelpText<"Enable additional debug output">; -def mdisable_fp_elim : Flag<"-mdisable-fp-elim">, +def mdisable_fp_elim : Flag<["-"], "mdisable-fp-elim">, HelpText<"Disable frame pointer elimination optimization">; -def mdisable_tail_calls : Flag<"-mdisable-tail-calls">, +def mdisable_tail_calls : Flag<["-"], "mdisable-tail-calls">, HelpText<"Disable tail call optimization, keeping the call stack accurate">; -def menable_no_infinities : Flag<"-menable-no-infs">, +def menable_no_infinities : Flag<["-"], "menable-no-infs">, HelpText<"Allow optimization to assume there are no infinities.">; -def menable_no_nans : Flag<"-menable-no-nans">, +def menable_no_nans : Flag<["-"], "menable-no-nans">, HelpText<"Allow optimization to assume there are no NaNs.">; -def menable_unsafe_fp_math : Flag<"-menable-unsafe-fp-math">, +def menable_unsafe_fp_math : Flag<["-"], "menable-unsafe-fp-math">, HelpText<"Allow unsafe floating-point math optimizations which may decrease " "precision">; -def mfloat_abi : Separate<"-mfloat-abi">, +def mfloat_abi : Separate<["-"], "mfloat-abi">, HelpText<"The float ABI to use">; -def mlimit_float_precision : Separate<"-mlimit-float-precision">, +def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">, HelpText<"Limit float precision to the given value">; -def mno_exec_stack : Flag<"-mnoexecstack">, +def mno_exec_stack : Flag<["-"], "mnoexecstack">, HelpText<"Mark the file as not needing an executable stack">; -def mno_zero_initialized_in_bss : Flag<"-mno-zero-initialized-in-bss">, +def mno_zero_initialized_in_bss : Flag<["-"], "mno-zero-initialized-in-bss">, HelpText<"Do not put zero initialized data in the BSS">; -def backend_option : Separate<"-backend-option">, +def backend_option : Separate<["-"], "backend-option">, HelpText<"Additional arguments to forward to LLVM backend (during code gen)">; -def mregparm : Separate<"-mregparm">, +def mregparm : Separate<["-"], "mregparm">, HelpText<"Limit the number of registers available for integer arguments">; -def msave_temp_labels : Flag<"-msave-temp-labels">, +def msave_temp_labels : Flag<["-"], "msave-temp-labels">, HelpText<"(integrated-as) Save temporary labels">; -def mrelocation_model : Separate<"-mrelocation-model">, +def mrelocation_model : Separate<["-"], "mrelocation-model">, HelpText<"The relocation model to use">; -def munwind_tables : Flag<"-munwind-tables">, +def munwind_tables : Flag<["-"], "munwind-tables">, HelpText<"Generate unwinding tables for all functions">; -def fuse_init_array : Flag<"-fuse-init-array">, +def fuse_init_array : Flag<["-"], "fuse-init-array">, HelpText<"Use .init_array instead of .ctors">; -def mconstructor_aliases : Flag<"-mconstructor-aliases">, +def mconstructor_aliases : Flag<["-"], "mconstructor-aliases">, HelpText<"Emit complete constructors and destructors as aliases when possible">; -def mlink_bitcode_file : Separate<"-mlink-bitcode-file">, +def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">, HelpText<"Link the given bitcode file before performing optimizations.">; //===----------------------------------------------------------------------===// // Dependency Output Options //===----------------------------------------------------------------------===// -def sys_header_deps : Flag<"-sys-header-deps">, +def sys_header_deps : Flag<["-"], "sys-header-deps">, HelpText<"Include system headers in dependency output">; -def header_include_file : Separate<"-header-include-file">, +def header_include_file : Separate<["-"], "header-include-file">, HelpText<"Filename (or -) to write header include output to">; //===----------------------------------------------------------------------===// // Diagnostic Options //===----------------------------------------------------------------------===// -def dump_build_information : Separate<"-dump-build-information">, +def dump_build_information : Separate<["-"], "dump-build-information">, MetaVarName<"">, HelpText<"output a dump of some build information to a file">; -def diagnostic_log_file : Separate<"-diagnostic-log-file">, +def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">, HelpText<"Filename (or -) to log diagnostics to">; -def diagnostic_serialized_file : Separate<"-serialize-diagnostic-file">, +def diagnostic_serialized_file : Separate<["-"], "serialize-diagnostic-file">, MetaVarName<"">, HelpText<"File for serializing diagnostics in a binary format">; -def fdiagnostics_format : Separate<"-fdiagnostics-format">, +def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">, HelpText<"Change diagnostic formatting to match IDE and command line tools">; -def fdiagnostics_show_category : Separate<"-fdiagnostics-show-category">, +def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">, HelpText<"Print diagnostic category">; -def ftabstop : Separate<"-ftabstop">, MetaVarName<"">, +def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"">, HelpText<"Set the tab stop distance.">; -def ferror_limit : Separate<"-ferror-limit">, MetaVarName<"">, +def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"">, HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">; -def fmacro_backtrace_limit : Separate<"-fmacro-backtrace-limit">, MetaVarName<"">, +def fmacro_backtrace_limit : Separate<["-"], "fmacro-backtrace-limit">, MetaVarName<"">, HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit).">; -def ftemplate_backtrace_limit : Separate<"-ftemplate-backtrace-limit">, MetaVarName<"">, +def ftemplate_backtrace_limit : Separate<["-"], "ftemplate-backtrace-limit">, MetaVarName<"">, HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit).">; -def fconstexpr_backtrace_limit : Separate<"-fconstexpr-backtrace-limit">, MetaVarName<"">, +def fconstexpr_backtrace_limit : Separate<["-"], "fconstexpr-backtrace-limit">, MetaVarName<"">, HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">; -def fmessage_length : Separate<"-fmessage-length">, MetaVarName<"">, +def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"">, HelpText<"Format message diagnostics so that they fit within N columns or fewer, when possible.">; -def Wno_rewrite_macros : Flag<"-Wno-rewrite-macros">, +def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">, HelpText<"Silence ObjC rewriting warnings">; //===----------------------------------------------------------------------===// @@ -251,43 +253,43 @@ def Wno_rewrite_macros : Flag<"-Wno-rewrite-macros">, // This isn't normally used, it is just here so we can parse a // CompilerInvocation out of a driver-derived argument vector. -def cc1 : Flag<"-cc1">; +def cc1 : Flag<["-"], "cc1">; -def ast_merge : Separate<"-ast-merge">, +def ast_merge : Separate<["-"], "ast-merge">, MetaVarName<"">, HelpText<"Merge the given AST file into the translation unit being compiled.">; -def code_completion_at : Separate<"-code-completion-at">, +def code_completion_at : Separate<["-"], "code-completion-at">, MetaVarName<"::">, HelpText<"Dump code-completion information at a location">; -def remap_file : Separate<"-remap-file">, +def remap_file : Separate<["-"], "remap-file">, MetaVarName<";">, HelpText<"Replace the contents of the file with the contents of the file">; -def code_completion_at_EQ : Joined<"-code-completion-at=">, +def code_completion_at_EQ : Joined<["-"], "code-completion-at=">, Alias; -def code_completion_macros : Flag<"-code-completion-macros">, +def code_completion_macros : Flag<["-"], "code-completion-macros">, HelpText<"Include macros in code-completion results">; -def code_completion_patterns : Flag<"-code-completion-patterns">, +def code_completion_patterns : Flag<["-"], "code-completion-patterns">, HelpText<"Include code patterns in code-completion results">; -def no_code_completion_globals : Flag<"-no-code-completion-globals">, +def no_code_completion_globals : Flag<["-"], "no-code-completion-globals">, HelpText<"Do not include global declarations in code-completion results.">; -def code_completion_brief_comments : Flag<"-code-completion-brief-comments">, +def code_completion_brief_comments : Flag<["-"], "code-completion-brief-comments">, HelpText<"Include brief documentation comments in code-completion results.">; -def disable_free : Flag<"-disable-free">, +def disable_free : Flag<["-"], "disable-free">, HelpText<"Disable freeing of memory on exit">; -def load : Separate<"-load">, MetaVarName<"">, +def load : Separate<["-"], "load">, MetaVarName<"">, HelpText<"Load the named plugin (dynamic shared object)">; -def plugin : Separate<"-plugin">, MetaVarName<"">, +def plugin : Separate<["-"], "plugin">, MetaVarName<"">, HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">; -def plugin_arg : JoinedAndSeparate<"-plugin-arg-">, +def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">, MetaVarName<" ">, HelpText<"Pass to plugin ">; -def add_plugin : Separate<"-add-plugin">, MetaVarName<"">, +def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"">, HelpText<"Use the named plugin action in addition to the default action">; -def resource_dir : Separate<"-resource-dir">, +def resource_dir : Separate<["-"], "resource-dir">, HelpText<"The directory which holds the compiler resource files">; -def version : Flag<"-version">, +def version : Flag<["-"], "version">, HelpText<"Print the compiler version">; -def ast_dump_filter : Separate<"-ast-dump-filter">, +def ast_dump_filter : Separate<["-"], "ast-dump-filter">, MetaVarName<"">, HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration" " nodes having a certain substring in a qualified name. Use" @@ -295,195 +297,195 @@ def ast_dump_filter : Separate<"-ast-dump-filter">, let Group = Action_Group in { -def Eonly : Flag<"-Eonly">, +def Eonly : Flag<["-"], "Eonly">, HelpText<"Just run preprocessor, no output (for timings)">; -def dump_raw_tokens : Flag<"-dump-raw-tokens">, +def dump_raw_tokens : Flag<["-"], "dump-raw-tokens">, HelpText<"Lex file in raw mode and dump raw tokens">; -def analyze : Flag<"-analyze">, +def analyze : Flag<["-"], "analyze">, HelpText<"Run static analysis engine">; -def dump_tokens : Flag<"-dump-tokens">, +def dump_tokens : Flag<["-"], "dump-tokens">, HelpText<"Run preprocessor, dump internal rep of tokens">; -def init_only : Flag<"-init-only">, +def init_only : Flag<["-"], "init-only">, HelpText<"Only execute frontend initialization">; -def fixit : Flag<"-fixit">, +def fixit : Flag<["-"], "fixit">, HelpText<"Apply fix-it advice to the input source">; -def fixit_EQ : Joined<"-fixit=">, +def fixit_EQ : Joined<["-"], "fixit=">, HelpText<"Apply fix-it advice creating a file with the given suffix">; -def print_preamble : Flag<"-print-preamble">, +def print_preamble : Flag<["-"], "print-preamble">, HelpText<"Print the \"preamble\" of a file, which is a candidate for implicit" " precompiled headers.">; -def emit_html : Flag<"-emit-html">, +def emit_html : Flag<["-"], "emit-html">, HelpText<"Output input source as HTML">; -def ast_print : Flag<"-ast-print">, +def ast_print : Flag<["-"], "ast-print">, HelpText<"Build ASTs and then pretty-print them">; -def ast_list : Flag<"-ast-list">, +def ast_list : Flag<["-"], "ast-list">, HelpText<"Build ASTs and print the list of declaration node qualified names">; -def ast_dump : Flag<"-ast-dump">, +def ast_dump : Flag<["-"], "ast-dump">, HelpText<"Build ASTs and then debug dump them">; -def ast_dump_xml : Flag<"-ast-dump-xml">, +def ast_dump_xml : Flag<["-"], "ast-dump-xml">, HelpText<"Build ASTs and then debug dump them in a verbose XML format">; -def ast_view : Flag<"-ast-view">, +def ast_view : Flag<["-"], "ast-view">, HelpText<"Build ASTs and view them with GraphViz">; -def print_decl_contexts : Flag<"-print-decl-contexts">, +def print_decl_contexts : Flag<["-"], "print-decl-contexts">, HelpText<"Print DeclContexts and their Decls">; -def emit_module : Flag<"-emit-module">, +def emit_module : Flag<["-"], "emit-module">, HelpText<"Generate pre-compiled module file from a module map">; -def emit_pth : Flag<"-emit-pth">, +def emit_pth : Flag<["-"], "emit-pth">, HelpText<"Generate pre-tokenized header file">; -def emit_pch : Flag<"-emit-pch">, +def emit_pch : Flag<["-"], "emit-pch">, HelpText<"Generate pre-compiled header file">; -def emit_llvm_bc : Flag<"-emit-llvm-bc">, +def emit_llvm_bc : Flag<["-"], "emit-llvm-bc">, HelpText<"Build ASTs then convert to LLVM, emit .bc file">; -def emit_llvm_only : Flag<"-emit-llvm-only">, +def emit_llvm_only : Flag<["-"], "emit-llvm-only">, HelpText<"Build ASTs and convert to LLVM, discarding output">; -def emit_codegen_only : Flag<"-emit-codegen-only">, +def emit_codegen_only : Flag<["-"], "emit-codegen-only">, HelpText<"Generate machine code, but discard output">; -def emit_obj : Flag<"-emit-obj">, +def emit_obj : Flag<["-"], "emit-obj">, HelpText<"Emit native object files">; -def rewrite_test : Flag<"-rewrite-test">, +def rewrite_test : Flag<["-"], "rewrite-test">, HelpText<"Rewriter playground">; -def rewrite_macros : Flag<"-rewrite-macros">, +def rewrite_macros : Flag<["-"], "rewrite-macros">, HelpText<"Expand macros without full preprocessing">; -def migrate : Flag<"-migrate">, +def migrate : Flag<["-"], "migrate">, HelpText<"Migrate source code">; } -def mt_migrate_directory : Separate<"-mt-migrate-directory">, +def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">, HelpText<"Directory for temporary files produced during ARC or ObjC migration">; -def arcmt_check : Flag<"-arcmt-check">, +def arcmt_check : Flag<["-"], "arcmt-check">, HelpText<"Check for ARC migration issues that need manual handling">; -def arcmt_modify : Flag<"-arcmt-modify">, +def arcmt_modify : Flag<["-"], "arcmt-modify">, HelpText<"Apply modifications to files to conform to ARC">; -def arcmt_migrate : Flag<"-arcmt-migrate">, +def arcmt_migrate : Flag<["-"], "arcmt-migrate">, HelpText<"Apply modifications and produces temporary files that conform to ARC">; -def relocatable_pch : Flag<"-relocatable-pch">, +def relocatable_pch : Flag<["-", "--"], "relocatable-pch">, HelpText<"Whether to build a relocatable precompiled header">; -def print_stats : Flag<"-print-stats">, +def print_stats : Flag<["-"], "print-stats">, HelpText<"Print performance metrics and statistics">; -def fdump_record_layouts : Flag<"-fdump-record-layouts">, +def fdump_record_layouts : Flag<["-"], "fdump-record-layouts">, HelpText<"Dump record layout information">; -def fdump_record_layouts_simple : Flag<"-fdump-record-layouts-simple">, +def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">, HelpText<"Dump record layout information in a simple form used for testing">; -def fix_what_you_can : Flag<"-fix-what-you-can">, +def fix_what_you_can : Flag<["-"], "fix-what-you-can">, HelpText<"Apply fix-it advice even in the presence of unfixable errors">; -def fix_only_warnings : Flag<"-fix-only-warnings">, +def fix_only_warnings : Flag<["-"], "fix-only-warnings">, HelpText<"Apply fix-it advice only for warnings, not errors">; -def fixit_recompile : Flag<"-fixit-recompile">, +def fixit_recompile : Flag<["-"], "fixit-recompile">, HelpText<"Apply fix-it changes and recompile">; -def fixit_to_temp : Flag<"-fixit-to-temporary">, +def fixit_to_temp : Flag<["-"], "fixit-to-temporary">, HelpText<"Apply fix-it changes to temporary files">; -def foverride_record_layout_EQ : Joined<"-foverride-record-layout=">, +def foverride_record_layout_EQ : Joined<["-"], "foverride-record-layout=">, HelpText<"Override record layouts with those in the given file">; //===----------------------------------------------------------------------===// // Language Options //===----------------------------------------------------------------------===// -def fblocks_runtime_optional : Flag<"-fblocks-runtime-optional">, +def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">, HelpText<"Weakly link in the blocks runtime">; -def fsjlj_exceptions : Flag<"-fsjlj-exceptions">, +def fsjlj_exceptions : Flag<["-"], "fsjlj-exceptions">, HelpText<"Use SjLj style exceptions">; -def fhidden_weak_vtables : Flag<"-fhidden-weak-vtables">, +def fhidden_weak_vtables : Flag<["-"], "fhidden-weak-vtables">, HelpText<"Generate weak vtables and RTTI with hidden visibility">; -def main_file_name : Separate<"-main-file-name">, +def main_file_name : Separate<["-"], "main-file-name">, HelpText<"Main file name to use for debug info">; -def fno_signed_char : Flag<"-fno-signed-char">, +def fno_signed_char : Flag<["-"], "fno-signed-char">, HelpText<"Char is unsigned">; -def fno_wchar : Flag<"-fno-wchar">, +def fno_wchar : Flag<["-"], "fno-wchar">, HelpText<"Disable C++ builtin type wchar_t">; -def fconstant_string_class : Separate<"-fconstant-string-class">, +def fconstant_string_class : Separate<["-"], "fconstant-string-class">, MetaVarName<"">, HelpText<"Specify the class to use for constant Objective-C string objects.">; -def fobjc_arc_cxxlib_EQ : Joined<"-fobjc-arc-cxxlib=">, +def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">, HelpText<"Objective-C++ Automatic Reference Counting standard library kind">; -def fobjc_runtime_has_weak : Flag<"-fobjc-runtime-has-weak">, +def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">, HelpText<"The target Objective-C runtime supports ARC weak operations">; -def fobjc_dispatch_method_EQ : Joined<"-fobjc-dispatch-method=">, +def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">, HelpText<"Objective-C dispatch method to use">; -def fobjc_default_synthesize_properties : Flag<"-fobjc-default-synthesize-properties">, +def fobjc_default_synthesize_properties : Flag<["-"], "fobjc-default-synthesize-properties">, HelpText<"enable the default synthesis of Objective-C properties">; -def pic_level : Separate<"-pic-level">, +def pic_level : Separate<["-"], "pic-level">, HelpText<"Value for __PIC__">; -def pie_level : Separate<"-pie-level">, +def pie_level : Separate<["-"], "pie-level">, HelpText<"Value for __PIE__">; -def fno_validate_pch : Flag<"-fno-validate-pch">, +def fno_validate_pch : Flag<["-"], "fno-validate-pch">, HelpText<"Disable validation of precompiled headers">; -def dump_deserialized_pch_decls : Flag<"-dump-deserialized-decls">, +def dump_deserialized_pch_decls : Flag<["-"], "dump-deserialized-decls">, HelpText<"Dump declarations that are deserialized from PCH, for testing">; -def error_on_deserialized_pch_decl : Separate<"-error-on-deserialized-decl">, +def error_on_deserialized_pch_decl : Separate<["-"], "error-on-deserialized-decl">, HelpText<"Emit error if a specific declaration is deserialized from PCH, for testing">; -def error_on_deserialized_pch_decl_EQ : Joined<"-error-on-deserialized-decl=">, +def error_on_deserialized_pch_decl_EQ : Joined<["-"], "error-on-deserialized-decl=">, Alias; -def static_define : Flag<"-static-define">, +def static_define : Flag<["-"], "static-define">, HelpText<"Should __STATIC__ be defined">; -def stack_protector : Separate<"-stack-protector">, +def stack_protector : Separate<["-"], "stack-protector">, HelpText<"Enable stack protectors">; -def stack_protector_buffer_size : Separate<"-stack-protector-buffer-size">, +def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">, HelpText<"Lower bound for a buffer to be considered for stack protection">; -def fvisibility : Separate<"-fvisibility">, +def fvisibility : Separate<["-"], "fvisibility">, HelpText<"Default symbol visibility">; -def ftemplate_depth : Separate<"-ftemplate-depth">, +def ftemplate_depth : Separate<["-"], "ftemplate-depth">, HelpText<"Maximum depth of recursive template instantiation">; -def fconstexpr_depth : Separate<"-fconstexpr-depth">, +def fconstexpr_depth : Separate<["-"], "fconstexpr-depth">, HelpText<"Maximum depth of recursive constexpr function calls">; -def fconst_strings : Flag<"-fconst-strings">, +def fconst_strings : Flag<["-"], "fconst-strings">, HelpText<"Use a const qualified type for string literals in C and ObjC">; -def fno_const_strings : Flag<"-fno-const-strings">, +def fno_const_strings : Flag<["-"], "fno-const-strings">, HelpText<"Don't use a const qualified type for string literals in C and ObjC">; -def fno_bitfield_type_align : Flag<"-fno-bitfield-type-align">, +def fno_bitfield_type_align : Flag<["-"], "fno-bitfield-type-align">, HelpText<"Ignore bit-field types when aligning structures">; -def ffake_address_space_map : Flag<"-ffake-address-space-map">, +def ffake_address_space_map : Flag<["-"], "ffake-address-space-map">, HelpText<"Use a fake address space map; OpenCL testing purposes only">; -def funknown_anytype : Flag<"-funknown-anytype">, +def funknown_anytype : Flag<["-"], "funknown-anytype">, HelpText<"Enable parser support for the __unknown_anytype type; for testing purposes only">; -def fdebugger_support : Flag<"-fdebugger-support">, +def fdebugger_support : Flag<["-"], "fdebugger-support">, HelpText<"Enable special debugger support behavior">; -def fdebugger_cast_result_to_id : Flag<"-fdebugger-cast-result-to-id">, +def fdebugger_cast_result_to_id : Flag<["-"], "fdebugger-cast-result-to-id">, HelpText<"Enable casting unknown expression results to id">; -def fdebugger_objc_literal : Flag<"-fdebugger-objc-literal">, +def fdebugger_objc_literal : Flag<["-"], "fdebugger-objc-literal">, HelpText<"Enable special debugger support for Objective-C subscripting and literals">; -def fdeprecated_macro : Flag<"-fdeprecated-macro">, +def fdeprecated_macro : Flag<["-"], "fdeprecated-macro">, HelpText<"Defines the __DEPRECATED macro">; -def fno_deprecated_macro : Flag<"-fno-deprecated-macro">, +def fno_deprecated_macro : Flag<["-"], "fno-deprecated-macro">, HelpText<"Undefines the __DEPRECATED macro">; //===----------------------------------------------------------------------===// // Header Search Options //===----------------------------------------------------------------------===// -def nostdsysteminc : Flag<"-nostdsysteminc">, +def nostdsysteminc : Flag<["-"], "nostdsysteminc">, HelpText<"Disable standard system #include directories">; -def fmodule_name : Joined<"-fmodule-name=">, +def fmodule_name : Joined<["-"], "fmodule-name=">, MetaVarName<"">, HelpText<"Specify the name of the module to build">; -def fdisable_module_hash : Flag<"-fdisable-module-hash">, +def fdisable_module_hash : Flag<["-"], "fdisable-module-hash">, HelpText<"Disable the module hash">; -def c_isystem : JoinedOrSeparate<"-c-isystem">, MetaVarName<"">, +def c_isystem : JoinedOrSeparate<["-"], "c-isystem">, MetaVarName<"">, HelpText<"Add directory to the C SYSTEM include search path">; -def objc_isystem : JoinedOrSeparate<"-objc-isystem">, +def objc_isystem : JoinedOrSeparate<["-"], "objc-isystem">, MetaVarName<"">, HelpText<"Add directory to the ObjC SYSTEM include search path">; -def objcxx_isystem : JoinedOrSeparate<"-objcxx-isystem">, +def objcxx_isystem : JoinedOrSeparate<["-"], "objcxx-isystem">, MetaVarName<"">, HelpText<"Add directory to the ObjC++ SYSTEM include search path">; -def internal_isystem : JoinedOrSeparate<"-internal-isystem">, +def internal_isystem : JoinedOrSeparate<["-"], "internal-isystem">, MetaVarName<"">, HelpText<"Add directory to the internal system include search path; these " "are assumed to not be user-provided and are used to model system " "and standard headers' paths.">; -def internal_externc_isystem : JoinedOrSeparate<"-internal-externc-isystem">, +def internal_externc_isystem : JoinedOrSeparate<["-"], "internal-externc-isystem">, MetaVarName<"">, HelpText<"Add directory to the internal system include search path with " "implicit extern \"C\" semantics; these are assumed to not be " "user-provided and are used to model system and standard headers' " "paths.">; -def isystem_prefix : JoinedOrSeparate<"-isystem-prefix">, +def isystem_prefix : JoinedOrSeparate<["-"], "isystem-prefix">, MetaVarName<"">, HelpText<"Treat all #include paths starting with as including a " "system header.">; -def ino_system_prefix : JoinedOrSeparate<"-ino-system-prefix">, +def ino_system_prefix : JoinedOrSeparate<["-"], "ino-system-prefix">, MetaVarName<"">, HelpText<"Treat all #include paths starting with as not including a " "system header.">; @@ -492,42 +494,42 @@ def ino_system_prefix : JoinedOrSeparate<"-ino-system-prefix">, // Preprocessor Options //===----------------------------------------------------------------------===// -def include_pth : Separate<"-include-pth">, MetaVarName<"">, +def include_pth : Separate<["-"], "include-pth">, MetaVarName<"">, HelpText<"Include file before parsing">; -def chain_include : Separate<"-chain-include">, MetaVarName<"">, +def chain_include : Separate<["-"], "chain-include">, MetaVarName<"">, HelpText<"Include and chain a header file after turning it into PCH">; -def preamble_bytes_EQ : Joined<"-preamble-bytes=">, +def preamble_bytes_EQ : Joined<["-"], "preamble-bytes=">, HelpText<"Assume that the precompiled header is a precompiled preamble " "covering the first N bytes of the main file">; -def token_cache : Separate<"-token-cache">, MetaVarName<"">, +def token_cache : Separate<["-"], "token-cache">, MetaVarName<"">, HelpText<"Use specified token cache file">; -def detailed_preprocessing_record : Flag<"-detailed-preprocessing-record">, +def detailed_preprocessing_record : Flag<["-"], "detailed-preprocessing-record">, HelpText<"include a detailed record of preprocessing actions">; //===----------------------------------------------------------------------===// // OpenCL Options //===----------------------------------------------------------------------===// -def cl_opt_disable : Flag<"-cl-opt-disable">, +def cl_opt_disable : Flag<["-"], "cl-opt-disable">, HelpText<"OpenCL only. This option disables all optimizations. The default is optimizations are enabled.">; -def cl_single_precision_constant : Flag<"-cl-single-precision-constant">, +def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">, HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">; -def cl_finite_math_only : Flag<"-cl-finite-math-only">, +def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">, HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">; -def cl_unsafe_math_optimizations : Flag<"-cl-unsafe-math-optimizations">, +def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">, HelpText<"OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable">; -def cl_fast_relaxed_math : Flag<"-cl-fast-relaxed-math">, +def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">, HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">; -def cl_mad_enable : Flag<"-cl-mad-enable">, +def cl_mad_enable : Flag<["-"], "cl-mad-enable">, HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">; -def cl_std_EQ : Joined<"-cl-std=">, +def cl_std_EQ : Joined<["-"], "cl-std=">, HelpText<"OpenCL language standard to compile for">; //===----------------------------------------------------------------------===// // CUDA Options //===----------------------------------------------------------------------===// -def fcuda_is_device : Flag<"-fcuda-is-device">, +def fcuda_is_device : Flag<["-"], "fcuda-is-device">, HelpText<"Generate code for CUDA device">; } // let Flags = [CC1Option] diff --git a/include/clang/Driver/OptParser.td b/include/clang/Driver/OptParser.td index 9e6d5b9118..9a3eb0984f 100644 --- a/include/clang/Driver/OptParser.td +++ b/include/clang/Driver/OptParser.td @@ -99,8 +99,9 @@ class OptionGroup { // Define the option class. -class Option { +class Option prefixes, string name, OptionKind kind> { string EnumName = ?; // Uses the def name if undefined. + list Prefixes = prefixes; string Name = name; OptionKind Kind = kind; // Used by MultiArg option kind. @@ -114,15 +115,22 @@ class Option { // Helpers for defining options. -class Flag : Option; -class Joined : Option; -class Separate : Option; -class CommaJoined : Option; -class MultiArg : Option { +class Flag prefixes, string name> + : Option; +class Joined prefixes, string name> + : Option; +class Separate prefixes, string name> + : Option; +class CommaJoined prefixes, string name> + : Option; +class MultiArg prefixes, string name, int numargs> + : Option { int NumArgs = numargs; } -class JoinedOrSeparate : Option; -class JoinedAndSeparate : Option; +class JoinedOrSeparate prefixes, string name> + : Option; +class JoinedAndSeparate prefixes, string name> + : Option; // Mix-ins for adding optional attributes. @@ -137,5 +145,5 @@ class MetaVarName { string MetaVarName = name; } // FIXME: Have generator validate that these appear in correct position (and // aren't duplicated). -def INPUT : Option<"", KIND_INPUT>, Flags<[DriverOption,CC1Option]>; -def UNKNOWN : Option<"", KIND_UNKNOWN>; +def INPUT : Option<[], "", KIND_INPUT>, Flags<[DriverOption,CC1Option]>; +def UNKNOWN : Option<[], "", KIND_UNKNOWN>; diff --git a/include/clang/Driver/OptTable.h b/include/clang/Driver/OptTable.h index 51ffe9f9be..63bec30d77 100644 --- a/include/clang/Driver/OptTable.h +++ b/include/clang/Driver/OptTable.h @@ -12,6 +12,7 @@ #include "clang/Basic/LLVM.h" #include "clang/Driver/OptSpecifier.h" +#include "llvm/ADT/StringSet.h" namespace clang { namespace driver { @@ -31,6 +32,9 @@ namespace driver { public: /// \brief Entry for a single option instance in the option data table. struct Info { + /// A null terminated array of prefix strings to apply to name while + /// matching. + const char *const *Prefixes; const char *Name; const char *HelpText; const char *MetaVar; @@ -54,6 +58,11 @@ namespace driver { /// special option like 'input' or 'unknown', and is not an option group). unsigned FirstSearchableIndex; + /// The union of all option prefixes. If an argument does not begin with + /// one of these, it is an input. + llvm::StringSet<> PrefixesUnion; + std::string PrefixChars; + private: const Info &getInfo(OptSpecifier Opt) const { unsigned id = Opt.getID(); diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h index 11e417149d..c96ec68409 100644 --- a/include/clang/Driver/Option.h +++ b/include/clang/Driver/Option.h @@ -95,6 +95,7 @@ namespace options { return OptionClass(Info->Kind); } + /// \brief Get the name of this option without any prefix. StringRef getName() const { assert(Info && "Must have a valid info!"); return Info->Name; @@ -112,6 +113,19 @@ namespace options { return Owner->getOption(Info->AliasID); } + /// \brief Get the default prefix for this option. + StringRef getPrefix() const { + const char *Prefix = *Info->Prefixes; + return Prefix ? Prefix : StringRef(); + } + + /// \brief Get the name of this option with the default prefix. + std::string getPrefixedName() const { + std::string Ret = getPrefix(); + Ret += getName(); + return Ret; + } + unsigned getNumArgs() const { return Info->Param; } bool hasNoOptAsInput() const { return Info->Flags & options::RenderAsInput;} @@ -174,7 +188,11 @@ namespace options { /// If the option accepts the current argument, accept() sets /// Index to the position where argument parsing should resume /// (even if the argument is missing values). - Arg *accept(const ArgList &Args, unsigned &Index) const; + /// + /// \parm ArgSize The number of bytes taken up by the matched Option prefix + /// and name. This is used to determine where joined values + /// start. + Arg *accept(const ArgList &Args, unsigned &Index, unsigned ArgSize) const; void dump() const; }; diff --git a/include/clang/Driver/Options.h b/include/clang/Driver/Options.h index ac312cdfd4..6c114e252d 100644 --- a/include/clang/Driver/Options.h +++ b/include/clang/Driver/Options.h @@ -17,11 +17,13 @@ namespace driver { namespace options { enum ID { OPT_INVALID = 0, // This is not an option ID. -#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ +#define PREFIX(NAME, VALUE) +#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ HELPTEXT, METAVAR) OPT_##ID, #include "clang/Driver/Options.inc" LastOption #undef OPTION +#undef PREFIX }; } diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index dc05e49a73..c14b0bccc1 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -84,1102 +84,1073 @@ def ccc_debug_Group : OptionGroup<"">, Group, HelpText<"DEBUG/DEVELOPMENT OPTIONS">; class CCCDriverOpt : Group, Flags<[DriverOption, HelpHidden]>; -def ccc_cxx : Flag<"-ccc-cxx">, CCCDriverOpt, +def ccc_cxx : Flag<["-"], "ccc-cxx">, CCCDriverOpt, HelpText<"Act as a C++ driver">; -def ccc_echo : Flag<"-ccc-echo">, CCCDriverOpt, +def ccc_echo : Flag<["-"], "ccc-echo">, CCCDriverOpt, HelpText<"Echo commands before running them">; -def ccc_gcc_name : Separate<"-ccc-gcc-name">, CCCDriverOpt, +def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, CCCDriverOpt, HelpText<"Name for native GCC compiler">, MetaVarName<"">; -def ccc_clang_cxx : Flag<"-ccc-clang-cxx">, CCCDriverOpt, +def ccc_clang_cxx : Flag<["-"], "ccc-clang-cxx">, CCCDriverOpt, HelpText<"Enable the clang compiler for C++">; -def ccc_no_clang_cxx : Flag<"-ccc-no-clang-cxx">, CCCDriverOpt, +def ccc_no_clang_cxx : Flag<["-"], "ccc-no-clang-cxx">, CCCDriverOpt, HelpText<"Disable the clang compiler for C++">; -def ccc_no_clang : Flag<"-ccc-no-clang">, CCCDriverOpt, +def ccc_no_clang : Flag<["-"], "ccc-no-clang">, CCCDriverOpt, HelpText<"Disable the clang compiler">; -def ccc_no_clang_cpp : Flag<"-ccc-no-clang-cpp">, CCCDriverOpt, +def ccc_no_clang_cpp : Flag<["-"], "ccc-no-clang-cpp">, CCCDriverOpt, HelpText<"Disable the clang preprocessor">; -def ccc_pch_is_pch : Flag<"-ccc-pch-is-pch">, CCCDriverOpt, +def ccc_clang_archs : Separate<["-"], "ccc-clang-archs">, CCCDriverOpt, + HelpText<"Comma separate list of architectures to use the clang compiler for">, + MetaVarName<"">; +def ccc_pch_is_pch : Flag<["-"], "ccc-pch-is-pch">, CCCDriverOpt, HelpText<"Use lazy PCH for precompiled headers">; -def ccc_pch_is_pth : Flag<"-ccc-pch-is-pth">, CCCDriverOpt, +def ccc_pch_is_pth : Flag<["-"], "ccc-pch-is-pth">, CCCDriverOpt, HelpText<"Use pretokenized headers for precompiled headers">; class CCCDebugOpt : Group, Flags<[DriverOption, HelpHidden]>; -def ccc_install_dir : Separate<"-ccc-install-dir">, CCCDebugOpt, +def ccc_install_dir : Separate<["-"], "ccc-install-dir">, CCCDebugOpt, HelpText<"Simulate installation in the given directory">; -def ccc_print_options : Flag<"-ccc-print-options">, CCCDebugOpt, +def ccc_print_options : Flag<["-"], "ccc-print-options">, CCCDebugOpt, HelpText<"Dump parsed command line arguments">; -def ccc_print_phases : Flag<"-ccc-print-phases">, CCCDebugOpt, +def ccc_print_phases : Flag<["-"], "ccc-print-phases">, CCCDebugOpt, HelpText<"Dump list of actions to perform">; -def ccc_print_bindings : Flag<"-ccc-print-bindings">, CCCDebugOpt, +def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, CCCDebugOpt, HelpText<"Show bindings of tools to actions">; -def ccc_arcmt_check : Flag<"-ccc-arcmt-check">, CCCDriverOpt, +def ccc_arcmt_check : Flag<["-"], "ccc-arcmt-check">, CCCDriverOpt, HelpText<"Check for ARC migration issues that need manual handling">; -def ccc_arcmt_modify : Flag<"-ccc-arcmt-modify">, CCCDriverOpt, +def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, CCCDriverOpt, HelpText<"Apply modifications to files to conform to ARC">; -def ccc_arrmt_check : Flag<"-ccc-arrmt-check">, Alias; -def ccc_arrmt_modify : Flag<"-ccc-arrmt-modify">, Alias; -def ccc_arcmt_migrate : Separate<"-ccc-arcmt-migrate">, CCCDriverOpt, +def ccc_arrmt_check : Flag<["-"], "ccc-arrmt-check">, Alias; +def ccc_arrmt_modify : Flag<["-"], "ccc-arrmt-modify">, Alias; +def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, CCCDriverOpt, HelpText<"Apply modifications and produces temporary files that conform to ARC">; -def arcmt_migrate_report_output : Separate<"-arcmt-migrate-report-output">, +def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">, HelpText<"Output path for the plist report">, Flags<[CC1Option]>; -def arcmt_migrate_emit_arc_errors : Flag<"-arcmt-migrate-emit-errors">, +def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">, HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>; -def _migrate : Flag<"--migrate">, Flags<[DriverOption]>, +def _migrate : Flag<["--"], "migrate">, Flags<[DriverOption]>, HelpText<"Run the migrator">; -def ccc_objcmt_migrate : Separate<"-ccc-objcmt-migrate">, CCCDriverOpt, +def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">, CCCDriverOpt, HelpText<"Apply modifications and produces temporary files to migrate to " "modern ObjC syntax">; -def objcmt_migrate_literals : Flag<"-objcmt-migrate-literals">, Flags<[CC1Option]>, +def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC literals">; -def objcmt_migrate_subscripting : Flag<"-objcmt-migrate-subscripting">, Flags<[CC1Option]>, +def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC subscripting">; // Make sure all other -ccc- options are rejected. -def ccc_ : Joined<"-ccc-">, Group, Flags<[Unsupported]>; +def ccc_ : Joined<["-"], "ccc-">, Group, Flags<[Unsupported]>; // Standard Options -def _HASH_HASH_HASH : Flag<"-###">, Flags<[DriverOption]>, +def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[DriverOption]>, HelpText<"Print the commands to run for this compilation">; // The '--' option is here for the sake of compatibility with gcc, but is // being ignored by the driver. -def _DASH_DASH : Flag<"--">, Flags<[DriverOption]>; -def A : JoinedOrSeparate<"-A">; -def B : JoinedOrSeparate<"-B">; -def CC : Flag<"-CC">, Flags<[CC1Option]>; -def C : Flag<"-C">, Flags<[CC1Option]>; -def D : JoinedOrSeparate<"-D">, Group, Flags<[CC1Option]>; -def E : Flag<"-E">, Flags<[DriverOption,CC1Option]>, Group, +def _DASH_DASH : Flag<["--"], "">, Flags<[DriverOption]>; +def A : JoinedOrSeparate<["-"], "A">; +def B : JoinedOrSeparate<["-"], "B">; +def CC : Flag<["-"], "CC">, Flags<[CC1Option]>; +def C : Flag<["-"], "C">, Flags<[CC1Option]>; +def D : JoinedOrSeparate<["-"], "D">, Group, Flags<[CC1Option]>; +def E : Flag<["-"], "E">, Flags<[DriverOption,CC1Option]>, Group, HelpText<"Only run the preprocessor">; -def F : JoinedOrSeparate<"-F">, Flags<[RenderJoined,CC1Option]>, +def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>, HelpText<"Add directory to framework include search path">; -def G : Separate<"-G">, Flags<[DriverOption]>; -def H : Flag<"-H">, Flags<[CC1Option]>, +def G : Separate<["-"], "G">, Flags<[DriverOption]>; +def H : Flag<["-"], "H">, Flags<[CC1Option]>, HelpText<"Show header includes and nesting depth">; -def I_ : Flag<"-I-">, Group; -def I : JoinedOrSeparate<"-I">, Group, Flags<[CC1Option]>, +def I_ : Flag<["-"], "I-">, Group; +def I : JoinedOrSeparate<["-"], "I">, Group, Flags<[CC1Option]>, HelpText<"Add directory to include search path">; -def L : JoinedOrSeparate<"-L">, Flags<[RenderJoined]>; -def MD : Flag<"-MD">, Group; -def MF : JoinedOrSeparate<"-MF">, Group; -def MG : Flag<"-MG">, Group, Flags<[CC1Option]>, +def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>; +def MD : Flag<["-"], "MD">, Group; +def MF : JoinedOrSeparate<["-"], "MF">, Group; +def MG : Flag<["-"], "MG">, Group, Flags<[CC1Option]>, HelpText<"Add missing headers to dependency list">; -def MMD : Flag<"-MMD">, Group; -def MM : Flag<"-MM">, Group; -def MP : Flag<"-MP">, Group, Flags<[CC1Option]>, +def MMD : Flag<["-"], "MMD">, Group; +def MM : Flag<["-"], "MM">, Group; +def MP : Flag<["-"], "MP">, Group, Flags<[CC1Option]>, HelpText<"Create phony target for each dependency (other than main file)">; -def MQ : JoinedOrSeparate<"-MQ">, Group, Flags<[CC1Option]>, +def MQ : JoinedOrSeparate<["-"], "MQ">, Group, Flags<[CC1Option]>, HelpText<"Specify target to quote for dependency">; -def MT : JoinedOrSeparate<"-MT">, Group, Flags<[CC1Option]>, +def MT : JoinedOrSeparate<["-"], "MT">, Group, Flags<[CC1Option]>, HelpText<"Specify target for dependency">; -def Mach : Flag<"-Mach">; -def M : Flag<"-M">, Group; -def O0 : Joined<"-O0">, Group, Flags<[CC1Option]>; -def O4 : Joined<"-O4">, Group, Flags<[CC1Option]>; -def ObjCXX : Flag<"-ObjC++">, Flags<[DriverOption]>, +def Mach : Flag<["-"], "Mach">; +def M : Flag<["-"], "M">, Group; +def O0 : Joined<["-"], "O0">, Group, Flags<[CC1Option]>; +def O4 : Joined<["-"], "O4">, Group, Flags<[CC1Option]>; +def ObjCXX : Flag<["-"], "ObjC++">, Flags<[DriverOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; -def ObjC : Flag<"-ObjC">, Flags<[DriverOption]>, +def ObjC : Flag<["-"], "ObjC">, Flags<[DriverOption]>, HelpText<"Treat source input files as Objective-C inputs">; -def O : Joined<"-O">, Group, Flags<[CC1Option]>; -def P : Flag<"-P">, Flags<[CC1Option]>, +def O : Joined<["-"], "O">, Group, Flags<[CC1Option]>; +def P : Flag<["-"], "P">, Flags<[CC1Option]>, HelpText<"Disable linemarker output in -E mode">; -def Qn : Flag<"-Qn">; -def Qunused_arguments : Flag<"-Qunused-arguments">, Flags<[DriverOption]>, +def Qn : Flag<["-"], "Qn">; +def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[DriverOption]>, HelpText<"Don't emit warning for unused driver arguments">; -def Q : Flag<"-Q">; -def R : Flag<"-R">; -def S : Flag<"-S">, Flags<[DriverOption,CC1Option]>, Group, +def Q : Flag<["-"], "Q">; +def R : Flag<["-"], "R">; +def S : Flag<["-"], "S">, Flags<[DriverOption,CC1Option]>, Group, HelpText<"Only run preprocess and compilation steps">; -def Tbss : JoinedOrSeparate<"-Tbss">, Group; -def Tdata : JoinedOrSeparate<"-Tdata">, Group; -def Ttext : JoinedOrSeparate<"-Ttext">, Group; -def T : JoinedOrSeparate<"-T">, Group; -def U : JoinedOrSeparate<"-U">, Group, Flags<[CC1Option]>; -def V : JoinedOrSeparate<"-V">, Flags<[DriverOption, Unsupported]>; -def Wa_COMMA : CommaJoined<"-Wa,">, +def Tbss : JoinedOrSeparate<["-"], "Tbss">, Group; +def Tdata : JoinedOrSeparate<["-"], "Tdata">, Group; +def Ttext : JoinedOrSeparate<["-"], "Ttext">, Group; +def T : JoinedOrSeparate<["-"], "T">, Group; +def U : JoinedOrSeparate<["-"], "U">, Group, Flags<[CC1Option]>; +def V : JoinedOrSeparate<["-"], "V">, Flags<[DriverOption, Unsupported]>; +def Wa_COMMA : CommaJoined<["-"], "Wa,">, HelpText<"Pass the comma separated arguments in to the assembler">, MetaVarName<"">; -def Wall : Flag<"-Wall">, Group, Flags<[CC1Option]>; -def Wdeprecated : Flag<"-Wdeprecated">, Group, Flags<[CC1Option]>; -def Wno_deprecated : Flag<"-Wno-deprecated">, Group, Flags<[CC1Option]>; -def Wextra : Flag<"-Wextra">, Group, Flags<[CC1Option]>; -def Wl_COMMA : CommaJoined<"-Wl,">, Flags<[LinkerInput, RenderAsInput]>, +def Wall : Flag<["-"], "Wall">, Group, Flags<[CC1Option]>; +def Wdeprecated : Flag<["-"], "Wdeprecated">, Group, Flags<[CC1Option]>; +def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group, Flags<[CC1Option]>; +def Wextra : Flag<["-"], "Wextra">, Group, Flags<[CC1Option]>; +def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>, HelpText<"Pass the comma separated arguments in to the linker">, MetaVarName<"">; -def Wno_nonportable_cfstrings : Joined<"-Wno-nonportable-cfstrings">, Group, +def Wno_nonportable_cfstrings : Joined<["-"], "Wno-nonportable-cfstrings">, Group, Flags<[CC1Option]>; -def Wnonportable_cfstrings : Joined<"-Wnonportable-cfstrings">, Group, +def Wnonportable_cfstrings : Joined<["-"], "Wnonportable-cfstrings">, Group, Flags<[CC1Option]>; -def Wp_COMMA : CommaJoined<"-Wp,">, +def Wp_COMMA : CommaJoined<["-"], "Wp,">, HelpText<"Pass the comma separated arguments in to the preprocessor">, MetaVarName<"">; -def Wwrite_strings : Flag<"-Wwrite-strings">, Group, Flags<[CC1Option]>; -def Wno_write_strings : Flag<"-Wno-write-strings">, Group, Flags<[CC1Option]>; -def W_Joined : Joined<"-W">, Group, Flags<[CC1Option]>; -def Xanalyzer : Separate<"-Xanalyzer">, +def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group, Flags<[CC1Option]>; +def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group, Flags<[CC1Option]>; +def W_Joined : Joined<["-"], "W">, Group, Flags<[CC1Option]>; +def Xanalyzer : Separate<["-"], "Xanalyzer">, HelpText<"Pass to the static analyzer">, MetaVarName<"">; -def Xarch__ : JoinedAndSeparate<"-Xarch_">, Flags<[DriverOption]>; -def Xassembler : Separate<"-Xassembler">, +def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[DriverOption]>; +def Xassembler : Separate<["-"], "Xassembler">, HelpText<"Pass to the assembler">, MetaVarName<"">; -def Xclang : Separate<"-Xclang">, +def Xclang : Separate<["-"], "Xclang">, HelpText<"Pass to the clang compiler">, MetaVarName<"">, Flags<[NoForward]>; -def Xlinker : Separate<"-Xlinker">, Flags<[LinkerInput, RenderAsInput]>, +def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>, HelpText<"Pass to the linker">, MetaVarName<"">; -def Xpreprocessor : Separate<"-Xpreprocessor">, +def Xpreprocessor : Separate<["-"], "Xpreprocessor">, HelpText<"Pass to the preprocessor">, MetaVarName<"">; -def X_Flag : Flag<"-X">; -def X_Joined : Joined<"-X">; -def Z_Flag : Flag<"-Z">; -def Z_Joined : Joined<"-Z">; -def all__load : Flag<"-all_load">; -def allowable__client : Separate<"-allowable_client">; -def ansi : Flag<"-ansi">, Group; -def arch__errors__fatal : Flag<"-arch_errors_fatal">; -def arch : Separate<"-arch">, Flags<[DriverOption]>; -def arch__only : Separate<"-arch_only">; -def a : Joined<"-a">, Group; -def bind__at__load : Flag<"-bind_at_load">; -def bundle__loader : Separate<"-bundle_loader">; -def bundle : Flag<"-bundle">; -def b : JoinedOrSeparate<"-b">, Flags<[Unsupported]>; -def cl_kernel_arg_info : Flag<"-cl-kernel-arg-info">, Flags<[CC1Option]>, Group, +def X_Flag : Flag<["-"], "X">; +def X_Joined : Joined<["-"], "X">; +def Z_Flag : Flag<["-"], "Z">; +def Z_Joined : Joined<["-"], "Z">; +def all__load : Flag<["-"], "all_load">; +def allowable__client : Separate<["-"], "allowable_client">; +def ansi : Flag<["-", "--"], "ansi">, Group; +def arch__errors__fatal : Flag<["-"], "arch_errors_fatal">; +def arch : Separate<["-"], "arch">, Flags<[DriverOption]>; +def arch__only : Separate<["-"], "arch_only">; +def a : Joined<["-"], "a">, Group; +def bind__at__load : Flag<["-"], "bind_at_load">; +def bundle__loader : Separate<["-"], "bundle_loader">; +def bundle : Flag<["-"], "bundle">; +def b : JoinedOrSeparate<["-"], "b">, Flags<[Unsupported]>; +def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">, Flags<[CC1Option]>, Group, HelpText<"OpenCL only. This option allows the compiler to store information about the arguments of a kernel(s)"> ; -def client__name : JoinedOrSeparate<"-client_name">; -def combine : Flag<"-combine">, Flags<[DriverOption, Unsupported]>; -def compatibility__version : JoinedOrSeparate<"-compatibility_version">; -def coverage : Flag<"-coverage">; -def cpp_precomp : Flag<"-cpp-precomp">, Group; -def current__version : JoinedOrSeparate<"-current_version">; -def cxx_isystem : JoinedOrSeparate<"-cxx-isystem">, Group, +def client__name : JoinedOrSeparate<["-"], "client_name">; +def combine : Flag<["-", "--"], "combine">, Flags<[DriverOption, Unsupported]>; +def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">; +def coverage : Flag<["-", "--"], "coverage">; +def cpp_precomp : Flag<["-"], "cpp-precomp">, Group; +def current__version : JoinedOrSeparate<["-"], "current_version">; +def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group, HelpText<"Add directory to the C++ SYSTEM include search path">, Flags<[CC1Option]>, MetaVarName<"">; -def c : Flag<"-c">, Flags<[DriverOption]>, +def c : Flag<["-"], "c">, Flags<[DriverOption]>, HelpText<"Only run preprocess, compile, and assemble steps">; -def dA : Flag<"-dA">, Group; -def dD : Flag<"-dD">, Group, Flags<[CC1Option]>, +def dA : Flag<["-"], "dA">, Group; +def dD : Flag<["-"], "dD">, Group, Flags<[CC1Option]>, HelpText<"Print macro definitions in -E mode in addition to normal output">; -def dM : Flag<"-dM">, Group, Flags<[CC1Option]>, +def dM : Flag<["-"], "dM">, Group, Flags<[CC1Option]>, HelpText<"Print macro definitions in -E mode instead of normal output">; -def dead__strip : Flag<"-dead_strip">; -def dependency_file : Separate<"-dependency-file">, Flags<[CC1Option]>, +def dead__strip : Flag<["-"], "dead_strip">; +def dependency_file : Separate<["-"], "dependency-file">, Flags<[CC1Option]>, HelpText<"Filename (or -) to write dependency output to">; -def dependency_dot : Separate<"-dependency-dot">, Flags<[CC1Option]>, +def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>, HelpText<"Filename to write DOT-formatted header dependencies to">; -def dumpmachine : Flag<"-dumpmachine">; -def dumpspecs : Flag<"-dumpspecs">, Flags<[Unsupported]>; -def dumpversion : Flag<"-dumpversion">; -def dylib__file : Separate<"-dylib_file">; -def dylinker__install__name : JoinedOrSeparate<"-dylinker_install_name">; -def dylinker : Flag<"-dylinker">; -def dynamiclib : Flag<"-dynamiclib">; -def dynamic : Flag<"-dynamic">, Flags<[NoArgumentUnused]>; -def d_Flag : Flag<"-d">, Group; -def d_Joined : Joined<"-d">, Group; -def emit_ast : Flag<"-emit-ast">, +def dumpmachine : Flag<["-"], "dumpmachine">; +def dumpspecs : Flag<["-"], "dumpspecs">, Flags<[Unsupported]>; +def dumpversion : Flag<["-"], "dumpversion">; +def dylib__file : Separate<["-"], "dylib_file">; +def dylinker__install__name : JoinedOrSeparate<["-"], "dylinker_install_name">; +def dylinker : Flag<["-"], "dylinker">; +def dynamiclib : Flag<["-"], "dynamiclib">; +def dynamic : Flag<["-"], "dynamic">, Flags<[NoArgumentUnused]>; +def d_Flag : Flag<["-"], "d">, Group; +def d_Joined : Joined<["-"], "d">, Group; +def emit_ast : Flag<["-"], "emit-ast">, HelpText<"Emit Clang AST files for source inputs">; -def emit_llvm : Flag<"-emit-llvm">, Flags<[CC1Option]>, Group, +def emit_llvm : Flag<["-"], "emit-llvm">, Flags<[CC1Option]>, Group, HelpText<"Use the LLVM representation for assembler and object files">; -def exported__symbols__list : Separate<"-exported_symbols_list">; -def e : JoinedOrSeparate<"-e">; -def fPIC : Flag<"-fPIC">, Group; -def fno_PIC : Flag<"-fno-PIC">, Group; -def fPIE : Flag<"-fPIE">, Group; -def fno_PIE : Flag<"-fno-PIE">, Group; -def faccess_control : Flag<"-faccess-control">, Group; -def fallow_unsupported : Flag<"-fallow-unsupported">, Group; -def faltivec : Flag<"-faltivec">, Group, Flags<[CC1Option]>, +def exported__symbols__list : Separate<["-"], "exported_symbols_list">; +def e : JoinedOrSeparate<["-"], "e">; +def fPIC : Flag<["-"], "fPIC">, Group; +def fno_PIC : Flag<["-"], "fno-PIC">, Group; +def fPIE : Flag<["-"], "fPIE">, Group; +def fno_PIE : Flag<["-"], "fno-PIE">, Group; +def faccess_control : Flag<["-"], "faccess-control">, Group; +def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group; +def faltivec : Flag<["-"], "faltivec">, Group, Flags<[CC1Option]>, HelpText<"Enable AltiVec vector initializer syntax">; -def fapple_kext : Flag<"-fapple-kext">, Group, Flags<[CC1Option]>, +def fapple_kext : Flag<["-"], "fapple-kext">, Group, Flags<[CC1Option]>, HelpText<"Use Apple's kernel extensions ABI">; -def fapple_pragma_pack : Flag<"-fapple-pragma-pack">, Group, Flags<[CC1Option]>, +def fapple_pragma_pack : Flag<["-"], "fapple-pragma-pack">, Group, Flags<[CC1Option]>, HelpText<"Enable Apple gcc-compatible #pragma pack handling">; -def faddress_sanitizer : Flag<"-faddress-sanitizer">, Group, Flags<[CC1Option]>, +def faddress_sanitizer : Flag<["-"], "faddress-sanitizer">, Group, Flags<[CC1Option]>, HelpText<"Enable AddressSanitizer instrumentation (memory error detection)">; -def fno_address_sanitizer : Flag<"-fno-address-sanitizer">, Group, Flags<[CC1Option]>; -def fthread_sanitizer : Flag<"-fthread-sanitizer">, Group, Flags<[CC1Option]>, +def fno_address_sanitizer : Flag<["-"], "fno-address-sanitizer">, Group, Flags<[CC1Option]>; +def fthread_sanitizer : Flag<["-"], "fthread-sanitizer">, Group, Flags<[CC1Option]>, HelpText<"Enable ThreadSanitizer instrumentation (race detection)">; -def fno_thread_sanitizer : Flag<"-fno-thread-sanitizer">, Group, Flags<[CC1Option]>; -def fasm : Flag<"-fasm">, Group; +def fno_thread_sanitizer : Flag<["-"], "fno-thread-sanitizer">, Group, Flags<[CC1Option]>; +def fasm : Flag<["-"], "fasm">, Group; -def fasm_blocks : Flag<"-fasm-blocks">, Group; -def fno_asm_blocks : Flag<"-fno-asm-blocks">, Group; +def fasm_blocks : Flag<["-"], "fasm-blocks">, Group; +def fno_asm_blocks : Flag<["-"], "fno-asm-blocks">, Group; -def fassume_sane_operator_new : Flag<"-fassume-sane-operator-new">, Group; -def fastcp : Flag<"-fastcp">, Group; -def fastf : Flag<"-fastf">, Group; -def fast : Flag<"-fast">, Group; -def fasynchronous_unwind_tables : Flag<"-fasynchronous-unwind-tables">, Group; -def fblocks : Flag<"-fblocks">, Group, Flags<[CC1Option]>, +def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group; +def fastcp : Flag<["-"], "fastcp">, Group; +def fastf : Flag<["-"], "fastf">, Group; +def fast : Flag<["-"], "fast">, Group; +def fasynchronous_unwind_tables : Flag<["-"], "fasynchronous-unwind-tables">, Group; +def fblocks : Flag<["-"], "fblocks">, Group, Flags<[CC1Option]>, HelpText<"Enable the 'blocks' language feature">; -def fbootclasspath_EQ : Joined<"-fbootclasspath=">, Group; -def fborland_extensions : Flag<"-fborland-extensions">, Group, Flags<[CC1Option]>, +def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group; +def fborland_extensions : Flag<["-"], "fborland-extensions">, Group, Flags<[CC1Option]>, HelpText<"Accept non-standard constructs supported by the Borland compiler">; -def fbounds_checking : Flag<"-fbounds-checking">, Group, +def fbounds_checking : Flag<["-"], "fbounds-checking">, Group, HelpText<"Enable run-time bounds checks.">; -def fbounds_checking_EQ : Joined<"-fbounds-checking=">, Flags<[CC1Option]>, +def fbounds_checking_EQ : Joined<["-"], "fbounds-checking=">, Flags<[CC1Option]>, Group; -def fbuiltin_strcat : Flag<"-fbuiltin-strcat">, Group; -def fbuiltin_strcpy : Flag<"-fbuiltin-strcpy">, Group; -def fbuiltin : Flag<"-fbuiltin">, Group; -def fcaret_diagnostics : Flag<"-fcaret-diagnostics">, Group; -def fcatch_undefined_behavior : Flag<"-fcatch-undefined-behavior">, Flags<[CC1Option]>, +def fbuiltin_strcat : Flag<["-"], "fbuiltin-strcat">, Group; +def fbuiltin_strcpy : Flag<["-"], "fbuiltin-strcpy">, Group; +def fbuiltin : Flag<["-"], "fbuiltin">, Group; +def fcaret_diagnostics : Flag<["-"], "fcaret-diagnostics">, Group; +def fcatch_undefined_behavior : Flag<["-"], "fcatch-undefined-behavior">, Flags<[CC1Option]>, Group, HelpText<"Generate runtime checks for undefined behavior.">; -def fclasspath_EQ : Joined<"-fclasspath=">, Group; -def fcolor_diagnostics : Flag<"-fcolor-diagnostics">, Group, Flags<[CC1Option]>, +def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group; +def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group, Flags<[CC1Option]>, HelpText<"Use colors in diagnostics">; -def fcommon : Flag<"-fcommon">, Group; -def fcompile_resource_EQ : Joined<"-fcompile-resource=">, Group; -def fconstant_cfstrings : Flag<"-fconstant-cfstrings">, Group; -def fconstant_string_class_EQ : Joined<"-fconstant-string-class=">, Group; -def fconstexpr_depth_EQ : Joined<"-fconstexpr-depth=">, Group; -def fconstexpr_backtrace_limit_EQ : Joined<"-fconstexpr-backtrace-limit=">, +def fcommon : Flag<["-"], "fcommon">, Group; +def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group; +def fconstant_cfstrings : Flag<["-"], "fconstant-cfstrings">, Group; +def fconstant_string_class_EQ : Joined<["-"], "fconstant-string-class=">, Group; +def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group; +def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group; -def fno_crash_diagnostics : Flag<"-fno-crash-diagnostics">, Group, Flags<[NoArgumentUnused]>; -def fcreate_profile : Flag<"-fcreate-profile">, Group; -def fcxx_exceptions: Flag<"-fcxx-exceptions">, Group, +def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group, Flags<[NoArgumentUnused]>; +def fcreate_profile : Flag<["-"], "fcreate-profile">, Group; +def fcxx_exceptions: Flag<["-"], "fcxx-exceptions">, Group, HelpText<"Enable C++ exceptions">, Flags<[CC1Option]>; -def fcxx_modules : Flag <"-fcxx-modules">, Group, Flags<[NoForward]>; -def fdebug_pass_arguments : Flag<"-fdebug-pass-arguments">, Group; -def fdebug_pass_structure : Flag<"-fdebug-pass-structure">, Group; -def fdiagnostics_fixit_info : Flag<"-fdiagnostics-fixit-info">, Group; -def fdiagnostics_parseable_fixits : Flag<"-fdiagnostics-parseable-fixits">, Group, +def fcxx_modules : Flag <["-"], "fcxx-modules">, Group, Flags<[NoForward]>; +def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group; +def fdebug_pass_structure : Flag<["-"], "fdebug-pass-structure">, Group; +def fdiagnostics_fixit_info : Flag<["-"], "fdiagnostics-fixit-info">, Group; +def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group, Flags<[CC1Option]>, HelpText<"Print fix-its in machine parseable form">; -def fdiagnostics_print_source_range_info : Flag<"-fdiagnostics-print-source-range-info">, +def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">, Group, Flags<[CC1Option]>, HelpText<"Print source range spans in numeric form">; -def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">, Group, +def fdiagnostics_show_option : Flag<["-"], "fdiagnostics-show-option">, Group, Flags<[CC1Option]>, HelpText<"Print option name with mappable diagnostics">; -def fdiagnostics_show_name : Flag<"-fdiagnostics-show-name">, Group, +def fdiagnostics_show_name : Flag<["-"], "fdiagnostics-show-name">, Group, Flags<[CC1Option]>, HelpText<"Print diagnostic name">; -def fdiagnostics_show_note_include_stack : Flag<"-fdiagnostics-show-note-include-stack">, +def fdiagnostics_show_note_include_stack : Flag<["-"], "fdiagnostics-show-note-include-stack">, Group, Flags<[CC1Option]>, HelpText<"Display include stacks for diagnostic notes">; -def fdiagnostics_format_EQ : Joined<"-fdiagnostics-format=">, Group; -def fdiagnostics_show_category_EQ : Joined<"-fdiagnostics-show-category=">, Group; -def fdiagnostics_show_template_tree : Flag<"-fdiagnostics-show-template-tree">, +def fdiagnostics_format_EQ : Joined<["-"], "fdiagnostics-format=">, Group; +def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group; +def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">, Group, Flags<[CC1Option]>, HelpText<"Print a template comparison tree for differing templates">; -def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">, Group, +def fdollars_in_identifiers : Flag<["-"], "fdollars-in-identifiers">, Group, HelpText<"Allow '$' in identifiers">, Flags<[CC1Option]>; -def fdwarf2_cfi_asm : Flag<"-fdwarf2-cfi-asm">, Group; -def fno_dwarf2_cfi_asm : Flag<"-fno-dwarf2-cfi-asm">, Group, Flags<[CC1Option]>; -def fdwarf_directory_asm : Flag<"-fdwarf-directory-asm">, Group; -def fno_dwarf_directory_asm : Flag<"-fno-dwarf-directory-asm">, Group, Flags<[CC1Option]>; -def felide_constructors : Flag<"-felide-constructors">, Group; -def fno_elide_type : Flag<"-fno-elide-type">, Group, +def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group; +def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group, Flags<[CC1Option]>; +def fdwarf_directory_asm : Flag<["-"], "fdwarf-directory-asm">, Group; +def fno_dwarf_directory_asm : Flag<["-"], "fno-dwarf-directory-asm">, Group, Flags<[CC1Option]>; +def felide_constructors : Flag<["-"], "felide-constructors">, Group; +def fno_elide_type : Flag<["-"], "fno-elide-type">, Group, Flags<[CC1Option]>, HelpText<"Do not elide types when printing diagnostics">; -def feliminate_unused_debug_symbols : Flag<"-feliminate-unused-debug-symbols">, Group; -def femit_all_decls : Flag<"-femit-all-decls">, Group, Flags<[CC1Option]>, +def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group; +def femit_all_decls : Flag<["-"], "femit-all-decls">, Group, Flags<[CC1Option]>, HelpText<"Emit all declarations, even if unused">; -def fencoding_EQ : Joined<"-fencoding=">, Group; -def ferror_limit_EQ : Joined<"-ferror-limit=">, Group; -def fexceptions : Flag<"-fexceptions">, Group, Flags<[CC1Option]>, +def fencoding_EQ : Joined<["-"], "fencoding=">, Group; +def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group; +def fexceptions : Flag<["-"], "fexceptions">, Group, Flags<[CC1Option]>, HelpText<"Enable support for exception handling">; -def fextdirs_EQ : Joined<"-fextdirs=">, Group; -def fhosted : Flag<"-fhosted">, Group; -def ffast_math : Flag<"-ffast-math">, Group, Flags<[CC1Option]>, +def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group; +def fhosted : Flag<["-"], "fhosted">, Group; +def ffast_math : Flag<["-"], "ffast-math">, Group, Flags<[CC1Option]>, HelpText<"Enable the *frontend*'s 'fast-math' mode. This has no effect on " "optimizations, but provides a preprocessor macro __FAST_MATH__ the " "same as GCC's -ffast-math flag.">; -def fno_fast_math : Flag<"-fno-fast-math">, Group; -def fmath_errno : Flag<"-fmath-errno">, Group, Flags<[CC1Option]>, +def fno_fast_math : Flag<["-"], "fno-fast-math">, Group; +def fmath_errno : Flag<["-"], "fmath-errno">, Group, Flags<[CC1Option]>, HelpText<"Require math functions to indicate errors by setting errno">; -def fno_math_errno : Flag<"-fno-math-errno">, Group; -def fsignaling_math : Flag<"-fsignaling-math">, Group; -def fno_signaling_math : Flag<"-fno-signaling-math">, Group; -def funsafe_math_optimizations : Flag<"-funsafe-math-optimizations">, +def fno_math_errno : Flag<["-"], "fno-math-errno">, Group; +def fsignaling_math : Flag<["-"], "fsignaling-math">, Group; +def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group; +def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">, Group; -def fno_unsafe_math_optimizations : Flag<"-fno-unsafe-math-optimizations">, +def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">, Group; -def fassociative_math : Flag<"-fassociative-math">, Group; -def fno_associative_math : Flag<"-fno-associative-math">, Group; -def freciprocal_math : Flag<"-freciprocal-math">, Group; -def fno_reciprocal_math : Flag<"-fno-reciprocal-math">, Group; -def ffinite_math_only : Flag<"-ffinite-math-only">, Group, Flags<[CC1Option]>; -def fno_finite_math_only : Flag<"-fno-finite-math-only">, Group; -def fsigned_zeros : Flag<"-fsigned-zeros">, Group; -def fno_signed_zeros : Flag<"-fno-signed-zeros">, Group; -def fhonor_nans : Flag<"-fhonor-nans">, Group; -def fno_honor_nans : Flag<"-fno-honor-nans">, Group; -def fhonor_infinities : Flag<"-fhonor-infinities">, Group; -def fno_honor_infinities : Flag<"-fno-honor-infinities">, Group; +def fassociative_math : Flag<["-"], "fassociative-math">, Group; +def fno_associative_math : Flag<["-"], "fno-associative-math">, Group; +def freciprocal_math : Flag<["-"], "freciprocal-math">, Group; +def fno_reciprocal_math : Flag<["-"], "fno-reciprocal-math">, Group; +def ffinite_math_only : Flag<["-"], "ffinite-math-only">, Group, Flags<[CC1Option]>; +def fno_finite_math_only : Flag<["-"], "fno-finite-math-only">, Group; +def fsigned_zeros : Flag<["-"], "fsigned-zeros">, Group; +def fno_signed_zeros : Flag<["-"], "fno-signed-zeros">, Group; +def fhonor_nans : Flag<["-"], "fhonor-nans">, Group; +def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Group; +def fhonor_infinities : Flag<["-"], "fhonor-infinities">, Group; +def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group; // Sic. This option was misspelled originally. -def fhonor_infinites : Flag<"-fhonor-infinites">, Alias; -def fno_honor_infinites : Flag<"-fno-honor-infinites">, Alias; -def ftrapping_math : Flag<"-ftrapping-math">, Group; -def fno_trapping_math : Flag<"-fno-trapping-math">, Group; -def ffp_contract : Joined<"-ffp-contract=">, Group, +def fhonor_infinites : Flag<["-"], "fhonor-infinites">, Alias; +def fno_honor_infinites : Flag<["-"], "fno-honor-infinites">, Alias; +def ftrapping_math : Flag<["-"], "ftrapping-math">, Group; +def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group; +def ffp_contract : Joined<["-"], "ffp-contract=">, Group, Flags<[CC1Option]>, HelpText<"Form fused FP ops (e.g. FMAs): fast (everywhere)" " | on (according to FP_CONTRACT pragma, default) | off (never fuse)">; -def ffor_scope : Flag<"-ffor-scope">, Group; -def fno_for_scope : Flag<"-fno-for-scope">, Group; +def ffor_scope : Flag<["-"], "ffor-scope">, Group; +def fno_for_scope : Flag<["-"], "fno-for-scope">, Group; -def frewrite_includes : Flag<"-frewrite-includes">, Group, +def frewrite_includes : Flag<["-"], "frewrite-includes">, Group, Flags<[CC1Option]>; -def fno_rewrite_includes : Flag<"-fno-rewrite-includes">, Group; +def fno_rewrite_includes : Flag<["-"], "fno-rewrite-includes">, Group; -def ffreestanding : Flag<"-ffreestanding">, Group, Flags<[CC1Option]>, +def ffreestanding : Flag<["-"], "ffreestanding">, Group, Flags<[CC1Option]>, HelpText<"Assert that the compilation takes place in a freestanding environment">; -def fgnu_keywords : Flag<"-fgnu-keywords">, Group, Flags<[CC1Option]>, +def fgnu_keywords : Flag<["-"], "fgnu-keywords">, Group, Flags<[CC1Option]>, HelpText<"Allow GNU-extension keywords regardless of language standard">; -def fgnu89_inline : Flag<"-fgnu89-inline">, Group, Flags<[CC1Option]>, +def fgnu89_inline : Flag<["-"], "fgnu89-inline">, Group, Flags<[CC1Option]>, HelpText<"Use the gnu89 inline semantics">; -def fno_gnu89_inline : Flag<"-fno-gnu89-inline">, Group; -def fgnu_runtime : Flag<"-fgnu-runtime">, Group, +def fno_gnu89_inline : Flag<["-"], "fno-gnu89-inline">, Group; +def fgnu_runtime : Flag<["-"], "fgnu-runtime">, Group, HelpText<"Generate output compatible with the standard GNU Objective-C runtime">; -def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">, Flags<[CC1Option]>; -def filelist : Separate<"-filelist">, Flags<[LinkerInput]>; -def findirect_virtual_calls : Flag<"-findirect-virtual-calls">, Alias; -def finline_functions : Flag<"-finline-functions">, Group; -def finline : Flag<"-finline">, Group; -def finstrument_functions : Flag<"-finstrument-functions">, Group, Flags<[CC1Option]>, +def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>; +def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>; +def findirect_virtual_calls : Flag<["-"], "findirect-virtual-calls">, Alias; +def finline_functions : Flag<["-"], "finline-functions">, Group; +def finline : Flag<["-"], "finline">, Group; +def finstrument_functions : Flag<["-"], "finstrument-functions">, Group, Flags<[CC1Option]>, HelpText<"Generate calls to instrument function entry and exit">; -def fkeep_inline_functions : Flag<"-fkeep-inline-functions">, Group; -def flat__namespace : Flag<"-flat_namespace">; -def flax_vector_conversions : Flag<"-flax-vector-conversions">, Group; -def flimit_debug_info : Flag<"-flimit-debug-info">, Group, Flags<[CC1Option]>, +def fkeep_inline_functions : Flag<["-"], "fkeep-inline-functions">, Group; +def flat__namespace : Flag<["-"], "flat_namespace">; +def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group; +def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Group, Flags<[CC1Option]>, HelpText<"Limit debug information produced to reduce size of debug binary">; -def flimited_precision_EQ : Joined<"-flimited-precision=">, Group; -def flto : Flag<"-flto">, Group; -def fno_lto : Flag<"-fno-lto">, Group; -def fmacro_backtrace_limit_EQ : Joined<"-fmacro-backtrace-limit=">, +def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group; +def flto : Flag<["-"], "flto">, Group; +def fno_lto : Flag<["-"], "fno-lto">, Group; +def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">, Group; -def fmerge_all_constants : Flag<"-fmerge-all-constants">, Group; -def fmessage_length_EQ : Joined<"-fmessage-length=">, Group; -def fms_extensions : Flag<"-fms-extensions">, Group, Flags<[CC1Option]>, +def fmerge_all_constants : Flag<["-"], "fmerge-all-constants">, Group; +def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group; +def fms_extensions : Flag<["-"], "fms-extensions">, Group, Flags<[CC1Option]>, HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">; -def fenable_experimental_ms_inline_asm : Flag<"-fenable-experimental-ms-inline-asm">, Group, Flags<[CC1Option]>, +def fenable_experimental_ms_inline_asm : Flag<["-"], "fenable-experimental-ms-inline-asm">, Group, Flags<[CC1Option]>, HelpText<"Enable support for Microsoft style inine assembly">; -def fms_compatibility : Flag<"-fms-compatibility">, Group, Flags<[CC1Option]>, +def fms_compatibility : Flag<["-"], "fms-compatibility">, Group, Flags<[CC1Option]>, HelpText<"Enable Microsoft compatibility mode">; -def fmsc_version : Joined<"-fmsc-version=">, Group, Flags<[CC1Option]>, +def fmsc_version : Joined<["-"], "fmsc-version=">, Group, Flags<[CC1Option]>, HelpText<"Version of the Microsoft C/C++ compiler to report in _MSC_VER (0 = don't define it (default))">; -def fdelayed_template_parsing : Flag<"-fdelayed-template-parsing">, Group, +def fdelayed_template_parsing : Flag<["-"], "fdelayed-template-parsing">, Group, HelpText<"Parse templated function definitions at the end of the " "translation unit ">, Flags<[CC1Option]>; -def fmodule_cache_path : Separate<"-fmodule-cache-path">, Group, +def fmodule_cache_path : Separate<["-"], "fmodule-cache-path">, Group, Flags<[NoForward,CC1Option]>, MetaVarName<"">, HelpText<"Specify the module cache path">; -def fmodules : Flag <"-fmodules">, Group, Flags<[NoForward,CC1Option]>, +def fmodules : Flag <["-"], "fmodules">, Group, Flags<[NoForward,CC1Option]>, HelpText<"Enable the 'modules' language feature">; -def fretain_comments_from_system_headers : Flag<"-fretain-comments-from-system-headers">, Group, Flags<[CC1Option]>; - -def fmudflapth : Flag<"-fmudflapth">, Group; -def fmudflap : Flag<"-fmudflap">, Group; -def fnested_functions : Flag<"-fnested-functions">, Group; -def fnext_runtime : Flag<"-fnext-runtime">, Group; -def fno_access_control : Flag<"-fno-access-control">, Group, Flags<[CC1Option]>, +def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group, Flags<[CC1Option]>; + +def fmudflapth : Flag<["-"], "fmudflapth">, Group; +def fmudflap : Flag<["-"], "fmudflap">, Group; +def fnested_functions : Flag<["-"], "fnested-functions">, Group; +def fnext_runtime : Flag<["-"], "fnext-runtime">, Group; +def fno_access_control : Flag<["-"], "fno-access-control">, Group, Flags<[CC1Option]>, HelpText<"Disable C++ access control">; -def fno_apple_pragma_pack : Flag<"-fno-apple-pragma-pack">, Group; -def fno_asm : Flag<"-fno-asm">, Group; -def fno_asynchronous_unwind_tables : Flag<"-fno-asynchronous-unwind-tables">, Group; -def fno_assume_sane_operator_new : Flag<"-fno-assume-sane-operator-new">, Group, +def fno_apple_pragma_pack : Flag<["-"], "fno-apple-pragma-pack">, Group; +def fno_asm : Flag<["-"], "fno-asm">, Group; +def fno_asynchronous_unwind_tables : Flag<["-"], "fno-asynchronous-unwind-tables">, Group; +def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">, Group, HelpText<"Don't assume that C++'s global operator new can't alias any pointer">, Flags<[CC1Option]>; -def fno_blocks : Flag<"-fno-blocks">, Group; -def fno_borland_extensions : Flag<"-fno-borland-extensions">, Group; -def fno_builtin_strcat : Flag<"-fno-builtin-strcat">, Group; -def fno_builtin_strcpy : Flag<"-fno-builtin-strcpy">, Group; -def fno_builtin : Flag<"-fno-builtin">, Group, Flags<[CC1Option]>, +def fno_blocks : Flag<["-"], "fno-blocks">, Group; +def fno_borland_extensions : Flag<["-"], "fno-borland-extensions">, Group; +def fno_builtin_strcat : Flag<["-"], "fno-builtin-strcat">, Group; +def fno_builtin_strcpy : Flag<["-"], "fno-builtin-strcpy">, Group; +def fno_builtin : Flag<["-"], "fno-builtin">, Group, Flags<[CC1Option]>, HelpText<"Disable implicit builtin knowledge of functions">; -def fno_caret_diagnostics : Flag<"-fno-caret-diagnostics">, Group, +def fno_caret_diagnostics : Flag<["-"], "fno-caret-diagnostics">, Group, Flags<[CC1Option]>; -def fno_color_diagnostics : Flag<"-fno-color-diagnostics">, Group; -def fno_common : Flag<"-fno-common">, Group, Flags<[CC1Option]>, +def fno_color_diagnostics : Flag<["-"], "fno-color-diagnostics">, Group; +def fno_common : Flag<["-"], "fno-common">, Group, Flags<[CC1Option]>, HelpText<"Compile common globals like normal definitions">; -def fno_constant_cfstrings : Flag<"-fno-constant-cfstrings">, Group, +def fno_constant_cfstrings : Flag<["-"], "fno-constant-cfstrings">, Group, Flags<[CC1Option]>, HelpText<"Disable creation of CodeFoundation-type constant strings">; -def fno_cxx_exceptions: Flag<"-fno-cxx-exceptions">, Group; -def fno_cxx_modules : Flag <"-fno-cxx-modules">, Group, Flags<[NoForward]>; -def fno_diagnostics_fixit_info : Flag<"-fno-diagnostics-fixit-info">, Group, +def fno_cxx_exceptions: Flag<["-"], "fno-cxx-exceptions">, Group; +def fno_cxx_modules : Flag <["-"], "fno-cxx-modules">, Group, Flags<[NoForward]>; +def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group, Flags<[CC1Option]>, HelpText<"Do not include fixit information in diagnostics">; -def fno_diagnostics_show_name : Flag<"-fno-diagnostics-show-name">, Group; -def fno_diagnostics_show_option : Flag<"-fno-diagnostics-show-option">, Group; -def fno_diagnostics_show_note_include_stack : Flag<"-fno-diagnostics-show-note-include-stack">, +def fno_diagnostics_show_name : Flag<["-"], "fno-diagnostics-show-name">, Group; +def fno_diagnostics_show_option : Flag<["-"], "fno-diagnostics-show-option">, Group; +def fno_diagnostics_show_note_include_stack : Flag<["-"], "fno-diagnostics-show-note-include-stack">, Flags<[CC1Option]>, Group, HelpText<"Display include stacks for diagnostic notes">; -def fno_dollars_in_identifiers : Flag<"-fno-dollars-in-identifiers">, Group, +def fno_dollars_in_identifiers : Flag<["-"], "fno-dollars-in-identifiers">, Group, HelpText<"Disallow '$' in identifiers">, Flags<[CC1Option]>; -def fno_elide_constructors : Flag<"-fno-elide-constructors">, Group, +def fno_elide_constructors : Flag<["-"], "fno-elide-constructors">, Group, HelpText<"Disable C++ copy constructor elision">, Flags<[CC1Option]>; -def fno_eliminate_unused_debug_symbols : Flag<"-fno-eliminate-unused-debug-symbols">, Group; -def fno_exceptions : Flag<"-fno-exceptions">, Group; -def fno_gnu_keywords : Flag<"-fno-gnu-keywords">, Group, Flags<[CC1Option]>; -def fno_inline_functions : Flag<"-fno-inline-functions">, Group, Flags<[CC1Option]>; -def fno_inline : Flag<"-fno-inline">, Group, Flags<[CC1Option]>; -def fno_keep_inline_functions : Flag<"-fno-keep-inline-functions">, Group; -def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">, Group, +def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group; +def fno_exceptions : Flag<["-"], "fno-exceptions">, Group; +def fno_gnu_keywords : Flag<["-"], "fno-gnu-keywords">, Group, Flags<[CC1Option]>; +def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group, Flags<[CC1Option]>; +def fno_inline : Flag<["-"], "fno-inline">, Group, Flags<[CC1Option]>; +def fno_keep_inline_functions : Flag<["-"], "fno-keep-inline-functions">, Group; +def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group, HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">, Flags<[CC1Option]>; -def fno_limit_debug_info : Flag<"-fno-limit-debug-info">, Group, Flags<[CC1Option]>, +def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Group, Flags<[CC1Option]>, HelpText<"Do not limit debug information produced to reduce size of debug binary">; -def fno_merge_all_constants : Flag<"-fno-merge-all-constants">, Group, +def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group, Flags<[CC1Option]>, HelpText<"Disallow merging of constants.">; -def fno_modules : Flag <"-fno-modules">, Group, Flags<[NoForward]>; -def fno_ms_extensions : Flag<"-fno-ms-extensions">, Group; -def fno_ms_compatibility : Flag<"-fno-ms-compatibility">, Group; -def fno_delayed_template_parsing : Flag<"-fno-delayed-template-parsing">, Group; -def fno_objc_exceptions: Flag<"-fno-objc-exceptions">, Group; -def fno_objc_legacy_dispatch : Flag<"-fno-objc-legacy-dispatch">, Group; -def fno_omit_frame_pointer : Flag<"-fno-omit-frame-pointer">, Group; -def fno_operator_names : Flag<"-fno-operator-names">, Group, +def fno_modules : Flag <["-"], "fno-modules">, Group, Flags<[NoForward]>; +def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group; +def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group; +def fno_delayed_template_parsing : Flag<["-"], "fno-delayed-template-parsing">, Group; +def fno_objc_exceptions: Flag<["-"], "fno-objc-exceptions">, Group; +def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group; +def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group; +def fno_operator_names : Flag<["-"], "fno-operator-names">, Group, HelpText<"Do not treat C++ operator name keywords as synonyms for operators">, Flags<[CC1Option]>; -def fno_pascal_strings : Flag<"-fno-pascal-strings">, Group; -def fno_rtti : Flag<"-fno-rtti">, Group, Flags<[CC1Option]>, +def fno_pascal_strings : Flag<["-"], "fno-pascal-strings">, Group; +def fno_rtti : Flag<["-"], "fno-rtti">, Group, Flags<[CC1Option]>, HelpText<"Disable generation of rtti information">; -def fno_short_enums : Flag<"-fno-short-enums">, Group; -def fno_show_column : Flag<"-fno-show-column">, Group, Flags<[CC1Option]>, +def fno_short_enums : Flag<["-"], "fno-short-enums">, Group; +def fno_show_column : Flag<["-"], "fno-show-column">, Group, Flags<[CC1Option]>, HelpText<"Do not include column number on diagnostics">; -def fno_show_source_location : Flag<"-fno-show-source-location">, Group, +def fno_show_source_location : Flag<["-"], "fno-show-source-location">, Group, Flags<[CC1Option]>, HelpText<"Do not include source location information with diagnostics">; -def fno_spell_checking : Flag<"-fno-spell-checking">, Group, +def fno_spell_checking : Flag<["-"], "fno-spell-checking">, Group, Flags<[CC1Option]>, HelpText<"Disable spell-checking">; -def fno_stack_protector : Flag<"-fno-stack-protector">, Group; -def fno_strict_aliasing : Flag<"-fno-strict-aliasing">, Group; -def fno_strict_enums : Flag<"-fno-strict-enums">, Group; -def fno_strict_overflow : Flag<"-fno-strict-overflow">, Group; -def fno_threadsafe_statics : Flag<"-fno-threadsafe-statics">, Group, +def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group; +def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group; +def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group; +def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group; +def fno_threadsafe_statics : Flag<["-"], "fno-threadsafe-statics">, Group, Flags<[CC1Option]>, HelpText<"Do not emit code to make initialization of local statics thread safe">; -def fno_use_cxa_atexit : Flag<"-fno-use-cxa-atexit">, Group, Flags<[CC1Option]>, +def fno_use_cxa_atexit : Flag<["-"], "fno-use-cxa-atexit">, Group, Flags<[CC1Option]>, HelpText<"Don't use __cxa_atexit for calling destructors">; -def fno_unit_at_a_time : Flag<"-fno-unit-at-a-time">, Group; -def fno_unwind_tables : Flag<"-fno-unwind-tables">, Group; -def fno_verbose_asm : Flag<"-fno-verbose-asm">, Group; -def fno_working_directory : Flag<"-fno-working-directory">, Group; -def fno_wrapv : Flag<"-fno-wrapv">, Group; -def fno_zero_initialized_in_bss : Flag<"-fno-zero-initialized-in-bss">, Group; -def fobjc_arc : Flag<"-fobjc-arc">, Group, Flags<[CC1Option]>, +def fno_unit_at_a_time : Flag<["-"], "fno-unit-at-a-time">, Group; +def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group; +def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group; +def fno_working_directory : Flag<["-"], "fno-working-directory">, Group; +def fno_wrapv : Flag<["-"], "fno-wrapv">, Group; +def fno_zero_initialized_in_bss : Flag<["-"], "fno-zero-initialized-in-bss">, Group; +def fobjc_arc : Flag<["-"], "fobjc-arc">, Group, Flags<[CC1Option]>, HelpText<"Synthesize retain and release calls for Objective-C pointers">; -def fno_objc_arc : Flag<"-fno-objc-arc">, Group; -def fobjc_arc_exceptions : Flag<"-fobjc-arc-exceptions">, Group, Flags<[CC1Option]>, +def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group; +def fobjc_arc_exceptions : Flag<["-"], "fobjc-arc-exceptions">, Group, Flags<[CC1Option]>, HelpText<"Use EH-safe code when synthesizing retains and releases in -fobjc-arc">; -def fno_objc_arc_exceptions : Flag<"-fno-objc-arc-exceptions">, Group; -def fobjc_atdefs : Flag<"-fobjc-atdefs">, Group; -def fobjc_call_cxx_cdtors : Flag<"-fobjc-call-cxx-cdtors">, Group; -def fobjc_exceptions: Flag<"-fobjc-exceptions">, Group, +def fno_objc_arc_exceptions : Flag<["-"], "fno-objc-arc-exceptions">, Group; +def fobjc_atdefs : Flag<["-"], "fobjc-atdefs">, Group; +def fobjc_call_cxx_cdtors : Flag<["-"], "fobjc-call-cxx-cdtors">, Group; +def fobjc_exceptions: Flag<["-"], "fobjc-exceptions">, Group, HelpText<"Enable Objective-C exceptions">, Flags<[CC1Option]>; -def fobjc_gc_only : Flag<"-fobjc-gc-only">, Group, Flags<[CC1Option]>, +def fobjc_gc_only : Flag<["-"], "fobjc-gc-only">, Group, Flags<[CC1Option]>, HelpText<"Use GC exclusively for Objective-C related memory management">; -def fobjc_gc : Flag<"-fobjc-gc">, Group, Flags<[CC1Option]>, +def fobjc_gc : Flag<["-"], "fobjc-gc">, Group, Flags<[CC1Option]>, HelpText<"Enable Objective-C garbage collection">; -def fobjc_legacy_dispatch : Flag<"-fobjc-legacy-dispatch">, Group; -def fobjc_new_property : Flag<"-fobjc-new-property">, Group; -def fobjc_infer_related_result_type : Flag<"-fobjc-infer-related-result-type">, +def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group; +def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group; +def fobjc_infer_related_result_type : Flag<["-"], "fobjc-infer-related-result-type">, Group; -def fno_objc_infer_related_result_type : Flag< - "-fno-objc-infer-related-result-type">, Group, +def fno_objc_infer_related_result_type : Flag<["-"], + "fno-objc-infer-related-result-type">, Group, HelpText< "do not infer Objective-C related result type based on method family">, Flags<[CC1Option]>; -def fobjc_link_runtime: Flag<"-fobjc-link-runtime">, Group; +def fobjc_link_runtime: Flag<["-"], "fobjc-link-runtime">, Group; // Objective-C ABI options. -def fobjc_runtime_EQ : Joined<"-fobjc-runtime=">, Group, Flags<[CC1Option]>, +def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group, Flags<[CC1Option]>, HelpText<"Specify the target Objective-C runtime kind and version">; -def fobjc_abi_version_EQ : Joined<"-fobjc-abi-version=">, Group; -def fobjc_nonfragile_abi_version_EQ : Joined<"-fobjc-nonfragile-abi-version=">, Group; -def fobjc_nonfragile_abi : Flag<"-fobjc-nonfragile-abi">, Group; -def fno_objc_nonfragile_abi : Flag<"-fno-objc-nonfragile-abi">, Group; +def fobjc_abi_version_EQ : Joined<["-"], "fobjc-abi-version=">, Group; +def fobjc_nonfragile_abi_version_EQ : Joined<["-"], "fobjc-nonfragile-abi-version=">, Group; +def fobjc_nonfragile_abi : Flag<["-"], "fobjc-nonfragile-abi">, Group; +def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group; -def fobjc_sender_dependent_dispatch : Flag<"-fobjc-sender-dependent-dispatch">, Group; -def fobjc : Flag<"-fobjc">, Group; -def fomit_frame_pointer : Flag<"-fomit-frame-pointer">, Group; -def fopenmp : Flag<"-fopenmp">, Group; -def fno_optimize_sibling_calls : Flag<"-fno-optimize-sibling-calls">, Group; -def foptimize_sibling_calls : Flag<"-foptimize-sibling-calls">, Group; -def force__cpusubtype__ALL : Flag<"-force_cpusubtype_ALL">; -def force__flat__namespace : Flag<"-force_flat_namespace">; -def force__load : Separate<"-force_load">; -def foutput_class_dir_EQ : Joined<"-foutput-class-dir=">, Group; -def fpack_struct : Flag<"-fpack-struct">, Group; -def fno_pack_struct : Flag<"-fno-pack-struct">, Group; -def fpack_struct_EQ : Joined<"-fpack-struct=">, Group, Flags<[CC1Option]>, +def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group; +def fobjc : Flag<["-"], "fobjc">, Group; +def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group; +def fopenmp : Flag<["-"], "fopenmp">, Group; +def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group; +def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group; +def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">; +def force__flat__namespace : Flag<["-"], "force_flat_namespace">; +def force__load : Separate<["-"], "force_load">; +def foutput_class_dir_EQ : Joined<["-"], "foutput-class-dir=">, Group; +def fpack_struct : Flag<["-"], "fpack-struct">, Group; +def fno_pack_struct : Flag<["-"], "fno-pack-struct">, Group; +def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group, Flags<[CC1Option]>, HelpText<"Specify the default maximum struct packing alignment">; -def fpascal_strings : Flag<"-fpascal-strings">, Group, Flags<[CC1Option]>, +def fpascal_strings : Flag<["-"], "fpascal-strings">, Group, Flags<[CC1Option]>, HelpText<"Recognize and construct Pascal-style string literals">; -def fpch_preprocess : Flag<"-fpch-preprocess">, Group; -def fpic : Flag<"-fpic">, Group; -def fno_pic : Flag<"-fno-pic">, Group; -def fpie : Flag<"-fpie">, Group; -def fno_pie : Flag<"-fno-pie">, Group; -def fprofile_arcs : Flag<"-fprofile-arcs">, Group; -def fprofile_generate : Flag<"-fprofile-generate">, Group; -def framework : Separate<"-framework">, Flags<[LinkerInput]>; -def frandom_seed_EQ : Joined<"-frandom-seed=">, Group; -def frtti : Flag<"-frtti">, Group; -def fsched_interblock : Flag<"-fsched-interblock">, Group; -def fshort_enums : Flag<"-fshort-enums">, Group, Flags<[CC1Option]>, +def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group; +def fpic : Flag<["-"], "fpic">, Group; +def fno_pic : Flag<["-"], "fno-pic">, Group; +def fpie : Flag<["-"], "fpie">, Group; +def fno_pie : Flag<["-"], "fno-pie">, Group; +def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group; +def fprofile_generate : Flag<["-"], "fprofile-generate">, Group; +def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>; +def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group; +def frtti : Flag<["-"], "frtti">, Group; +def fsched_interblock : Flag<["-"], "fsched-interblock">, Group; +def fshort_enums : Flag<["-"], "fshort-enums">, Group, Flags<[CC1Option]>, HelpText<"Allocate to an enum type only as many bytes as it needs for the declared range of possible values">; -def freorder_blocks : Flag<"-freorder-blocks">, Group; -def fshort_wchar : Flag<"-fshort-wchar">, Group, Flags<[CC1Option]>, +def freorder_blocks : Flag<["-"], "freorder-blocks">, Group; +def fshort_wchar : Flag<["-"], "fshort-wchar">, Group, Flags<[CC1Option]>, HelpText<"Force wchar_t to be a short unsigned int">; -def fshow_overloads_EQ : Joined<"-fshow-overloads=">, Group, Flags<[CC1Option]>, +def fshow_overloads_EQ : Joined<["-"], "fshow-overloads=">, Group, Flags<[CC1Option]>, HelpText<"Which overload candidates to show when overload resolution fails: " "best|all; defaults to all">; -def fshow_column : Flag<"-fshow-column">, Group, Flags<[CC1Option]>; -def fshow_source_location : Flag<"-fshow-source-location">, Group; -def fspell_checking : Flag<"-fspell-checking">, Group; -def fsigned_bitfields : Flag<"-fsigned-bitfields">, Group; -def fsigned_char : Flag<"-fsigned-char">, Group; -def fstack_protector_all : Flag<"-fstack-protector-all">, Group; -def fstack_protector : Flag<"-fstack-protector">, Group; -def fstrict_aliasing : Flag<"-fstrict-aliasing">, Group; -def fstrict_enums : Flag<"-fstrict-enums">, Group, Flags<[CC1Option]>, +def fshow_column : Flag<["-"], "fshow-column">, Group, Flags<[CC1Option]>; +def fshow_source_location : Flag<["-"], "fshow-source-location">, Group; +def fspell_checking : Flag<["-"], "fspell-checking">, Group; +def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group; +def fsigned_char : Flag<["-"], "fsigned-char">, Group; +def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group; +def fstack_protector : Flag<["-"], "fstack-protector">, Group; +def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group; +def fstrict_enums : Flag<["-"], "fstrict-enums">, Group, Flags<[CC1Option]>, HelpText<"Enable optimizations based on the strict definition of an enum's " "value range.">; -def fstrict_overflow : Flag<"-fstrict-overflow">, Group; -def fsyntax_only : Flag<"-fsyntax-only">, Flags<[DriverOption,CC1Option]>, Group; -def ftabstop_EQ : Joined<"-ftabstop=">, Group; -def ftemplate_depth_EQ : Joined<"-ftemplate-depth=">, Group; -def ftemplate_depth_ : Joined<"-ftemplate-depth-">, Group; -def ftemplate_backtrace_limit_EQ : Joined<"-ftemplate-backtrace-limit=">, +def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group; +def fsyntax_only : Flag<["-"], "fsyntax-only">, Flags<[DriverOption,CC1Option]>, Group; +def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group; +def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group; +def ftemplate_depth_ : Joined<["-"], "ftemplate-depth-">, Group; +def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group; -def ftest_coverage : Flag<"-ftest-coverage">, Group; -def Wlarge_by_value_copy_def : Flag<"-Wlarge-by-value-copy">, +def ftest_coverage : Flag<["-"], "ftest-coverage">, Group; +def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">, HelpText<"Warn if a function definition returns or accepts an object larger " "in bytes that a given value">; -def Wlarge_by_value_copy_EQ : Joined<"-Wlarge-by-value-copy=">, Flags<[CC1Option]>; +def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">, Flags<[CC1Option]>; // Just silence warnings about -Wlarger-than, -Wframe-larger-than for now. -def Wlarger_than : Separate<"-Wlarger-than">, Group; -def Wlarger_than_EQ : Joined<"-Wlarger-than=">, Alias; -def Wlarger_than_ : Joined<"-Wlarger-than-">, Alias; -def Wframe_larger_than : Separate<"-Wframe-larger-than">, Group; -def Wframe_larger_than_EQ : Joined<"-Wframe-larger-than=">, Alias; +def Wlarger_than : Separate<["-"], "Wlarger-than">, Group; +def Wlarger_than_EQ : Joined<["-"], "Wlarger-than=">, Alias; +def Wlarger_than_ : Joined<["-"], "Wlarger-than-">, Alias; +def Wframe_larger_than : Separate<["-"], "Wframe-larger-than">, Group; +def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Alias; -def fterminated_vtables : Flag<"-fterminated-vtables">, Alias; -def fthreadsafe_statics : Flag<"-fthreadsafe-statics">, Group; -def ftime_report : Flag<"-ftime-report">, Group, Flags<[CC1Option]>; -def ftlsmodel_EQ : Joined<"-ftls-model=">, Group, Flags<[CC1Option]>; -def ftrapv : Flag<"-ftrapv">, Group, Flags<[CC1Option]>, +def fterminated_vtables : Flag<["-"], "fterminated-vtables">, Alias; +def fthreadsafe_statics : Flag<["-"], "fthreadsafe-statics">, Group; +def ftime_report : Flag<["-"], "ftime-report">, Group, Flags<[CC1Option]>; +def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group, Flags<[CC1Option]>; +def ftrapv : Flag<["-"], "ftrapv">, Group, Flags<[CC1Option]>, HelpText<"Trap on integer overflow">; -def ftrapv_handler_EQ : Joined<"-ftrapv-handler=">, Group, +def ftrapv_handler_EQ : Joined<["-"], "ftrapv-handler=">, Group, MetaVarName<"">, HelpText<"Specify the function to be called on overflow.">; -def ftrapv_handler : Separate<"-ftrapv-handler">, Group, Flags<[CC1Option]>; -def ftrap_function_EQ : Joined<"-ftrap-function=">, Group, Flags<[CC1Option]>, +def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group, Flags<[CC1Option]>; +def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group, Flags<[CC1Option]>, HelpText<"Issue call to specified function rather than a trap instruction">; -def funit_at_a_time : Flag<"-funit-at-a-time">, Group; -def funroll_loops : Flag<"-funroll-loops">, Group, +def funit_at_a_time : Flag<["-"], "funit-at-a-time">, Group; +def funroll_loops : Flag<["-"], "funroll-loops">, Group, HelpText<"Turn on loop unroller">, Flags<[CC1Option]>; -def funsigned_bitfields : Flag<"-funsigned-bitfields">, Group; -def funsigned_char : Flag<"-funsigned-char">, Group; -def funwind_tables : Flag<"-funwind-tables">, Group; -def fuse_cxa_atexit : Flag<"-fuse-cxa-atexit">, Group; -def fverbose_asm : Flag<"-fverbose-asm">, Group; -def fvisibility_EQ : Joined<"-fvisibility=">, Group; -def fvisibility_inlines_hidden : Flag<"-fvisibility-inlines-hidden">, Group, +def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group; +def funsigned_char : Flag<["-"], "funsigned-char">, Group; +def funwind_tables : Flag<["-"], "funwind-tables">, Group; +def fuse_cxa_atexit : Flag<["-"], "fuse-cxa-atexit">, Group; +def fverbose_asm : Flag<["-"], "fverbose-asm">, Group; +def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group; +def fvisibility_inlines_hidden : Flag<["-"], "fvisibility-inlines-hidden">, Group, HelpText<"Give inline C++ member functions default visibility by default">, Flags<[CC1Option]>; -def fwrapv : Flag<"-fwrapv">, Group, Flags<[CC1Option]>, +def fwrapv : Flag<["-"], "fwrapv">, Group, Flags<[CC1Option]>, HelpText<"Treat signed integer overflow as two's complement">; -def fwritable_strings : Flag<"-fwritable-strings">, Group, Flags<[CC1Option]>, +def fwritable_strings : Flag<["-"], "fwritable-strings">, Group, Flags<[CC1Option]>, HelpText<"Store string literals as writable data">; -def fzero_initialized_in_bss : Flag<"-fzero-initialized-in-bss">, Group; -def ffunction_sections: Flag <"-ffunction-sections">, Group, +def fzero_initialized_in_bss : Flag<["-"], "fzero-initialized-in-bss">, Group; +def ffunction_sections: Flag <["-"], "ffunction-sections">, Group, Flags<[CC1Option]>, HelpText<"Place each function in its own section (ELF Only)">; -def fdata_sections : Flag <"-fdata-sections">, Group, Flags<[CC1Option]>, +def fdata_sections : Flag <["-"], "fdata-sections">, Group, Flags<[CC1Option]>, HelpText<"Place each data in its own section (ELF Only)">; -def f : Joined<"-f">, Group; -def g_Flag : Flag<"-g">, Group, +def f : Joined<["-"], "f">, Group; +def g_Flag : Flag<["-"], "g">, Group, HelpText<"Generate source level debug information">, Flags<[CC1Option]>; -def gline_tables_only : Flag<"-gline-tables-only">, Group, +def gline_tables_only : Flag<["-"], "gline-tables-only">, Group, HelpText<"Emit debug line number tables only">, Flags<[CC1Option]>; -def g0 : Flag<"-g0">, Group; -def g1 : Flag<"-g1">, Group; -def g2 : Flag<"-g2">, Group; -def g3 : Flag<"-g3">, Group; -def ggdb : Flag<"-ggdb">, Group; -def ggdb0 : Flag<"-ggdb0">, Group; -def ggdb1 : Flag<"-ggdb1">, Group; -def ggdb2 : Flag<"-ggdb2">, Group; -def ggdb3 : Flag<"-ggdb3">, Group; -def gdwarf_2 : Flag<"-gdwarf-2">, Group; -def gdwarf_3 : Flag<"-gdwarf-3">, Group; -def gdwarf_4 : Flag<"-gdwarf-4">, Group; -def gfull : Flag<"-gfull">, Group; -def gused : Flag<"-gused">, Group; -def gstabs : Joined<"-gstabs">, Group, Flags<[Unsupported]>; -def gcoff : Joined<"-gcoff">, Group, Flags<[Unsupported]>; -def gxcoff : Joined<"-gxcoff">, Group, Flags<[Unsupported]>; -def gvms : Joined<"-gvms">, Group, Flags<[Unsupported]>; -def gtoggle : Flag<"-gtoggle">, Group, Flags<[Unsupported]>; -def grecord_gcc_switches : Flag<"-grecord-gcc-switches">, Group; -def gno_record_gcc_switches : Flag<"-gno-record-gcc-switches">, +def g0 : Flag<["-"], "g0">, Group; +def g1 : Flag<["-"], "g1">, Group; +def g2 : Flag<["-"], "g2">, Group; +def g3 : Flag<["-"], "g3">, Group; +def ggdb : Flag<["-"], "ggdb">, Group; +def ggdb0 : Flag<["-"], "ggdb0">, Group; +def ggdb1 : Flag<["-"], "ggdb1">, Group; +def ggdb2 : Flag<["-"], "ggdb2">, Group; +def ggdb3 : Flag<["-"], "ggdb3">, Group; +def gdwarf_2 : Flag<["-"], "gdwarf-2">, Group; +def gdwarf_3 : Flag<["-"], "gdwarf-3">, Group; +def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group; +def gfull : Flag<["-"], "gfull">, Group; +def gused : Flag<["-"], "gused">, Group; +def gstabs : Joined<["-"], "gstabs">, Group, Flags<[Unsupported]>; +def gcoff : Joined<["-"], "gcoff">, Group, Flags<[Unsupported]>; +def gxcoff : Joined<["-"], "gxcoff">, Group, Flags<[Unsupported]>; +def gvms : Joined<["-"], "gvms">, Group, Flags<[Unsupported]>; +def gtoggle : Flag<["-"], "gtoggle">, Group, Flags<[Unsupported]>; +def grecord_gcc_switches : Flag<["-"], "grecord-gcc-switches">, Group; +def gno_record_gcc_switches : Flag<["-"], "gno-record-gcc-switches">, Group; -def gstrict_dwarf : Flag<"-gstrict-dwarf">, Group; -def gno_strict_dwarf : Flag<"-gno-strict-dwarf">, Group; -def gcolumn_info : Flag<"-gcolumn-info">, Group; -def headerpad__max__install__names : Joined<"-headerpad_max_install_names">; -def help : Flag<"-help">, Flags<[CC1Option]>, +def gstrict_dwarf : Flag<["-"], "gstrict-dwarf">, Group; +def gno_strict_dwarf : Flag<["-"], "gno-strict-dwarf">, Group; +def gcolumn_info : Flag<["-"], "gcolumn-info">, Group; +def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">; +def help : Flag<["-", "--"], "help">, Flags<[CC1Option]>, HelpText<"Display available options">; -def index_header_map : Flag<"-index-header-map">, Flags<[CC1Option]>, +def index_header_map : Flag<["-"], "index-header-map">, Flags<[CC1Option]>, HelpText<"Make the next included directory (-I or -F) an indexer header map">; -def idirafter : JoinedOrSeparate<"-idirafter">, Group, Flags<[CC1Option]>, +def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group, Flags<[CC1Option]>, HelpText<"Add directory to AFTER include search path">; -def iframework : JoinedOrSeparate<"-iframework">, Group, Flags<[CC1Option]>, +def iframework : JoinedOrSeparate<["-"], "iframework">, Group, Flags<[CC1Option]>, HelpText<"Add directory to SYSTEM framework search path">; -def imacros : JoinedOrSeparate<"-imacros">, Group, Flags<[CC1Option]>, +def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group, Flags<[CC1Option]>, HelpText<"Include macros from file before parsing">, MetaVarName<"">; -def image__base : Separate<"-image_base">; -def include_ : JoinedOrSeparate<"-include">, Group, EnumName<"include">, +def image__base : Separate<["-"], "image_base">; +def include_ : JoinedOrSeparate<["-", "--"], "include">, Group, EnumName<"include">, MetaVarName<"">, HelpText<"Include file before parsing">, Flags<[CC1Option]>; -def include_pch : Separate<"-include-pch">, Group, Flags<[CC1Option]>, +def include_pch : Separate<["-"], "include-pch">, Group, Flags<[CC1Option]>, HelpText<"Include precompiled header file">, MetaVarName<"">; -def init : Separate<"-init">; -def install__name : Separate<"-install_name">; -def integrated_as : Flag<"-integrated-as">, Flags<[DriverOption]>; -def iprefix : JoinedOrSeparate<"-iprefix">, Group, Flags<[CC1Option]>, +def init : Separate<["-"], "init">; +def install__name : Separate<["-"], "install_name">; +def integrated_as : Flag<["-"], "integrated-as">, Flags<[DriverOption]>; +def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group, Flags<[CC1Option]>, HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"">; -def iquote : JoinedOrSeparate<"-iquote">, Group, Flags<[CC1Option]>, +def iquote : JoinedOrSeparate<["-"], "iquote">, Group, Flags<[CC1Option]>, HelpText<"Add directory to QUOTE include search path">, MetaVarName<"">; -def isysroot : JoinedOrSeparate<"-isysroot">, Group, Flags<[CC1Option]>, +def isysroot : JoinedOrSeparate<["-"], "isysroot">, Group, Flags<[CC1Option]>, HelpText<"Set the system root directory (usually /)">, MetaVarName<"">; -def isystem : JoinedOrSeparate<"-isystem">, Group, Flags<[CC1Option]>, +def isystem : JoinedOrSeparate<["-"], "isystem">, Group, Flags<[CC1Option]>, HelpText<"Add directory to SYSTEM include search path">, MetaVarName<"">; -def iwithprefixbefore : JoinedOrSeparate<"-iwithprefixbefore">, Group, +def iwithprefixbefore : JoinedOrSeparate<["-"], "iwithprefixbefore">, Group, HelpText<"Set directory to include search path with prefix">, MetaVarName<"">, Flags<[CC1Option]>; -def iwithprefix : JoinedOrSeparate<"-iwithprefix">, Group, Flags<[CC1Option]>, +def iwithprefix : JoinedOrSeparate<["-"], "iwithprefix">, Group, Flags<[CC1Option]>, HelpText<"Set directory to SYSTEM include search path with prefix">, MetaVarName<"">; -def iwithsysroot : JoinedOrSeparate<"-iwithsysroot">, Group, +def iwithsysroot : JoinedOrSeparate<["-"], "iwithsysroot">, Group, HelpText<"Add directory to SYSTEM include search path, " "absolute paths are relative to -isysroot">, MetaVarName<"">, Flags<[CC1Option]>; -def i : Joined<"-i">, Group; -def keep__private__externs : Flag<"-keep_private_externs">; -def l : JoinedOrSeparate<"-l">, Flags<[LinkerInput, RenderJoined]>; -def lazy__framework : Separate<"-lazy_framework">, Flags<[LinkerInput]>; -def lazy__library : Separate<"-lazy_library">, Flags<[LinkerInput]>; -def m32 : Flag<"-m32">, Group, Flags<[DriverOption]>; -def mqdsp6_compat : Flag<"-mqdsp6-compat">, Group, Flags<[DriverOption,CC1Option]>, +def i : Joined<["-"], "i">, Group; +def keep__private__externs : Flag<["-"], "keep_private_externs">; +def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>; +def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>; +def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>; +def m32 : Flag<["-"], "m32">, Group, Flags<[DriverOption]>; +def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group, Flags<[DriverOption,CC1Option]>, HelpText<"Enable hexagon-qdsp6 backward compatibility">; -def m3dnowa : Flag<"-m3dnowa">, Group; -def m3dnow : Flag<"-m3dnow">, Group; -def m64 : Flag<"-m64">, Group, Flags<[DriverOption]>; -def mabi_EQ : Joined<"-mabi=">, Group; -def march_EQ : Joined<"-march=">, Group; -def maltivec : Flag<"-maltivec">, Alias; -def mcmodel_EQ : Joined<"-mcmodel=">, Group; -def mconstant_cfstrings : Flag<"-mconstant-cfstrings">, Group; -def mcpu_EQ : Joined<"-mcpu=">, Group; -def mdynamic_no_pic : Joined<"-mdynamic-no-pic">, Group; -def mfix_and_continue : Flag<"-mfix-and-continue">, Group; -def mfloat_abi_EQ : Joined<"-mfloat-abi=">, Group; -def mfpmath_EQ : Joined<"-mfpmath=">, Group; -def mfpu_EQ : Joined<"-mfpu=">, Group; -def mglobal_merge : Flag<"-mglobal-merge">, Group; -def mhard_float : Flag<"-mhard-float">, Group; -def miphoneos_version_min_EQ : Joined<"-miphoneos-version-min=">, Group; -def mios_version_min_EQ : Joined<"-mios-version-min=">, Alias; -def mios_simulator_version_min_EQ : Joined<"-mios-simulator-version-min=">, Group; -def mkernel : Flag<"-mkernel">, Group; -def mlinker_version_EQ : Joined<"-mlinker-version=">, Flags<[NoForward]>; -def mllvm : Separate<"-mllvm">, Flags<[CC1Option]>, +def m3dnowa : Flag<["-"], "m3dnowa">, Group; +def m3dnow : Flag<["-"], "m3dnow">, Group; +def m64 : Flag<["-"], "m64">, Group, Flags<[DriverOption]>; +def mabi_EQ : Joined<["-"], "mabi=">, Group; +def march_EQ : Joined<["-"], "march=">, Group; +def maltivec : Flag<["-"], "maltivec">, Alias; +def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group; +def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group; +def mcpu_EQ : Joined<["-"], "mcpu=">, Group; +def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group; +def mfix_and_continue : Flag<["-"], "mfix-and-continue">, Group; +def mfloat_abi_EQ : Joined<["-"], "mfloat-abi=">, Group; +def mfpmath_EQ : Joined<["-"], "mfpmath=">, Group; +def mfpu_EQ : Joined<["-"], "mfpu=">, Group; +def mglobal_merge : Flag<["-"], "mglobal-merge">, Group; +def mhard_float : Flag<["-"], "mhard-float">, Group; +def miphoneos_version_min_EQ : Joined<["-"], "miphoneos-version-min=">, Group; +def mios_version_min_EQ : Joined<["-"], "mios-version-min=">, Alias; +def mios_simulator_version_min_EQ : Joined<["-"], "mios-simulator-version-min=">, Group; +def mkernel : Flag<["-"], "mkernel">, Group; +def mlinker_version_EQ : Joined<["-"], "mlinker-version=">, Flags<[NoForward]>; +def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option]>, HelpText<"Additional arguments to forward to LLVM's option processing">; -def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group; -def mms_bitfields : Flag<"-mms-bitfields">, Group, Flags<[CC1Option]>, +def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">, Group; +def mms_bitfields : Flag<["-"], "mms-bitfields">, Group, Flags<[CC1Option]>, HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard.">; -def mstackrealign : Flag<"-mstackrealign">, Group, Flags<[CC1Option]>, +def mstackrealign : Flag<["-"], "mstackrealign">, Group, Flags<[CC1Option]>, HelpText<"Force realign the stack at entry to every function.">; -def mstack_alignment : Joined<"-mstack-alignment=">, Group, Flags<[CC1Option]>, +def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group, Flags<[CC1Option]>, HelpText<"Set the stack alignment">; -def mmmx : Flag<"-mmmx">, Group; -def mno_3dnowa : Flag<"-mno-3dnowa">, Group; -def mno_3dnow : Flag<"-mno-3dnow">, Group; -def mno_constant_cfstrings : Flag<"-mno-constant-cfstrings">, Group; -def mno_global_merge : Flag<"-mno-global-merge">, Group, Flags<[CC1Option]>, +def mmmx : Flag<["-"], "mmmx">, Group; +def mno_3dnowa : Flag<["-"], "mno-3dnowa">, Group; +def mno_3dnow : Flag<["-"], "mno-3dnow">, Group; +def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group; +def mno_global_merge : Flag<["-"], "mno-global-merge">, Group, Flags<[CC1Option]>, HelpText<"Disable merging of globals">; -def mno_mmx : Flag<"-mno-mmx">, Group; -def mno_pascal_strings : Flag<"-mno-pascal-strings">, Group; -def mno_red_zone : Flag<"-mno-red-zone">, Group; -def mno_relax_all : Flag<"-mno-relax-all">, Group; -def mno_rtd: Flag<"-mno-rtd">, Group; -def mno_soft_float : Flag<"-mno-soft-float">, Group; -def mno_stackrealign : Flag<"-mno-stackrealign">, Group; -def mno_sse2 : Flag<"-mno-sse2">, Group; -def mno_sse3 : Flag<"-mno-sse3">, Group; -def mno_sse4a : Flag<"-mno-sse4a">, Group; -def mno_sse4 : Flag<"-mno-sse4">, Group; -def mno_sse4_1 : Flag<"-mno-sse4.1">, Group; -def mno_sse4_2 : Flag<"-mno-sse4.2">, Group; -def mno_sse : Flag<"-mno-sse">, Group; -def mno_ssse3 : Flag<"-mno-ssse3">, Group; -def mno_aes : Flag<"-mno-aes">, Group; -def mno_avx : Flag<"-mno-avx">, Group; -def mno_avx2 : Flag<"-mno-avx2">, Group; -def mno_pclmul : Flag<"-mno-pclmul">, Group; -def mno_lzcnt : Flag<"-mno-lzcnt">, Group; -def mno_rdrnd : Flag<"-mno-rdrnd">, Group; -def mno_bmi : Flag<"-mno-bmi">, Group; -def mno_bmi2 : Flag<"-mno-bmi2">, Group; -def mno_popcnt : Flag<"-mno-popcnt">, Group; -def mno_fma4 : Flag<"-mno-fma4">, Group; -def mno_fma : Flag<"-mno-fma">, Group; -def mno_xop : Flag<"-mno-xop">, Group; -def mno_f16c : Flag<"-mno-f16c">, Group; +def mno_mmx : Flag<["-"], "mno-mmx">, Group; +def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">, Group; +def mno_red_zone : Flag<["-"], "mno-red-zone">, Group; +def mno_relax_all : Flag<["-"], "mno-relax-all">, Group; +def mno_rtd: Flag<["-"], "mno-rtd">, Group; +def mno_soft_float : Flag<["-"], "mno-soft-float">, Group; +def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group; +def mno_sse2 : Flag<["-"], "mno-sse2">, Group; +def mno_sse3 : Flag<["-"], "mno-sse3">, Group; +def mno_sse4a : Flag<["-"], "mno-sse4a">, Group; +def mno_sse4 : Flag<["-"], "mno-sse4">, Group; +def mno_sse4_1 : Flag<["-"], "mno-sse4.1">, Group; +def mno_sse4_2 : Flag<["-"], "mno-sse4.2">, Group; +def mno_sse : Flag<["-"], "mno-sse">, Group; +def mno_ssse3 : Flag<["-"], "mno-ssse3">, Group; +def mno_aes : Flag<["-"], "mno-aes">, Group; +def mno_avx : Flag<["-"], "mno-avx">, Group; +def mno_avx2 : Flag<["-"], "mno-avx2">, Group; +def mno_pclmul : Flag<["-"], "mno-pclmul">, Group; +def mno_lzcnt : Flag<["-"], "mno-lzcnt">, Group; +def mno_rdrnd : Flag<["-"], "mno-rdrnd">, Group; +def mno_bmi : Flag<["-"], "mno-bmi">, Group; +def mno_bmi2 : Flag<["-"], "mno-bmi2">, Group; +def mno_popcnt : Flag<["-"], "mno-popcnt">, Group; +def mno_fma4 : Flag<["-"], "mno-fma4">, Group; +def mno_fma : Flag<["-"], "mno-fma">, Group; +def mno_xop : Flag<["-"], "mno-xop">, Group; +def mno_f16c : Flag<["-"], "mno-f16c">, Group; -def mno_thumb : Flag<"-mno-thumb">, Group; -def marm : Flag<"-marm">, Alias; +def mno_thumb : Flag<["-"], "mno-thumb">, Group; +def marm : Flag<["-"], "marm">, Alias; -def mno_warn_nonportable_cfstrings : Flag<"-mno-warn-nonportable-cfstrings">, Group; -def mno_omit_leaf_frame_pointer : Flag<"-mno-omit-leaf-frame-pointer">, Group; -def momit_leaf_frame_pointer : Flag<"-momit-leaf-frame-pointer">, Group, +def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group; +def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group; +def momit_leaf_frame_pointer : Flag<["-"], "momit-leaf-frame-pointer">, Group, HelpText<"Omit frame pointer setup for leaf functions.">, Flags<[CC1Option]>; -def mpascal_strings : Flag<"-mpascal-strings">, Group; -def mred_zone : Flag<"-mred-zone">, Group; -def mregparm_EQ : Joined<"-mregparm=">, Group; -def mrelax_all : Flag<"-mrelax-all">, Group, Flags<[CC1Option]>, +def mpascal_strings : Flag<["-"], "mpascal-strings">, Group; +def mred_zone : Flag<["-"], "mred-zone">, Group; +def mregparm_EQ : Joined<["-"], "mregparm=">, Group; +def mrelax_all : Flag<["-"], "mrelax-all">, Group, Flags<[CC1Option]>, HelpText<"(integrated-as) Relax all machine instructions">; -def mrtd : Flag<"-mrtd">, Group, Flags<[CC1Option]>, +def mrtd : Flag<["-"], "mrtd">, Group, Flags<[CC1Option]>, HelpText<"Make StdCall calling convention the default">; -def msmall_data_threshold_EQ : Joined <"-msmall-data-threshold=">, Group; -def msoft_float : Flag<"-msoft-float">, Group, Flags<[CC1Option]>, +def msmall_data_threshold_EQ : Joined <["-"], "msmall-data-threshold=">, Group; +def msoft_float : Flag<["-"], "msoft-float">, Group, Flags<[CC1Option]>, HelpText<"Use software floating point">; -def mno_implicit_float : Flag<"-mno-implicit-float">, Group, +def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group, HelpText<"Don't generate implicit floating point instructions">; -def msse2 : Flag<"-msse2">, Group; -def msse3 : Flag<"-msse3">, Group; -def msse4a : Flag<"-msse4a">, Group; -def msse4 : Flag<"-msse4">, Group; -def msse4_1 : Flag<"-msse4.1">, Group; -def msse4_2 : Flag<"-msse4.2">, Group; -def msse : Flag<"-msse">, Group; -def mssse3 : Flag<"-mssse3">, Group; -def maes : Flag<"-maes">, Group; -def mavx : Flag<"-mavx">, Group; -def mavx2 : Flag<"-mavx2">, Group; -def mpclmul : Flag<"-mpclmul">, Group; -def mlzcnt : Flag<"-mlzcnt">, Group; -def mrdrnd : Flag<"-mrdrnd">, Group; -def mbmi : Flag<"-mbmi">, Group; -def mbmi2 : Flag<"-mbmi2">, Group; -def mpopcnt : Flag<"-mpopcnt">, Group; -def mfma4 : Flag<"-mfma4">, Group; -def mfma : Flag<"-mfma">, Group; -def mxop : Flag<"-mxop">, Group; -def mf16c : Flag<"-mf16c">, Group; -def mips16 : Flag<"-mips16">, Group; -def mno_mips16 : Flag<"-mno-mips16">, Group; -def mdsp : Flag<"-mdsp">, Group; -def mno_dsp : Flag<"-mno-dsp">, Group; -def mdspr2 : Flag<"-mdspr2">, Group; -def mno_dspr2 : Flag<"-mno-dspr2">, Group; -def mips32 : Flag<"-mips32">, Group, +def msse2 : Flag<["-"], "msse2">, Group; +def msse3 : Flag<["-"], "msse3">, Group; +def msse4a : Flag<["-"], "msse4a">, Group; +def msse4 : Flag<["-"], "msse4">, Group; +def msse4_1 : Flag<["-"], "msse4.1">, Group; +def msse4_2 : Flag<["-"], "msse4.2">, Group; +def msse : Flag<["-"], "msse">, Group; +def mssse3 : Flag<["-"], "mssse3">, Group; +def maes : Flag<["-"], "maes">, Group; +def mavx : Flag<["-"], "mavx">, Group; +def mavx2 : Flag<["-"], "mavx2">, Group; +def mpclmul : Flag<["-"], "mpclmul">, Group; +def mlzcnt : Flag<["-"], "mlzcnt">, Group; +def mrdrnd : Flag<["-"], "mrdrnd">, Group; +def mbmi : Flag<["-"], "mbmi">, Group; +def mbmi2 : Flag<["-"], "mbmi2">, Group; +def mpopcnt : Flag<["-"], "mpopcnt">, Group; +def mfma4 : Flag<["-"], "mfma4">, Group; +def mfma : Flag<["-"], "mfma">, Group; +def mxop : Flag<["-"], "mxop">, Group; +def mf16c : Flag<["-"], "mf16c">, Group; +def mips16 : Flag<["-"], "mips16">, Group; +def mno_mips16 : Flag<["-"], "mno-mips16">, Group; +def mdsp : Flag<["-"], "mdsp">, Group; +def mno_dsp : Flag<["-"], "mno-dsp">, Group; +def mdspr2 : Flag<["-"], "mdspr2">, Group; +def mno_dspr2 : Flag<["-"], "mno-dspr2">, Group; +def mips32 : Flag<["-"], "mips32">, Group, HelpText<"Equivalent to -march=mips32">; -def mips32r2 : Flag<"-mips32r2">, Group, +def mips32r2 : Flag<["-"], "mips32r2">, Group, HelpText<"Equivalent to -march=mips32r2">; -def mips64 : Flag<"-mips64">, Group, +def mips64 : Flag<["-"], "mips64">, Group, HelpText<"Equivalent to -march=mips64">; -def mips64r2 : Flag<"-mips64r2">, Group, +def mips64r2 : Flag<["-"], "mips64r2">, Group, HelpText<"Equivalent to -march=mips64r2">; -def mthumb : Flag<"-mthumb">, Group; -def mtune_EQ : Joined<"-mtune=">, Group; -def multi__module : Flag<"-multi_module">; -def multiply__defined__unused : Separate<"-multiply_defined_unused">; -def multiply__defined : Separate<"-multiply_defined">; -def mwarn_nonportable_cfstrings : Flag<"-mwarn-nonportable-cfstrings">, Group; -def m_Separate : Separate<"-m">, Group; -def m_Joined : Joined<"-m">, Group; -def no_canonical_prefixes : Flag<"-no-canonical-prefixes">, Flags<[HelpHidden]>, +def mthumb : Flag<["-"], "mthumb">, Group; +def mtune_EQ : Joined<["-"], "mtune=">, Group; +def multi__module : Flag<["-"], "multi_module">; +def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">; +def multiply__defined : Separate<["-"], "multiply_defined">; +def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group; +def m_Separate : Separate<["-"], "m">, Group; +def m_Joined : Joined<["-"], "m">, Group; +def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden]>, HelpText<"Use relative instead of canonical paths">; -def no_cpp_precomp : Flag<"-no-cpp-precomp">, Group; -def no_integrated_as : Flag<"-no-integrated-as">, Flags<[DriverOption]>; -def no_integrated_cpp : Flag<"-no-integrated-cpp">, Flags<[DriverOption]>; -def no_pedantic : Flag<"-no-pedantic">, Group; -def no__dead__strip__inits__and__terms : Flag<"-no_dead_strip_inits_and_terms">; -def nobuiltininc : Flag<"-nobuiltininc">, Flags<[CC1Option]>, +def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group; +def no_integrated_as : Flag<["-"], "no-integrated-as">, Flags<[DriverOption]>; +def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[DriverOption]>; +def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group; +def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">; +def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option]>, HelpText<"Disable builtin #include directories">; -def nodefaultlibs : Flag<"-nodefaultlibs">; -def nofixprebinding : Flag<"-nofixprebinding">; -def nolibc : Flag<"-nolibc">; -def nomultidefs : Flag<"-nomultidefs">; -def noprebind : Flag<"-noprebind">; -def noseglinkedit : Flag<"-noseglinkedit">; -def nostartfiles : Flag<"-nostartfiles">; -def nostdinc : Flag<"-nostdinc">; -def nostdlibinc : Flag<"-nostdlibinc">; -def nostdincxx : Flag<"-nostdinc++">, Flags<[CC1Option]>, +def nodefaultlibs : Flag<["-"], "nodefaultlibs">; +def nofixprebinding : Flag<["-"], "nofixprebinding">; +def nolibc : Flag<["-"], "nolibc">; +def nomultidefs : Flag<["-"], "nomultidefs">; +def noprebind : Flag<["-"], "noprebind">; +def noseglinkedit : Flag<["-"], "noseglinkedit">; +def nostartfiles : Flag<["-"], "nostartfiles">; +def nostdinc : Flag<["-"], "nostdinc">; +def nostdlibinc : Flag<["-"], "nostdlibinc">; +def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, HelpText<"Disable standard #include directories for the C++ standard library">; -def nostdlib : Flag<"-nostdlib">; -def object : Flag<"-object">; -def o : JoinedOrSeparate<"-o">, Flags<[DriverOption, RenderAsInput, CC1Option]>, +def nostdlib : Flag<["-"], "nostdlib">; +def object : Flag<["-"], "object">; +def o : JoinedOrSeparate<["-"], "o">, Flags<[DriverOption, RenderAsInput, CC1Option]>, HelpText<"Write output to ">, MetaVarName<"">; -def pagezero__size : JoinedOrSeparate<"-pagezero_size">; -def pass_exit_codes : Flag<"-pass-exit-codes">, Flags<[Unsupported]>; -def pedantic_errors : Flag<"-pedantic-errors">, Group, Flags<[CC1Option]>; -def pedantic : Flag<"-pedantic">, Group, Flags<[CC1Option]>; -def pg : Flag<"-pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>; -def pipe : Flag<"-pipe">, +def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">; +def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>; +def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group, Flags<[CC1Option]>; +def pedantic : Flag<["-", "--"], "pedantic">, Group, Flags<[CC1Option]>; +def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>; +def pipe : Flag<["-", "--"], "pipe">, HelpText<"Use pipes between commands, when possible">; -def prebind__all__twolevel__modules : Flag<"-prebind_all_twolevel_modules">; -def prebind : Flag<"-prebind">; -def preload : Flag<"-preload">; -def print_file_name_EQ : Joined<"-print-file-name=">, +def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">; +def prebind : Flag<["-"], "prebind">; +def preload : Flag<["-"], "preload">; +def print_file_name_EQ : Joined<["-", "--"], "print-file-name=">, HelpText<"Print the full library path of ">, MetaVarName<"">; -def print_ivar_layout : Flag<"-print-ivar-layout">, Flags<[CC1Option]>, +def print_ivar_layout : Flag<["-"], "print-ivar-layout">, Flags<[CC1Option]>, HelpText<"Enable Objective-C Ivar layout bitmap print trace">; -def print_libgcc_file_name : Flag<"-print-libgcc-file-name">, +def print_libgcc_file_name : Flag<["-", "--"], "print-libgcc-file-name">, HelpText<"Print the library path for \"libgcc.a\"">; -def print_multi_directory : Flag<"-print-multi-directory">; -def print_multi_lib : Flag<"-print-multi-lib">; -def print_multi_os_directory : Flag<"-print-multi-os-directory">; -def print_prog_name_EQ : Joined<"-print-prog-name=">, +def print_multi_directory : Flag<["-", "--"], "print-multi-directory">; +def print_multi_lib : Flag<["-", "--"], "print-multi-lib">; +def print_multi_os_directory : Flag<["-", "--"], "print-multi-os-directory">; +def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">, HelpText<"Print the full program path of ">, MetaVarName<"">; -def print_search_dirs : Flag<"-print-search-dirs">, +def print_search_dirs : Flag<["-", "--"], "print-search-dirs">, HelpText<"Print the paths used for finding libraries and programs">; -def private__bundle : Flag<"-private_bundle">; -def pthreads : Flag<"-pthreads">; -def pthread : Flag<"-pthread">, Flags<[CC1Option]>, +def private__bundle : Flag<["-"], "private_bundle">; +def pthreads : Flag<["-"], "pthreads">; +def pthread : Flag<["-"], "pthread">, Flags<[CC1Option]>, HelpText<"Support POSIX threads in generated code">; -def p : Flag<"-p">; -def pie : Flag<"-pie">; -def read__only__relocs : Separate<"-read_only_relocs">; -def remap : Flag<"-remap">; -def rewrite_objc : Flag<"-rewrite-objc">, Flags<[DriverOption,CC1Option]>, +def p : Flag<["-"], "p">; +def pie : Flag<["-"], "pie">; +def read__only__relocs : Separate<["-"], "read_only_relocs">; +def remap : Flag<["-"], "remap">; +def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[DriverOption,CC1Option]>, HelpText<"Rewrite Objective-C source to C++">, Group; -def rewrite_legacy_objc : Flag<"-rewrite-legacy-objc">, Flags<[DriverOption]>, +def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">, Flags<[DriverOption]>, HelpText<"Rewrite Legacy Objective-C source to C++">; -def rdynamic : Flag<"-rdynamic">; -def rpath : Separate<"-rpath">, Flags<[LinkerInput]>; -def rtlib_EQ : Joined<"-rtlib=">; -def r : Flag<"-r">; -def save_temps : Flag<"-save-temps">, Flags<[DriverOption]>, +def rdynamic : Flag<["-"], "rdynamic">; +def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>; +def rtlib_EQ : Joined<["-", "--"], "rtlib=">; +def r : Flag<["-"], "r">; +def save_temps : Flag<["-", "--"], "save-temps">, Flags<[DriverOption]>, HelpText<"Save intermediate compilation results">; -def sectalign : MultiArg<"-sectalign", 3>; -def sectcreate : MultiArg<"-sectcreate", 3>; -def sectobjectsymbols : MultiArg<"-sectobjectsymbols", 2>; -def sectorder : MultiArg<"-sectorder", 3>; -def seg1addr : JoinedOrSeparate<"-seg1addr">; -def seg__addr__table__filename : Separate<"-seg_addr_table_filename">; -def seg__addr__table : Separate<"-seg_addr_table">; -def segaddr : MultiArg<"-segaddr", 2>; -def segcreate : MultiArg<"-segcreate", 3>; -def seglinkedit : Flag<"-seglinkedit">; -def segprot : MultiArg<"-segprot", 3>; -def segs__read__only__addr : Separate<"-segs_read_only_addr">; -def segs__read__write__addr : Separate<"-segs_read_write_addr">; -def segs__read__ : Joined<"-segs_read_">; -def shared_libgcc : Flag<"-shared-libgcc">; -def shared : Flag<"-shared">; -def single__module : Flag<"-single_module">; -def specs_EQ : Joined<"-specs=">; -def specs : Separate<"-specs">, Flags<[Unsupported]>; -def static_libgcc : Flag<"-static-libgcc">; -def static_libstdcxx : Flag<"-static-libstdc++">; -def static : Flag<"-static">, Flags<[NoArgumentUnused]>; -def std_default_EQ : Joined<"-std-default=">; -def std_EQ : Joined<"-std=">, Flags<[CC1Option]>, Group, +def sectalign : MultiArg<["-"], "sectalign", 3>; +def sectcreate : MultiArg<["-"], "sectcreate", 3>; +def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>; +def sectorder : MultiArg<["-"], "sectorder", 3>; +def seg1addr : JoinedOrSeparate<["-"], "seg1addr">; +def seg__addr__table__filename : Separate<["-"], "seg_addr_table_filename">; +def seg__addr__table : Separate<["-"], "seg_addr_table">; +def segaddr : MultiArg<["-"], "segaddr", 2>; +def segcreate : MultiArg<["-"], "segcreate", 3>; +def seglinkedit : Flag<["-"], "seglinkedit">; +def segprot : MultiArg<["-"], "segprot", 3>; +def segs__read__only__addr : Separate<["-"], "segs_read_only_addr">; +def segs__read__write__addr : Separate<["-"], "segs_read_write_addr">; +def segs__read__ : Joined<["-"], "segs_read_">; +def shared_libgcc : Flag<["-"], "shared-libgcc">; +def shared : Flag<["-", "--"], "shared">; +def single__module : Flag<["-"], "single_module">; +def specs_EQ : Joined<["-", "--"], "specs=">; +def specs : Separate<["-", "--"], "specs">, Flags<[Unsupported]>; +def static_libgcc : Flag<["-"], "static-libgcc">; +def static_libstdcxx : Flag<["-"], "static-libstdc++">; +def static : Flag<["-", "--"], "static">, Flags<[NoArgumentUnused]>; +def std_default_EQ : Joined<["-"], "std-default=">; +def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option]>, Group, HelpText<"Language standard to compile for">; -def stdlib_EQ : Joined<"-stdlib=">, Flags<[CC1Option]>, +def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>, HelpText<"C++ standard library to use">; -def sub__library : JoinedOrSeparate<"-sub_library">; -def sub__umbrella : JoinedOrSeparate<"-sub_umbrella">; -def s : Flag<"-s">; -def target : Separate<"-target">, Flags<[DriverOption]>, +def sub__library : JoinedOrSeparate<["-"], "sub_library">; +def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">; +def s : Flag<["-"], "s">; +def target : Separate<["-"], "target">, Flags<[DriverOption]>, HelpText<"Generate code for the given target">; -def gcc_toolchain : Separate<"-gcc-toolchain">, Flags<[DriverOption]>, +def gcc_toolchain : Separate<["-"], "gcc-toolchain">, Flags<[DriverOption]>, HelpText<"Use the gcc toolchain at the given directory">; // We should deprecate the use of -ccc-host-triple, and then remove. -def ccc_host_triple : Separate<"-ccc-host-triple">, Alias; -def time : Flag<"-time">, +def ccc_host_triple : Separate<["-"], "ccc-host-triple">, Alias; +def time : Flag<["-"], "time">, HelpText<"Time individual commands">; -def traditional_cpp : Flag<"-traditional-cpp">, Flags<[CC1Option]>, +def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>, HelpText<"Enable some traditional CPP emulation">; -def traditional : Flag<"-traditional">; -def trigraphs : Flag<"-trigraphs">, Flags<[CC1Option]>, +def traditional : Flag<["-", "--"], "traditional">; +def trigraphs : Flag<["-", "--"], "trigraphs">, Flags<[CC1Option]>, HelpText<"Process trigraph sequences">; -def twolevel__namespace__hints : Flag<"-twolevel_namespace_hints">; -def twolevel__namespace : Flag<"-twolevel_namespace">; -def t : Flag<"-t">; -def umbrella : Separate<"-umbrella">; -def undefined : JoinedOrSeparate<"-undefined">, Group; -def undef : Flag<"-undef">, Group, Flags<[CC1Option]>, +def twolevel__namespace__hints : Flag<["-"], "twolevel_namespace_hints">; +def twolevel__namespace : Flag<["-"], "twolevel_namespace">; +def t : Flag<["-"], "t">; +def umbrella : Separate<["-"], "umbrella">; +def undefined : JoinedOrSeparate<["-"], "undefined">, Group; +def undef : Flag<["-"], "undef">, Group, Flags<[CC1Option]>, HelpText<"undef all system defines">; -def unexported__symbols__list : Separate<"-unexported_symbols_list">; -def u : JoinedOrSeparate<"-u">, Group; -def use_gold_plugin : Flag<"-use-gold-plugin">; -def v : Flag<"-v">, Flags<[CC1Option]>, +def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">; +def u : JoinedOrSeparate<["-"], "u">, Group; +def use_gold_plugin : Flag<["-"], "use-gold-plugin">; +def v : Flag<["-"], "v">, Flags<[CC1Option]>, HelpText<"Show commands to run and use verbose output">; -def verify : Flag<"-verify">, Flags<[DriverOption,CC1Option]>, +def verify : Flag<["-"], "verify">, Flags<[DriverOption,CC1Option]>, HelpText<"Verify output using a verifier.">; -def weak_l : Joined<"-weak-l">, Flags<[LinkerInput]>; -def weak__framework : Separate<"-weak_framework">, Flags<[LinkerInput]>; -def weak__library : Separate<"-weak_library">, Flags<[LinkerInput]>; -def weak__reference__mismatches : Separate<"-weak_reference_mismatches">; -def whatsloaded : Flag<"-whatsloaded">; -def whyload : Flag<"-whyload">; -def w : Flag<"-w">, HelpText<"Suppress all warnings.">, Flags<[CC1Option]>; -def x : JoinedOrSeparate<"-x">, Flags<[DriverOption,CC1Option]>, +def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>; +def weak__framework : Separate<["-"], "weak_framework">, Flags<[LinkerInput]>; +def weak__library : Separate<["-"], "weak_library">, Flags<[LinkerInput]>; +def weak__reference__mismatches : Separate<["-"], "weak_reference_mismatches">; +def whatsloaded : Flag<["-"], "whatsloaded">; +def whyload : Flag<["-"], "whyload">; +def w : Flag<["-"], "w">, HelpText<"Suppress all warnings.">, Flags<[CC1Option]>; +def x : JoinedOrSeparate<["-"], "x">, Flags<[DriverOption,CC1Option]>, HelpText<"Treat subsequent input files as having type ">, MetaVarName<"">; -def y : Joined<"-y">; +def y : Joined<["-"], "y">; -def working_directory : JoinedOrSeparate<"-working-directory">, Flags<[CC1Option]>, +def working_directory : JoinedOrSeparate<["-"], "working-directory">, Flags<[CC1Option]>, HelpText<"Resolve file paths relative to the specified directory">; -def working_directory_EQ : Joined<"-working-directory=">, Flags<[CC1Option]>, +def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CC1Option]>, Alias; // Double dash options, which are usually an alias for one of the previous // options. -def _CLASSPATH_EQ : Joined<"--CLASSPATH=">, Alias; -def _CLASSPATH : Separate<"--CLASSPATH">, Alias; -def _all_warnings : Flag<"--all-warnings">, Alias; -def _analyze_auto : Flag<"--analyze-auto">, Flags<[DriverOption]>; -def _analyzer_no_default_checks : Flag<"--analyzer-no-default-checks">, Flags<[DriverOption]>; -def _analyzer_output : JoinedOrSeparate<"--analyzer-output">, Flags<[DriverOption]>; -def _analyze : Flag<"--analyze">, Flags<[DriverOption]>, +def _CLASSPATH_EQ : Joined<["--"], "CLASSPATH=">, Alias; +def _CLASSPATH : Separate<["--"], "CLASSPATH">, Alias; +def _all_warnings : Flag<["--"], "all-warnings">, Alias; +def _analyze_auto : Flag<["--"], "analyze-auto">, Flags<[DriverOption]>; +def _analyzer_no_default_checks : Flag<["--"], "analyzer-no-default-checks">, Flags<[DriverOption]>; +def _analyzer_output : JoinedOrSeparate<["--"], "analyzer-output">, Flags<[DriverOption]>; +def _analyze : Flag<["--"], "analyze">, Flags<[DriverOption]>, HelpText<"Run the static analyzer">; -def _ansi : Flag<"--ansi">, Alias; -def _assemble : Flag<"--assemble">, Alias; -def _assert_EQ : Joined<"--assert=">, Alias; -def _assert : Separate<"--assert">, Alias; -def _bootclasspath_EQ : Joined<"--bootclasspath=">, Alias; -def _bootclasspath : Separate<"--bootclasspath">, Alias; -def _classpath_EQ : Joined<"--classpath=">, Alias; -def _classpath : Separate<"--classpath">, Alias; -def _combine : Flag<"--combine">, Alias; -def _comments_in_macros : Flag<"--comments-in-macros">, Alias; -def _comments : Flag<"--comments">, Alias; -def _compile : Flag<"--compile">, Alias; -def _constant_cfstrings : Flag<"--constant-cfstrings">; -def _coverage : Flag<"--coverage">, Alias; -def _debug_EQ : Joined<"--debug=">, Alias; -def _debug : Flag<"--debug">, Alias; -def _define_macro_EQ : Joined<"--define-macro=">, Alias; -def _define_macro : Separate<"--define-macro">, Alias; -def _dependencies : Flag<"--dependencies">, Alias; -def _encoding_EQ : Joined<"--encoding=">, Alias; -def _encoding : Separate<"--encoding">, Alias; -def _entry : Flag<"--entry">, Alias; -def _extdirs_EQ : Joined<"--extdirs=">, Alias; -def _extdirs : Separate<"--extdirs">, Alias; -def _extra_warnings : Flag<"--extra-warnings">, Alias; -def _for_linker_EQ : Joined<"--for-linker=">, Alias; -def _for_linker : Separate<"--for-linker">, Alias; -def _force_link_EQ : Joined<"--force-link=">, Alias; -def _force_link : Separate<"--force-link">, Alias; -def _help_hidden : Flag<"--help-hidden">; -def _help : Flag<"--help">, Alias; -def _imacros_EQ : Joined<"--imacros=">, Alias; -def _imacros : Separate<"--imacros">, Alias; -def _include_barrier : Flag<"--include-barrier">, Alias; -def _include_directory_after_EQ : Joined<"--include-directory-after=">, Alias; -def _include_directory_after : Separate<"--include-directory-after">, Alias; -def _include_directory_EQ : Joined<"--include-directory=">, Alias; -def _include_directory : Separate<"--include-directory">, Alias; -def _include_prefix_EQ : Joined<"--include-prefix=">, Alias; -def _include_prefix : Separate<"--include-prefix">, Alias; -def _include_with_prefix_after_EQ : Joined<"--include-with-prefix-after=">, Alias; -def _include_with_prefix_after : Separate<"--include-with-prefix-after">, Alias; -def _include_with_prefix_before_EQ : Joined<"--include-with-prefix-before=">, Alias; -def _include_with_prefix_before : Separate<"--include-with-prefix-before">, Alias; -def _include_with_prefix_EQ : Joined<"--include-with-prefix=">, Alias; -def _include_with_prefix : Separate<"--include-with-prefix">, Alias; -def _include_EQ : Joined<"--include=">, Alias; -def _include : Separate<"--include">, Alias; -def _language_EQ : Joined<"--language=">, Alias; -def _language : Separate<"--language">, Alias; -def _library_directory_EQ : Joined<"--library-directory=">, Alias; -def _library_directory : Separate<"--library-directory">, Alias; -def _machine__EQ : Joined<"--machine-=">, Alias; -def _machine_ : Joined<"--machine-">, Alias; -def _machine_EQ : Joined<"--machine=">, Alias; -def _machine : Separate<"--machine">, Alias; -def _no_integrated_cpp : Flag<"--no-integrated-cpp">, Alias; -def _no_line_commands : Flag<"--no-line-commands">, Alias

; -def _relocatable_pch : Flag<"--relocatable-pch">, - HelpText<"Build a relocatable precompiled header">; -def _resource_EQ : Joined<"--resource=">, Alias; -def _resource : Separate<"--resource">, Alias; -def _rtlib_EQ : Joined<"--rtlib=">, Alias; -def _rtlib : Separate<"--rtlib">, Alias; -def _save_temps : Flag<"--save-temps">, Alias; -def _serialize_diags : Separate<"--serialize-diagnostics">, Flags<[DriverOption]>, +def _assemble : Flag<["--"], "assemble">, Alias; +def _assert_EQ : Joined<["--"], "assert=">, Alias; +def _assert : Separate<["--"], "assert">, Alias; +def _bootclasspath_EQ : Joined<["--"], "bootclasspath=">, Alias; +def _bootclasspath : Separate<["--"], "bootclasspath">, Alias; +def _classpath_EQ : Joined<["--"], "classpath=">, Alias; +def _classpath : Separate<["--"], "classpath">, Alias; +def _comments_in_macros : Flag<["--"], "comments-in-macros">, Alias; +def _comments : Flag<["--"], "comments">, Alias; +def _compile : Flag<["--"], "compile">, Alias; +def _constant_cfstrings : Flag<["--"], "constant-cfstrings">; +def _debug_EQ : Joined<["--"], "debug=">, Alias; +def _debug : Flag<["--"], "debug">, Alias; +def _define_macro_EQ : Joined<["--"], "define-macro=">, Alias; +def _define_macro : Separate<["--"], "define-macro">, Alias; +def _dependencies : Flag<["--"], "dependencies">, Alias; +def _encoding_EQ : Joined<["--"], "encoding=">, Alias; +def _encoding : Separate<["--"], "encoding">, Alias; +def _entry : Flag<["--"], "entry">, Alias; +def _extdirs_EQ : Joined<["--"], "extdirs=">, Alias; +def _extdirs : Separate<["--"], "extdirs">, Alias; +def _extra_warnings : Flag<["--"], "extra-warnings">, Alias; +def _for_linker_EQ : Joined<["--"], "for-linker=">, Alias; +def _for_linker : Separate<["--"], "for-linker">, Alias; +def _force_link_EQ : Joined<["--"], "force-link=">, Alias; +def _force_link : Separate<["--"], "force-link">, Alias; +def _help_hidden : Flag<["--"], "help-hidden">; +def _imacros_EQ : Joined<["--"], "imacros=">, Alias; +def _include_barrier : Flag<["--"], "include-barrier">, Alias; +def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias; +def _include_directory_after : Separate<["--"], "include-directory-after">, Alias; +def _include_directory_EQ : Joined<["--"], "include-directory=">, Alias; +def _include_directory : Separate<["--"], "include-directory">, Alias; +def _include_prefix_EQ : Joined<["--"], "include-prefix=">, Alias; +def _include_prefix : Separate<["--"], "include-prefix">, Alias; +def _include_with_prefix_after_EQ : Joined<["--"], "include-with-prefix-after=">, Alias; +def _include_with_prefix_after : Separate<["--"], "include-with-prefix-after">, Alias; +def _include_with_prefix_before_EQ : Joined<["--"], "include-with-prefix-before=">, Alias; +def _include_with_prefix_before : Separate<["--"], "include-with-prefix-before">, Alias; +def _include_with_prefix_EQ : Joined<["--"], "include-with-prefix=">, Alias; +def _include_with_prefix : Separate<["--"], "include-with-prefix">, Alias; +def _include_EQ : Joined<["--"], "include=">, Alias; +def _language_EQ : Joined<["--"], "language=">, Alias; +def _language : Separate<["--"], "language">, Alias; +def _library_directory_EQ : Joined<["--"], "library-directory=">, Alias; +def _library_directory : Separate<["--"], "library-directory">, Alias; +def _machine__EQ : Joined<["--"], "machine-=">, Alias; +def _machine_ : Joined<["--"], "machine-">, Alias; +def _machine_EQ : Joined<["--"], "machine=">, Alias; +def _machine : Separate<["--"], "machine">, Alias; +def _no_line_commands : Flag<["--"], "no-line-commands">, Alias

; +def _no_standard_includes : Flag<["--"], "no-standard-includes">, Alias; +def _no_standard_libraries : Flag<["--"], "no-standard-libraries">, Alias; +def _no_undefined : Flag<["--"], "no-undefined">, Flags<[LinkerInput]>; +def _no_warnings : Flag<["--"], "no-warnings">, Alias; +def _optimize_EQ : Joined<["--"], "optimize=">, Alias; +def _optimize : Flag<["--"], "optimize">, Alias; +def _output_class_directory_EQ : Joined<["--"], "output-class-directory=">, Alias; +def _output_class_directory : Separate<["--"], "output-class-directory">, Alias; +def _output_EQ : Joined<["--"], "output=">, Alias; +def _output : Separate<["--"], "output">, Alias; +def _param : Separate<["--"], "param">; +def _param_EQ : Joined<["--"], "param=">, Alias<_param>; +def _prefix_EQ : Joined<["--"], "prefix=">, Alias; +def _prefix : Separate<["--"], "prefix">, Alias; +def _preprocess : Flag<["--"], "preprocess">, Alias; +def _print_diagnostic_categories : Flag<["--"], "print-diagnostic-categories">; +def _print_file_name : Separate<["--"], "print-file-name">, Alias; +def _print_missing_file_dependencies : Flag<["--"], "print-missing-file-dependencies">, Alias; +def _print_prog_name : Separate<["--"], "print-prog-name">, Alias; +def _profile_blocks : Flag<["--"], "profile-blocks">, Alias; +def _profile : Flag<["--"], "profile">, Alias

; +def _resource_EQ : Joined<["--"], "resource=">, Alias; +def _resource : Separate<["--"], "resource">, Alias; +def _rtlib : Separate<["--"], "rtlib">, Alias; +def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">, Flags<[DriverOption]>, HelpText<"Serialize compiler diagnostics to a file">; -def _shared : Flag<"--shared">, Alias; -def _signed_char : Flag<"--signed-char">, Alias; -def _specs_EQ : Joined<"--specs=">, Alias; -def _specs : Separate<"--specs">, Alias; -def _static : Flag<"--static">, Alias; -def _std_EQ : Joined<"--std=">, Alias; -def _std : Separate<"--std">, Alias; -def _stdlib_EQ : Joined<"--stdlib=">, Alias; -def _stdlib : Separate<"--stdlib">, Alias; -def _sysroot_EQ : Joined<"--sysroot=">; -def _sysroot : Separate<"--sysroot">, Alias<_sysroot_EQ>; -def _target_help : Flag<"--target-help">; -def _trace_includes : Flag<"--trace-includes">, Alias; -def _traditional_cpp : Flag<"--traditional-cpp">, Alias; -def _traditional : Flag<"--traditional">, Alias; -def _trigraphs : Flag<"--trigraphs">, Alias; -def _undefine_macro_EQ : Joined<"--undefine-macro=">, Alias; -def _undefine_macro : Separate<"--undefine-macro">, Alias; -def _unsigned_char : Flag<"--unsigned-char">, Alias; -def _user_dependencies : Flag<"--user-dependencies">, Alias; -def _verbose : Flag<"--verbose">, Alias; -def _version : Flag<"--version">, Flags<[CC1Option]>; -def _warn__EQ : Joined<"--warn-=">, Alias; -def _warn_ : Joined<"--warn-">, Alias; -def _write_dependencies : Flag<"--write-dependencies">, Alias; -def _write_user_dependencies : Flag<"--write-user-dependencies">, Alias; -def _ : Joined<"--">, Flags<[Unsupported]>; -def mieee_rnd_near : Flag<"-mieee-rnd-near">, Group; -def serialize_diags : Separate<"-serialize-diagnostics">, Alias<_serialize_diags>; +// We give --version different semantics from -version. +def _version : Flag<["--"], "version">, Flags<[CC1Option]>; +def _signed_char : Flag<["--"], "signed-char">, Alias; +def _std : Separate<["--"], "std">, Alias; +def _stdlib : Separate<["--"], "stdlib">, Alias; +def _sysroot_EQ : Joined<["--"], "sysroot=">; +def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>; +def _target_help : Flag<["--"], "target-help">; +def _trace_includes : Flag<["--"], "trace-includes">, Alias; +def _undefine_macro_EQ : Joined<["--"], "undefine-macro=">, Alias; +def _undefine_macro : Separate<["--"], "undefine-macro">, Alias; +def _unsigned_char : Flag<["--"], "unsigned-char">, Alias; +def _user_dependencies : Flag<["--"], "user-dependencies">, Alias; +def _verbose : Flag<["--"], "verbose">, Alias; +def _warn__EQ : Joined<["--"], "warn-=">, Alias; +def _warn_ : Joined<["--"], "warn-">, Alias; +def _write_dependencies : Flag<["--"], "write-dependencies">, Alias; +def _write_user_dependencies : Flag<["--"], "write-user-dependencies">, Alias; +def _ : Joined<["--"], "">, Flags<[Unsupported]>; +def mieee_rnd_near : Flag<["-"], "mieee-rnd-near">, Group; // Special internal option to handle -Xlinker --no-demangle. -def Z_Xlinker__no_demangle : Flag<"-Z-Xlinker-no-demangle">, +def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">, Flags<[Unsupported, NoArgumentUnused]>; // Special internal option to allow forwarding arbitrary arguments to linker. -def Zlinker_input : Separate<"-Zlinker-input">, +def Zlinker_input : Separate<["-"], "Zlinker-input">, Flags<[Unsupported, NoArgumentUnused]>; // Reserved library options. -def Z_reserved_lib_stdcxx : Flag<"-Z-reserved-lib-stdc++">, +def Z_reserved_lib_stdcxx : Flag<["-"], "Z-reserved-lib-stdc++">, Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group; -def Z_reserved_lib_cckext : Flag<"-Z-reserved-lib-cckext">, +def Z_reserved_lib_cckext : Flag<["-"], "Z-reserved-lib-cckext">, Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group; include "CC1Options.td" diff --git a/lib/Driver/Arg.cpp b/lib/Driver/Arg.cpp index b156d7cf71..2431051e9d 100644 --- a/lib/Driver/Arg.cpp +++ b/lib/Driver/Arg.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "clang/Driver/Arg.h" +#include "clang/Basic/LLVM.h" #include "clang/Driver/ArgList.h" #include "clang/Driver/Option.h" #include "llvm/ADT/SmallString.h" @@ -15,22 +16,23 @@ #include "llvm/Support/raw_ostream.h" using namespace clang::driver; +using clang::StringRef; -Arg::Arg(const Option _Opt, unsigned _Index, const Arg *_BaseArg) - : Opt(_Opt), BaseArg(_BaseArg), Index(_Index), +Arg::Arg(const Option _Opt, StringRef S, unsigned _Index, const Arg *_BaseArg) + : Opt(_Opt), BaseArg(_BaseArg), Spelling(S), Index(_Index), Claimed(false), OwnsValues(false) { } -Arg::Arg(const Option _Opt, unsigned _Index, +Arg::Arg(const Option _Opt, StringRef S, unsigned _Index, const char *Value0, const Arg *_BaseArg) - : Opt(_Opt), BaseArg(_BaseArg), Index(_Index), + : Opt(_Opt), BaseArg(_BaseArg), Spelling(S), Index(_Index), Claimed(false), OwnsValues(false) { Values.push_back(Value0); } -Arg::Arg(const Option _Opt, unsigned _Index, +Arg::Arg(const Option _Opt, StringRef S, unsigned _Index, const char *Value0, const char *Value1, const Arg *_BaseArg) - : Opt(_Opt), BaseArg(_BaseArg), Index(_Index), + : Opt(_Opt), BaseArg(_BaseArg), Spelling(S), Index(_Index), Claimed(false), OwnsValues(false) { Values.push_back(Value0); Values.push_back(Value1); @@ -96,7 +98,7 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { case Option::RenderCommaJoinedStyle: { SmallString<256> Res; llvm::raw_svector_ostream OS(Res); - OS << getOption().getName(); + OS << getSpelling(); for (unsigned i = 0, e = getNumValues(); i != e; ++i) { if (i) OS << ','; OS << getValue(Args, i); @@ -107,13 +109,13 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { case Option::RenderJoinedStyle: Output.push_back(Args.GetOrMakeJoinedArgString( - getIndex(), getOption().getName(), getValue(Args, 0))); + getIndex(), getSpelling(), getValue(Args, 0))); for (unsigned i = 1, e = getNumValues(); i != e; ++i) Output.push_back(getValue(Args, i)); break; case Option::RenderSeparateStyle: - Output.push_back(getOption().getName().data()); + Output.push_back(Args.MakeArgString(getSpelling())); for (unsigned i = 0, e = getNumValues(); i != e; ++i) Output.push_back(getValue(Args, i)); break; diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp index 3b824f7c81..28d6b1e023 100644 --- a/lib/Driver/ArgList.cpp +++ b/lib/Driver/ArgList.cpp @@ -363,7 +363,9 @@ const char *DerivedArgList::MakeArgString(StringRef Str) const { } Arg *DerivedArgList::MakeFlagArg(const Arg *BaseArg, const Option Opt) const { - Arg *A = new Arg(Opt, BaseArgs.MakeIndex(Opt.getName()), BaseArg); + Arg *A = new Arg(Opt, ArgList::MakeArgString(Twine(Opt.getPrefix()) + + Twine(Opt.getName())), + BaseArgs.MakeIndex(Opt.getName()), BaseArg); SynthesizedArgs.push_back(A); return A; } @@ -371,7 +373,9 @@ Arg *DerivedArgList::MakeFlagArg(const Arg *BaseArg, const Option Opt) const { Arg *DerivedArgList::MakePositionalArg(const Arg *BaseArg, const Option Opt, StringRef Value) const { unsigned Index = BaseArgs.MakeIndex(Value); - Arg *A = new Arg(Opt, Index, BaseArgs.getArgString(Index), BaseArg); + Arg *A = new Arg(Opt, ArgList::MakeArgString(Twine(Opt.getPrefix()) + + Twine(Opt.getName())), + Index, BaseArgs.getArgString(Index), BaseArg); SynthesizedArgs.push_back(A); return A; } @@ -379,7 +383,9 @@ Arg *DerivedArgList::MakePositionalArg(const Arg *BaseArg, const Option Opt, Arg *DerivedArgList::MakeSeparateArg(const Arg *BaseArg, const Option Opt, StringRef Value) const { unsigned Index = BaseArgs.MakeIndex(Opt.getName(), Value); - Arg *A = new Arg(Opt, Index, BaseArgs.getArgString(Index + 1), BaseArg); + Arg *A = new Arg(Opt, ArgList::MakeArgString(Twine(Opt.getPrefix()) + + Twine(Opt.getName())), + Index, BaseArgs.getArgString(Index + 1), BaseArg); SynthesizedArgs.push_back(A); return A; } @@ -387,7 +393,8 @@ Arg *DerivedArgList::MakeSeparateArg(const Arg *BaseArg, const Option Opt, Arg *DerivedArgList::MakeJoinedArg(const Arg *BaseArg, const Option Opt, StringRef Value) const { unsigned Index = BaseArgs.MakeIndex(Opt.getName().str() + Value.str()); - Arg *A = new Arg(Opt, Index, + Arg *A = new Arg(Opt, ArgList::MakeArgString(Twine(Opt.getPrefix()) + + Twine(Opt.getName())), Index, BaseArgs.getArgString(Index) + Opt.getName().size(), BaseArg); SynthesizedArgs.push_back(A); diff --git a/lib/Driver/CC1AsOptions.cpp b/lib/Driver/CC1AsOptions.cpp index cc7c7a4fef..4f89b73a46 100644 --- a/lib/Driver/CC1AsOptions.cpp +++ b/lib/Driver/CC1AsOptions.cpp @@ -15,11 +15,19 @@ using namespace clang::driver; using namespace clang::driver::options; using namespace clang::driver::cc1asoptions; +#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; +#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ + HELPTEXT, METAVAR) +#include "clang/Driver/CC1AsOptions.inc" +#undef OPTION +#undef PREFIX + static const OptTable::Info CC1AsInfoTable[] = { -#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ +#define PREFIX(NAME, VALUE) +#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ HELPTEXT, METAVAR) \ - { NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, FLAGS, \ - OPT_##GROUP, OPT_##ALIAS }, + { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \ + FLAGS, OPT_##GROUP, OPT_##ALIAS }, #include "clang/Driver/CC1AsOptions.inc" }; diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 59cebf58c1..31492a7b6d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -608,7 +608,7 @@ void Driver::PrintOptions(const ArgList &Args) const { it != ie; ++it, ++i) { Arg *A = *it; llvm::errs() << "Option " << i << " - " - << "Name: \"" << A->getOption().getName() << "\", " + << "Name: \"" << A->getOption().getPrefixedName() << "\", " << "Values: {"; for (unsigned j = 0; j < A->getNumValues(); ++j) { if (j) diff --git a/lib/Driver/DriverOptions.cpp b/lib/Driver/DriverOptions.cpp index f9d36cfb5e..3925b8aa35 100644 --- a/lib/Driver/DriverOptions.cpp +++ b/lib/Driver/DriverOptions.cpp @@ -14,11 +14,19 @@ using namespace clang::driver; using namespace clang::driver::options; +#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; +#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ + HELPTEXT, METAVAR) +#include "clang/Driver/Options.inc" +#undef OPTION +#undef PREFIX + static const OptTable::Info InfoTable[] = { -#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ +#define PREFIX(NAME, VALUE) +#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ HELPTEXT, METAVAR) \ - { NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, FLAGS, \ - OPT_##GROUP, OPT_##ALIAS }, + { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \ + FLAGS, OPT_##GROUP, OPT_##ALIAS }, #include "clang/Driver/Options.inc" }; diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp index a1c5ecd8e6..db59298743 100644 --- a/lib/Driver/OptTable.cpp +++ b/lib/Driver/OptTable.cpp @@ -55,6 +55,13 @@ static inline bool operator<(const OptTable::Info &A, const OptTable::Info &B) { if (int N = StrCmpOptionName(A.Name, B.Name)) return N == -1; + for (const char * const *APre = A.Prefixes, + * const *BPre = B.Prefixes; + *APre != 0 && *BPre != 0; ++APre, ++BPre) { + if (int N = StrCmpOptionName(*APre, *BPre)) + return N == -1; + } + // Names are the same, check that classes are in order; exactly one // should be joined, and it should succeed the other. assert(((A.Kind == Option::JoinedClass) ^ (B.Kind == Option::JoinedClass)) && @@ -123,6 +130,26 @@ OptTable::OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos) } } #endif + + // Build prefixes. + for (unsigned i = FirstSearchableIndex+1, e = getNumOptions(); i != e; ++i) { + if (const char *const *P = getInfo(i).Prefixes) { + for (; *P != 0; ++P) { + PrefixesUnion.insert(*P); + } + } + } + + // Build prefix chars. + for (llvm::StringSet<>::const_iterator I = PrefixesUnion.begin(), + E = PrefixesUnion.end(); I != E; ++I) { + StringRef Prefix = I->getKey(); + for (StringRef::const_iterator C = Prefix.begin(), CE = Prefix.end(); + C != CE; ++C) + if (std::find(PrefixChars.begin(), PrefixChars.end(), *C) + == PrefixChars.end()) + PrefixChars.push_back(*C); + } } OptTable::~OptTable() { @@ -140,19 +167,41 @@ bool OptTable::isOptionHelpHidden(OptSpecifier id) const { return getInfo(id).Flags & options::HelpHidden; } +static bool isInput(const llvm::StringSet<> &Prefixes, StringRef Arg) { + if (Arg == "-") + return true; + for (llvm::StringSet<>::const_iterator I = Prefixes.begin(), + E = Prefixes.end(); I != E; ++I) + if (Arg.startswith(I->getKey())) + return false; + return true; +} + +/// \returns Matched size. 0 means no match. +static unsigned matchOption(const OptTable::Info *I, StringRef Str) { + for (const char * const *Pre = I->Prefixes; *Pre != 0; ++Pre) { + StringRef Prefix(*Pre); + if (Str.startswith(Prefix) && Str.substr(Prefix.size()).startswith(I->Name)) + return Prefix.size() + StringRef(I->Name).size(); + } + return 0; +} + Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index) const { unsigned Prev = Index; const char *Str = Args.getArgString(Index); - // Anything that doesn't start with '-' is an input, as is '-' itself. - if (Str[0] != '-' || Str[1] == '\0') - return new Arg(getOption(TheInputOptionID), Index++, Str); + // Anything that doesn't start with PrefixesUnion is an input, as is '-' + // itself. + if (isInput(PrefixesUnion, Str)) + return new Arg(getOption(TheInputOptionID), Str, Index++, Str); const Info *Start = OptionInfos + FirstSearchableIndex; const Info *End = OptionInfos + getNumOptions(); + StringRef Name = StringRef(Str).ltrim(PrefixChars); // Search for the first next option which could be a prefix. - Start = std::lower_bound(Start, End, Str); + Start = std::lower_bound(Start, End, Name.data()); // Options are stored in sorted order, with '\0' at the end of the // alphabet. Since the only options which can accept a string must @@ -162,17 +211,17 @@ Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index) const { // FIXME: This is searching much more than necessary, but I am // blanking on the simplest way to make it fast. We can solve this // problem when we move to TableGen. - StringRef StrRef(Str); for (; Start != End; ++Start) { + unsigned ArgSize = 0; // Scan for first option which is a proper prefix. for (; Start != End; ++Start) - if (StrRef.startswith(Start->Name)) + if ((ArgSize = matchOption(Start, Str))) break; if (Start == End) break; // See if this option matches. - if (Arg *A = getOption(Start - OptionInfos + 1).accept(Args, Index)) + if (Arg *A = Option(Start, this).accept(Args, Index, ArgSize)) return A; // Otherwise, see if this argument was missing values. @@ -180,7 +229,7 @@ Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index) const { return 0; } - return new Arg(getOption(TheUnknownOptionID), Index++, Str); + return new Arg(getOption(TheUnknownOptionID), Str, Index++, Str); } InputArgList *OptTable::ParseArgs(const char* const *ArgBegin, @@ -220,10 +269,11 @@ InputArgList *OptTable::ParseArgs(const char* const *ArgBegin, } static std::string getOptionHelpName(const OptTable &Opts, OptSpecifier Id) { - std::string Name = Opts.getOptionName(Id); + const Option O = Opts.getOption(Id); + std::string Name = O.getPrefixedName(); // Add metavar, if used. - switch (Opts.getOptionKind(Id)) { + switch (O.getKind()) { case Option::GroupClass: case Option::InputClass: case Option::UnknownClass: llvm_unreachable("Invalid option with help text."); diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp index e9440c5242..a22cb15e2e 100644 --- a/lib/Driver/Option.cpp +++ b/lib/Driver/Option.cpp @@ -48,6 +48,12 @@ void Option::dump() const { #undef P } + llvm::errs() << " Prefixes:["; + for (const char * const *Pre = Info->Prefixes; *Pre != 0; ++Pre) { + llvm::errs() << '"' << *Pre << (*(Pre + 1) == 0 ? "\"" : "\", "); + } + llvm::errs() << ']'; + llvm::errs() << " Name:\"" << getName() << '"'; const Option Group = getGroup(); @@ -84,21 +90,24 @@ bool Option::matches(OptSpecifier Opt) const { return false; } -Arg *Option::accept(const ArgList &Args, unsigned &Index) const { +Arg *Option::accept(const ArgList &Args, + unsigned &Index, + unsigned ArgSize) const { + StringRef Spelling(Args.getArgString(Index), ArgSize); switch (getKind()) { case FlagClass: - if (getName().size() != strlen(Args.getArgString(Index))) + if (ArgSize != strlen(Args.getArgString(Index))) return 0; - return new Arg(getUnaliasedOption(), Index++); + return new Arg(getUnaliasedOption(), Spelling, Index++); case JoinedClass: { - const char *Value = Args.getArgString(Index) + getName().size(); - return new Arg(getUnaliasedOption(), Index++, Value); + const char *Value = Args.getArgString(Index) + ArgSize; + return new Arg(getUnaliasedOption(), Spelling, Index++, Value); } case CommaJoinedClass: { // Always matches. - const char *Str = Args.getArgString(Index) + getName().size(); - Arg *A = new Arg(getUnaliasedOption(), Index++); + const char *Str = Args.getArgString(Index) + ArgSize; + Arg *A = new Arg(getUnaliasedOption(), Spelling, Index++); // Parse out the comma separated values. const char *Prev = Str; @@ -126,26 +135,26 @@ Arg *Option::accept(const ArgList &Args, unsigned &Index) const { case SeparateClass: // Matches iff this is an exact match. // FIXME: Avoid strlen. - if (getName().size() != strlen(Args.getArgString(Index))) + if (ArgSize != strlen(Args.getArgString(Index))) return 0; Index += 2; if (Index > Args.getNumInputArgStrings()) return 0; - return new Arg(getUnaliasedOption(), + return new Arg(getUnaliasedOption(), Spelling, Index - 2, Args.getArgString(Index - 1)); case MultiArgClass: { // Matches iff this is an exact match. // FIXME: Avoid strlen. - if (getName().size() != strlen(Args.getArgString(Index))) + if (ArgSize != strlen(Args.getArgString(Index))) return 0; Index += 1 + getNumArgs(); if (Index > Args.getNumInputArgStrings()) return 0; - Arg *A = new Arg(getUnaliasedOption(), Index - 1 - getNumArgs(), + Arg *A = new Arg(getUnaliasedOption(), Spelling, Index - 1 - getNumArgs(), Args.getArgString(Index - getNumArgs())); for (unsigned i = 1; i != getNumArgs(); ++i) A->getValues().push_back(Args.getArgString(Index - getNumArgs() + i)); @@ -154,9 +163,9 @@ Arg *Option::accept(const ArgList &Args, unsigned &Index) const { case JoinedOrSeparateClass: { // If this is not an exact match, it is a joined arg. // FIXME: Avoid strlen. - if (getName().size() != strlen(Args.getArgString(Index))) { - const char *Value = Args.getArgString(Index) + getName().size(); - return new Arg(*this, Index++, Value); + if (ArgSize != strlen(Args.getArgString(Index))) { + const char *Value = Args.getArgString(Index) + ArgSize; + return new Arg(*this, Spelling, Index++, Value); } // Otherwise it must be separate. @@ -164,7 +173,7 @@ Arg *Option::accept(const ArgList &Args, unsigned &Index) const { if (Index > Args.getNumInputArgStrings()) return 0; - return new Arg(getUnaliasedOption(), + return new Arg(getUnaliasedOption(), Spelling, Index - 2, Args.getArgString(Index - 1)); } case JoinedAndSeparateClass: @@ -173,9 +182,9 @@ Arg *Option::accept(const ArgList &Args, unsigned &Index) const { if (Index > Args.getNumInputArgStrings()) return 0; - return new Arg(getUnaliasedOption(), Index - 2, - Args.getArgString(Index-2)+getName().size(), - Args.getArgString(Index-1)); + return new Arg(getUnaliasedOption(), Spelling, Index - 2, + Args.getArgString(Index - 2) + ArgSize, + Args.getArgString(Index - 1)); default: llvm_unreachable("Invalid option kind!"); } diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 7848b488d3..54ec0cb1a9 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1175,8 +1175,8 @@ void Clang::AddX86TargetArgs(const ArgList &Args, (*it)->claim(); // Skip over "-m". - assert(Name.startswith("-m") && "Invalid feature name."); - Name = Name.substr(2); + assert(Name.startswith("m") && "Invalid feature name."); + Name = Name.substr(1); bool IsNegative = Name.startswith("no-"); if (IsNegative) @@ -2283,7 +2283,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fbounds-checking=1"); } - if (Args.hasArg(options::OPT__relocatable_pch)) + if (Args.hasArg(options::OPT_relocatable_pch)) CmdArgs.push_back("-relocatable-pch"); if (Arg *A = Args.getLastArg(options::OPT_fconstant_string_class_EQ)) { diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 4f0cfa8001..1de547d9b4 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1001,10 +1001,10 @@ static void addWarningArgs(ArgList &Args, std::vector &Warnings) { for (arg_iterator I = Args.filtered_begin(OPT_W_Group), E = Args.filtered_end(); I != E; ++I) { Arg *A = *I; - // If the argument is a pure flag, add its name (minus the "-W" at the beginning) + // If the argument is a pure flag, add its name (minus the "W" at the beginning) // to the warning list. Else, add its value (for the OPT_W case). if (A->getOption().getKind() == Option::FlagClass) { - Warnings.push_back(A->getOption().getName().substr(2)); + Warnings.push_back(A->getOption().getName().substr(1)); } else { for (unsigned Idx = 0, End = A->getNumValues(); Idx < End; ++Idx) { diff --git a/utils/TableGen/OptParserEmitter.cpp b/utils/TableGen/OptParserEmitter.cpp index 9b4bc29cf4..f095a28b4a 100644 --- a/utils/TableGen/OptParserEmitter.cpp +++ b/utils/TableGen/OptParserEmitter.cpp @@ -7,9 +7,15 @@ // //===----------------------------------------------------------------------===// +#include "llvm/TableGen/Error.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/TableGenBackend.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/Twine.h" + +#include + using namespace llvm; static int StrCmpOptionName(const char *A, const char *B) { @@ -47,10 +53,32 @@ static int CompareOptionRecords(const void *Av, const void *Bv) { B->getValueAsString("Name").c_str())) return Cmp; + if (!ASent) { + std::vector APrefixes = A->getValueAsListOfStrings("Prefixes"); + std::vector BPrefixes = B->getValueAsListOfStrings("Prefixes"); + + for (std::vector::const_iterator APre = APrefixes.begin(), + AEPre = APrefixes.end(), + BPre = BPrefixes.begin(), + BEPre = BPrefixes.end(); + APre != AEPre && + BPre != BEPre; + ++APre, ++BPre) { + if (int Cmp = StrCmpOptionName(APre->c_str(), BPre->c_str())) + return Cmp; + } + } + // Then by the kind precedence; int APrec = A->getValueAsDef("Kind")->getValueAsInt("Precedence"); int BPrec = B->getValueAsDef("Kind")->getValueAsInt("Precedence"); - assert(APrec != BPrec && "Options are equivalent!"); + if (APrec == BPrec && + A->getValueAsListOfStrings("Prefixes") == + B->getValueAsListOfStrings("Prefixes")) { + PrintError(A->getLoc(), Twine("Option is equivilent to")); + PrintError(B->getLoc(), Twine("Other defined here")); + throw "Eqivilant Options found."; + } return APrec < BPrec ? -1 : 1; } @@ -86,6 +114,48 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS, bool GenDefs) { array_pod_sort(Opts.begin(), Opts.end(), CompareOptionRecords); if (GenDefs) { + // Generate prefix groups. + typedef SmallVector, 2> PrefixKeyT; + typedef std::map PrefixesT; + PrefixesT Prefixes; + Prefixes.insert(std::make_pair(PrefixKeyT(), "prefix_0")); + unsigned CurPrefix = 0; + for (unsigned i = 0, e = Opts.size(); i != e; ++i) { + const Record &R = *Opts[i]; + std::vector prf = R.getValueAsListOfStrings("Prefixes"); + PrefixKeyT prfkey(prf.begin(), prf.end()); + unsigned NewPrefix = CurPrefix + 1; + if (Prefixes.insert(std::make_pair(prfkey, (Twine("prefix_") + + Twine(NewPrefix)).str())).second) + CurPrefix = NewPrefix; + } + + OS << "#ifndef PREFIX\n"; + OS << "#error \"Define PREFIX prior to including this file!\"\n"; + OS << "#endif\n\n"; + + // Dump prefixes. + OS << "/////////\n"; + OS << "// Prefixes\n\n"; + OS << "#define COMMA ,\n"; + for (PrefixesT::const_iterator I = Prefixes.begin(), E = Prefixes.end(); + I != E; ++I) { + OS << "PREFIX("; + + // Prefix name. + OS << I->second; + + // Prefix values. + OS << ", {"; + for (PrefixKeyT::const_iterator PI = I->first.begin(), + PE = I->first.end(); PI != PE; ++PI) { + OS << "\"" << *PI << "\" COMMA "; + } + OS << "0})\n"; + } + OS << "#undef COMMA\n"; + OS << "\n"; + OS << "#ifndef OPTION\n"; OS << "#error \"Define OPTION prior to including this file!\"\n"; OS << "#endif\n\n"; @@ -98,8 +168,11 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS, bool GenDefs) { // Start a single option entry. OS << "OPTION("; + // The option prefix; + OS << "0"; + // The option string. - OS << '"' << R.getValueAsString("Name") << '"'; + OS << ", \"" << R.getValueAsString("Name") << '"'; // The option identifier name. OS << ", "<< getOptionName(R); @@ -138,6 +211,10 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS, bool GenDefs) { // Start a single option entry. OS << "OPTION("; + // The option prefix; + std::vector prf = R.getValueAsListOfStrings("Prefixes"); + OS << Prefixes[PrefixKeyT(prf.begin(), prf.end())] << ", "; + // The option string. write_cstring(OS, R.getValueAsString("Name"));

; -def _no_pedantic : Flag<"--no-pedantic">, Alias; -def _no_standard_includes : Flag<"--no-standard-includes">, Alias; -def _no_standard_libraries : Flag<"--no-standard-libraries">, Alias; -def _no_undefined : Flag<"--no-undefined">, Flags<[LinkerInput]>; -def _no_warnings : Flag<"--no-warnings">, Alias; -def _optimize_EQ : Joined<"--optimize=">, Alias; -def _optimize : Flag<"--optimize">, Alias; -def _output_class_directory_EQ : Joined<"--output-class-directory=">, Alias; -def _output_class_directory : Separate<"--output-class-directory">, Alias; -def _output_EQ : Joined<"--output=">, Alias; -def _output : Separate<"--output">, Alias; -def _param : Separate<"--param">; -def _param_EQ : Joined<"--param=">, Alias<_param>; -def _pass_exit_codes : Flag<"--pass-exit-codes">, Alias; -def _pedantic_errors : Flag<"--pedantic-errors">, Alias; -def _pedantic : Flag<"--pedantic">, Alias; -def _pipe : Flag<"--pipe">, Alias; -def _prefix_EQ : Joined<"--prefix=">, Alias; -def _prefix : Separate<"--prefix">, Alias; -def _preprocess : Flag<"--preprocess">, Alias; -def _print_diagnostic_categories : Flag<"--print-diagnostic-categories">; -def _print_file_name_EQ : Joined<"--print-file-name=">, Alias; -def _print_file_name : Separate<"--print-file-name">, Alias; -def _print_libgcc_file_name : Flag<"--print-libgcc-file-name">, Alias; -def _print_missing_file_dependencies : Flag<"--print-missing-file-dependencies">, Alias; -def _print_multi_directory : Flag<"--print-multi-directory">, Alias; -def _print_multi_lib : Flag<"--print-multi-lib">, Alias; -def _print_multi_os_directory : Flag<"--print-multi-os-directory">, Alias; -def _print_prog_name_EQ : Joined<"--print-prog-name=">, Alias; -def _print_prog_name : Separate<"--print-prog-name">, Alias; -def _print_search_dirs : Flag<"--print-search-dirs">, Alias; -def _profile_blocks : Flag<"--profile-blocks">, Alias; -def _profile : Flag<"--profile">, Alias