diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2012-10-22 22:13:48 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2012-10-22 22:13:48 +0000 |
commit | c635710bcbb9598acd5a14647ba7ca28bee89a68 (patch) | |
tree | 978feeef3e87ac75ea630c0c301bc5c96a79b1af | |
parent | 6b8194e4d7ca980087a3a5e1addb74090be990ff (diff) |
[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
-rw-r--r-- | include/clang/Driver/Arg.h | 11 | ||||
-rw-r--r-- | include/clang/Driver/CC1AsOptions.h | 4 | ||||
-rw-r--r-- | include/clang/Driver/CC1AsOptions.td | 43 | ||||
-rw-r--r-- | include/clang/Driver/CC1Options.td | 414 | ||||
-rw-r--r-- | include/clang/Driver/OptParser.td | 28 | ||||
-rw-r--r-- | include/clang/Driver/OptTable.h | 9 | ||||
-rw-r--r-- | include/clang/Driver/Option.h | 20 | ||||
-rw-r--r-- | include/clang/Driver/Options.h | 4 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 1613 | ||||
-rw-r--r-- | lib/Driver/Arg.cpp | 20 | ||||
-rw-r--r-- | lib/Driver/ArgList.cpp | 15 | ||||
-rw-r--r-- | lib/Driver/CC1AsOptions.cpp | 14 | ||||
-rw-r--r-- | lib/Driver/Driver.cpp | 2 | ||||
-rw-r--r-- | lib/Driver/DriverOptions.cpp | 14 | ||||
-rw-r--r-- | lib/Driver/OptTable.cpp | 70 | ||||
-rw-r--r-- | lib/Driver/Option.cpp | 45 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 6 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | utils/TableGen/OptParserEmitter.cpp | 81 |
19 files changed, 1297 insertions, 1120 deletions
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<const char *, 2> 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<"<directory>">, +def I : JoinedOrSeparate<["-"], "I">, MetaVarName<"<directory>">, 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<"<path>">, HelpText<"Specify output file">; +def o : Separate<["-"], "o">, MetaVarName<"<path>">, + 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<help>; -def version : Flag<"-version">, +def version : Flag<["-", "--"], "version">, HelpText<"Print the assembler version">; -def _version : Flag<"--version">, Alias<version>; -def v : Flag<"-v">, Alias<version>; +def v : Flag<["-"], "v">, Alias<version>; // 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<triple>; +def triple_EQ : Joined<["-"], "triple=">, Alias<triple>; //===----------------------------------------------------------------------===// // 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<analyzer_store>; +def analyzer_store_EQ : Joined<["-"], "analyzer-store=">, Alias<analyzer_store>; -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<analyzer_constraints>; -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<analyzer_output>; -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<analyzer_purge>; +def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias<analyzer_purge>; -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<analyze_function>; -def analyzer_eagerly_assume : Flag<"-analyzer-eagerly-assume">, +def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias<analyze_function>; +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<analyzer_inline_max_stack_depth>; -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<analyzer_inline_max_function_size>; -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<analyzer_ipa>; +def analyzer_ipa_EQ : Joined<["-"], "analyzer-ipa=">, Alias<analyzer_ipa>; -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<analyzer_inlining_mode>; +def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>; -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<analyzer_checker>; -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<analyzer_disable_checker>; -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<coverage_file>; -def fuse_register_sized_bitfield_access: Flag<"-fuse-register-sized-bitfield-access">, +def coverage_file_EQ : Joined<["-"], "coverage-file=">, Alias<coverage_file>; +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<"<filename>">, 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<"<filename>">, 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<"<N>">, +def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">, HelpText<"Set the tab stop distance.">; -def ferror_limit : Separate<"-ferror-limit">, MetaVarName<"<N>">, +def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">, HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">; -def fmacro_backtrace_limit : Separate<"-fmacro-backtrace-limit">, MetaVarName<"<N>">, +def fmacro_backtrace_limit : Separate<["-"], "fmacro-backtrace-limit">, MetaVarName<"<N>">, 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<"<N>">, +def ftemplate_backtrace_limit : Separate<["-"], "ftemplate-backtrace-limit">, MetaVarName<"<N>">, 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<"<N>">, +def fconstexpr_backtrace_limit : Separate<["-"], "fconstexpr-backtrace-limit">, MetaVarName<"<N>">, HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">; -def fmessage_length : Separate<"-fmessage-length">, MetaVarName<"<N>">, +def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"<N>">, 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<"<ast file>">, 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<"<file>:<line>:<column>">, HelpText<"Dump code-completion information at a location">; -def remap_file : Separate<"-remap-file">, +def remap_file : Separate<["-"], "remap-file">, MetaVarName<"<from>;<to>">, HelpText<"Replace the contents of the <from> file with the contents of the <to> file">; -def code_completion_at_EQ : Joined<"-code-completion-at=">, +def code_completion_at_EQ : Joined<["-"], "code-completion-at=">, Alias<code_completion_at>; -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<"<dsopath>">, +def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">, HelpText<"Load the named plugin (dynamic shared object)">; -def plugin : Separate<"-plugin">, MetaVarName<"<name>">, +def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">, 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<"<name> <arg>">, HelpText<"Pass <arg> to plugin <name>">; -def add_plugin : Separate<"-add-plugin">, MetaVarName<"<name>">, +def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"<name>">, 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<"<dump_filter>">, 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">, |