diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-12 05:46:32 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-12 05:46:32 +0000 |
commit | 644eade617a4e2e665455accf18c455e8d025699 (patch) | |
tree | 2beaa23ed5e17966b2597e9afa93578ee89c99b0 | |
parent | 008dd35220d44b52051ac1b9b90f69bd321ca4c5 (diff) |
Driver: Add Option flags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66774 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Driver/Options.def | 262 | ||||
-rw-r--r-- | lib/Driver/OptTable.cpp | 7 | ||||
-rw-r--r-- | lib/Driver/Option.cpp | 1 |
3 files changed, 136 insertions, 134 deletions
diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def index ae912a9a4c..335fdc18b1 100644 --- a/include/clang/Driver/Options.def +++ b/include/clang/Driver/Options.def @@ -53,14 +53,14 @@ // i: The option should not render the name when rendered as an // input. // +// u: The option is unsupported, and the driver will reject command +// lines that use it. +// // S: The option should be rendered separately, even if joined (only // sensible on joined options). // // J: The option should be rendered joined, even if separate (only // sensible on single value separate options). -// -// U: The option is unsupported, and the driver will reject command -// lines that use it. // The seventh value is an arbitrary integer parameter; currently // this is only used for specifying the number of arguments for @@ -99,124 +99,124 @@ OPTION("<pedantic group>", pedantic_Group, Group, INVALID, INVALID, "", 0) // Options OPTION("-###", _HASH_HASH_HASH, Flag, INVALID, INVALID, "", 0) -OPTION("--CLASSPATH=", _CLASSPATH_EQ, Joined, INVALID, _CLASSPATH_EQ, "", 0) -OPTION("--CLASSPATH", _CLASSPATH, Separate, INVALID, _CLASSPATH, "", 0) -OPTION("--all-warnings", _all_warnings, Flag, INVALID, _all_warnings, "", 0) +OPTION("--CLASSPATH=", _CLASSPATH_EQ, Joined, INVALID, fclasspath_EQ, "", 0) +OPTION("--CLASSPATH", _CLASSPATH, Separate, INVALID, fclasspath_EQ, "J", 0) +OPTION("--all-warnings", _all_warnings, Flag, INVALID, Wall, "", 0) OPTION("--analyze", _analyze, Flag, INVALID, INVALID, "", 0) -OPTION("--ansi", _ansi, Flag, INVALID, _ansi, "", 0) -OPTION("--assemble", _assemble, Flag, INVALID, _assemble, "", 0) -OPTION("--assert=", _assert_EQ, Joined, INVALID, _assert_EQ, "", 0) -OPTION("--assert", _assert, Separate, INVALID, _assert, "", 0) -OPTION("--bootclasspath=", _bootclasspath_EQ, Joined, INVALID, _bootclasspath_EQ, "", 0) -OPTION("--bootclasspath", _bootclasspath, Separate, INVALID, _bootclasspath, "", 0) -OPTION("--classpath=", _classpath_EQ, Joined, INVALID, _classpath_EQ, "", 0) -OPTION("--classpath", _classpath, Separate, INVALID, _classpath, "", 0) -OPTION("--combine", _combine, Flag, INVALID, _combine, "", 0) -OPTION("--comments-in-macros", _comments_in_macros, Flag, INVALID, _comments_in_macros, "", 0) -OPTION("--comments", _comments, Flag, INVALID, _comments, "", 0) -OPTION("--compile", _compile, Flag, INVALID, _compile, "", 0) +OPTION("--ansi", _ansi, Flag, INVALID, ansi, "", 0) +OPTION("--assemble", _assemble, Flag, INVALID, S, "", 0) +OPTION("--assert=", _assert_EQ, Joined, INVALID, A, "S", 0) +OPTION("--assert", _assert, Separate, INVALID, A, "", 0) +OPTION("--bootclasspath=", _bootclasspath_EQ, Joined, INVALID, fbootclasspath_EQ, "", 0) +OPTION("--bootclasspath", _bootclasspath, Separate, INVALID, fbootclasspath_EQ, "J", 0) +OPTION("--classpath=", _classpath_EQ, Joined, INVALID, fclasspath_EQ, "", 0) +OPTION("--classpath", _classpath, Separate, INVALID, fclasspath_EQ, "J", 0) +OPTION("--combine", _combine, Flag, INVALID, combine, "", 0) +OPTION("--comments-in-macros", _comments_in_macros, Flag, INVALID, CC, "", 0) +OPTION("--comments", _comments, Flag, INVALID, C, "", 0) +OPTION("--compile", _compile, Flag, INVALID, c, "", 0) OPTION("--constant-cfstrings", _constant_cfstrings, Flag, INVALID, INVALID, "", 0) -OPTION("--coverage", _coverage, Flag, INVALID, _coverage, "", 0) -OPTION("--debug=", _debug_EQ, Joined, INVALID, _debug_EQ, "", 0) -OPTION("--debug", _debug, Flag, INVALID, _debug, "", 0) -OPTION("--define-macro=", _define_macro_EQ, Joined, INVALID, _define_macro_EQ, "", 0) -OPTION("--define-macro", _define_macro, Separate, INVALID, _define_macro, "", 0) -OPTION("--dependencies", _dependencies, Flag, INVALID, _dependencies, "", 0) -OPTION("--encoding=", _encoding_EQ, Joined, INVALID, _encoding_EQ, "", 0) -OPTION("--encoding", _encoding, Separate, INVALID, _encoding, "", 0) -OPTION("--entry", _entry, Flag, INVALID, _entry, "", 0) -OPTION("--extdirs=", _extdirs_EQ, Joined, INVALID, _extdirs_EQ, "", 0) -OPTION("--extdirs", _extdirs, Separate, INVALID, _extdirs, "", 0) -OPTION("--extra-warnings", _extra_warnings, Flag, INVALID, _extra_warnings, "", 0) -OPTION("--for-linker=", _for_linker_EQ, Joined, INVALID, _for_linker_EQ, "", 0) -OPTION("--for-linker", _for_linker, Separate, INVALID, _for_linker, "", 0) -OPTION("--force-link=", _force_link_EQ, Joined, INVALID, _force_link_EQ, "", 0) -OPTION("--force-link", _force_link, Separate, INVALID, _force_link, "", 0) +OPTION("--coverage", _coverage, Flag, INVALID, coverage, "", 0) +OPTION("--debug=", _debug_EQ, Joined, INVALID, g_Flag, "u", 0) +OPTION("--debug", _debug, Flag, INVALID, g_Flag, "u", 0) +OPTION("--define-macro=", _define_macro_EQ, Joined, INVALID, D, "", 0) +OPTION("--define-macro", _define_macro, Separate, INVALID, D, "J", 0) +OPTION("--dependencies", _dependencies, Flag, INVALID, M, "", 0) +OPTION("--encoding=", _encoding_EQ, Joined, INVALID, fencoding_EQ, "", 0) +OPTION("--encoding", _encoding, Separate, INVALID, fencoding_EQ, "J", 0) +OPTION("--entry", _entry, Flag, INVALID, e, "", 0) +OPTION("--extdirs=", _extdirs_EQ, Joined, INVALID, fextdirs_EQ, "", 0) +OPTION("--extdirs", _extdirs, Separate, INVALID, fextdirs_EQ, "J", 0) +OPTION("--extra-warnings", _extra_warnings, Flag, INVALID, W, "", 0) +OPTION("--for-linker=", _for_linker_EQ, Joined, INVALID, Xlinker, "liS", 0) +OPTION("--for-linker", _for_linker, Separate, INVALID, Xlinker, "li", 0) +OPTION("--force-link=", _force_link_EQ, Joined, INVALID, u, "S", 0) +OPTION("--force-link", _force_link, Separate, INVALID, u, "", 0) OPTION("--help", _help, Flag, INVALID, INVALID, "", 0) -OPTION("--imacros=", _imacros_EQ, Joined, INVALID, _imacros_EQ, "", 0) -OPTION("--imacros", _imacros, Separate, INVALID, _imacros, "", 0) -OPTION("--include-barrier", _include_barrier, Flag, INVALID, _include_barrier, "", 0) -OPTION("--include-directory-after=", _include_directory_after_EQ, Joined, INVALID, _include_directory_after_EQ, "", 0) -OPTION("--include-directory-after", _include_directory_after, Separate, INVALID, _include_directory_after, "", 0) -OPTION("--include-directory=", _include_directory_EQ, Joined, INVALID, _include_directory_EQ, "", 0) -OPTION("--include-directory", _include_directory, Separate, INVALID, _include_directory, "", 0) -OPTION("--include-prefix=", _include_prefix_EQ, Joined, INVALID, _include_prefix_EQ, "", 0) -OPTION("--include-prefix", _include_prefix, Separate, INVALID, _include_prefix, "", 0) -OPTION("--include-with-prefix-after=", _include_with_prefix_after_EQ, Joined, INVALID, _include_with_prefix_after_EQ, "", 0) -OPTION("--include-with-prefix-after", _include_with_prefix_after, Separate, INVALID, _include_with_prefix_after, "", 0) -OPTION("--include-with-prefix-before=", _include_with_prefix_before_EQ, Joined, INVALID, _include_with_prefix_before_EQ, "", 0) -OPTION("--include-with-prefix-before", _include_with_prefix_before, Separate, INVALID, _include_with_prefix_before, "", 0) -OPTION("--include-with-prefix=", _include_with_prefix_EQ, Joined, INVALID, _include_with_prefix_EQ, "", 0) -OPTION("--include-with-prefix", _include_with_prefix, Separate, INVALID, _include_with_prefix, "", 0) -OPTION("--include=", _include_EQ, Joined, INVALID, _include_EQ, "", 0) -OPTION("--include", _include, Separate, INVALID, _include, "", 0) -OPTION("--language=", _language_EQ, Joined, INVALID, _language_EQ, "", 0) -OPTION("--language", _language, Separate, INVALID, _language, "", 0) -OPTION("--library-directory=", _library_directory_EQ, Joined, INVALID, _library_directory_EQ, "", 0) -OPTION("--library-directory", _library_directory, Separate, INVALID, _library_directory, "", 0) -OPTION("--machine-=", _machine__EQ, Joined, INVALID, _machine__EQ, "", 0) -OPTION("--machine-", _machine_, Joined, INVALID, _machine_, "", 0) -OPTION("--machine=", _machine_EQ, Joined, INVALID, _machine_EQ, "", 0) -OPTION("--machine", _machine, Separate, INVALID, _machine, "", 0) -OPTION("--no-integrated-cpp", _no_integrated_cpp, Flag, INVALID, _no_integrated_cpp, "", 0) -OPTION("--no-line-commands", _no_line_commands, Flag, INVALID, _no_line_commands, "", 0) -OPTION("--no-standard-includes", _no_standard_includes, Flag, INVALID, _no_standard_includes, "", 0) -OPTION("--no-standard-libraries", _no_standard_libraries, Flag, INVALID, _no_standard_libraries, "", 0) -OPTION("--no-warnings", _no_warnings, Flag, INVALID, _no_warnings, "", 0) -OPTION("--optimize=", _optimize_EQ, Joined, INVALID, _optimize_EQ, "", 0) -OPTION("--optimize", _optimize, Flag, INVALID, _optimize, "", 0) -OPTION("--output-class-directory=", _output_class_directory_EQ, Joined, INVALID, _output_class_directory_EQ, "", 0) -OPTION("--output-class-directory", _output_class_directory, Separate, INVALID, _output_class_directory, "", 0) -OPTION("--output=", _output_EQ, Joined, INVALID, _output_EQ, "", 0) -OPTION("--output", _output, Separate, INVALID, _output, "", 0) -OPTION("--param=", _param_EQ, Joined, INVALID, _param_EQ, "", 0) +OPTION("--imacros=", _imacros_EQ, Joined, INVALID, imacros, "S", 0) +OPTION("--imacros", _imacros, Separate, INVALID, imacros, "", 0) +OPTION("--include-barrier", _include_barrier, Flag, INVALID, I_, "", 0) +OPTION("--include-directory-after=", _include_directory_after_EQ, Joined, INVALID, idirafter, "S", 0) +OPTION("--include-directory-after", _include_directory_after, Separate, INVALID, idirafter, "", 0) +OPTION("--include-directory=", _include_directory_EQ, Joined, INVALID, I, "", 0) +OPTION("--include-directory", _include_directory, Separate, INVALID, I, "J", 0) +OPTION("--include-prefix=", _include_prefix_EQ, Joined, INVALID, iprefix, "S", 0) +OPTION("--include-prefix", _include_prefix, Separate, INVALID, iprefix, "", 0) +OPTION("--include-with-prefix-after=", _include_with_prefix_after_EQ, Joined, INVALID, iwithprefix, "S", 0) +OPTION("--include-with-prefix-after", _include_with_prefix_after, Separate, INVALID, iwithprefix, "", 0) +OPTION("--include-with-prefix-before=", _include_with_prefix_before_EQ, Joined, INVALID, iwithprefixbefore, "S", 0) +OPTION("--include-with-prefix-before", _include_with_prefix_before, Separate, INVALID, iwithprefixbefore, "", 0) +OPTION("--include-with-prefix=", _include_with_prefix_EQ, Joined, INVALID, iwithprefix, "S", 0) +OPTION("--include-with-prefix", _include_with_prefix, Separate, INVALID, iwithprefix, "", 0) +OPTION("--include=", _include_EQ, Joined, INVALID, include, "S", 0) +OPTION("--include", _include, Separate, INVALID, include, "", 0) +OPTION("--language=", _language_EQ, Joined, INVALID, x, "S", 0) +OPTION("--language", _language, Separate, INVALID, x, "", 0) +OPTION("--library-directory=", _library_directory_EQ, Joined, INVALID, L, "S", 0) +OPTION("--library-directory", _library_directory, Separate, INVALID, L, "", 0) +OPTION("--machine-=", _machine__EQ, Joined, INVALID, m_Joined, "u", 0) +OPTION("--machine-", _machine_, Joined, INVALID, m_Joined, "u", 0) +OPTION("--machine=", _machine_EQ, Joined, INVALID, m_Joined, "", 0) +OPTION("--machine", _machine, Separate, INVALID, m_Joined, "J", 0) +OPTION("--no-integrated-cpp", _no_integrated_cpp, Flag, INVALID, no_integrated_cpp, "", 0) +OPTION("--no-line-commands", _no_line_commands, Flag, INVALID, P, "", 0) +OPTION("--no-standard-includes", _no_standard_includes, Flag, INVALID, nostdinc, "", 0) +OPTION("--no-standard-libraries", _no_standard_libraries, Flag, INVALID, nostdlib, "", 0) +OPTION("--no-warnings", _no_warnings, Flag, INVALID, w, "", 0) +OPTION("--optimize=", _optimize_EQ, Joined, INVALID, O, "u", 0) +OPTION("--optimize", _optimize, Flag, INVALID, O, "u", 0) +OPTION("--output-class-directory=", _output_class_directory_EQ, Joined, INVALID, foutput_class_dir_EQ, "", 0) +OPTION("--output-class-directory", _output_class_directory, Separate, INVALID, foutput_class_dir_EQ, "J", 0) +OPTION("--output=", _output_EQ, Joined, INVALID, o, "S", 0) +OPTION("--output", _output, Separate, INVALID, o, "", 0) +OPTION("--param=", _param_EQ, Joined, INVALID, _param, "S", 0) OPTION("--param", _param, Separate, INVALID, INVALID, "", 0) -OPTION("--pass-exit-codes", _pass_exit_codes, Flag, INVALID, _pass_exit_codes, "", 0) -OPTION("--pedantic-errors", _pedantic_errors, Flag, INVALID, _pedantic_errors, "", 0) -OPTION("--pedantic", _pedantic, Flag, INVALID, _pedantic, "", 0) -OPTION("--pipe", _pipe, Flag, INVALID, _pipe, "", 0) -OPTION("--prefix=", _prefix_EQ, Joined, INVALID, _prefix_EQ, "", 0) -OPTION("--prefix", _prefix, Separate, INVALID, _prefix, "", 0) -OPTION("--preprocess", _preprocess, Flag, INVALID, _preprocess, "", 0) -OPTION("--print-file-name=", _print_file_name_EQ, Joined, INVALID, _print_file_name_EQ, "", 0) -OPTION("--print-file-name", _print_file_name, Separate, INVALID, _print_file_name, "", 0) -OPTION("--print-libgcc-file-name", _print_libgcc_file_name, Flag, INVALID, _print_libgcc_file_name, "", 0) -OPTION("--print-missing-file-dependencies", _print_missing_file_dependencies, Flag, INVALID, _print_missing_file_dependencies, "", 0) -OPTION("--print-multi-directory", _print_multi_directory, Flag, INVALID, _print_multi_directory, "", 0) -OPTION("--print-multi-lib", _print_multi_lib, Flag, INVALID, _print_multi_lib, "", 0) -OPTION("--print-multi-os-directory", _print_multi_os_directory, Flag, INVALID, _print_multi_os_directory, "", 0) -OPTION("--print-prog-name=", _print_prog_name_EQ, Joined, INVALID, _print_prog_name_EQ, "", 0) -OPTION("--print-prog-name", _print_prog_name, Separate, INVALID, _print_prog_name, "", 0) -OPTION("--print-search-dirs", _print_search_dirs, Flag, INVALID, _print_search_dirs, "", 0) -OPTION("--profile-blocks", _profile_blocks, Flag, INVALID, _profile_blocks, "", 0) -OPTION("--profile", _profile, Flag, INVALID, _profile, "", 0) -OPTION("--resource=", _resource_EQ, Joined, INVALID, _resource_EQ, "", 0) -OPTION("--resource", _resource, Separate, INVALID, _resource, "", 0) -OPTION("--save-temps", _save_temps, Flag, INVALID, _save_temps, "", 0) -OPTION("--specs=", _specs_EQ, Joined, INVALID, _specs_EQ, "", 0) -OPTION("--specs", _specs, Separate, INVALID, _specs, "", 0) -OPTION("--static", _static, Flag, INVALID, _static, "", 0) -OPTION("--std=", _std_EQ, Joined, INVALID, _std_EQ, "", 0) -OPTION("--std", _std, Separate, INVALID, _std, "", 0) +OPTION("--pass-exit-codes", _pass_exit_codes, Flag, INVALID, pass_exit_codes, "", 0) +OPTION("--pedantic-errors", _pedantic_errors, Flag, INVALID, pedantic_errors, "", 0) +OPTION("--pedantic", _pedantic, Flag, INVALID, pedantic, "", 0) +OPTION("--pipe", _pipe, Flag, INVALID, pipe, "", 0) +OPTION("--prefix=", _prefix_EQ, Joined, INVALID, B, "S", 0) +OPTION("--prefix", _prefix, Separate, INVALID, B, "", 0) +OPTION("--preprocess", _preprocess, Flag, INVALID, E, "", 0) +OPTION("--print-file-name=", _print_file_name_EQ, Joined, INVALID, print_file_name_EQ, "", 0) +OPTION("--print-file-name", _print_file_name, Separate, INVALID, print_file_name_EQ, "", 0) +OPTION("--print-libgcc-file-name", _print_libgcc_file_name, Flag, INVALID, print_libgcc_file_name, "", 0) +OPTION("--print-missing-file-dependencies", _print_missing_file_dependencies, Flag, INVALID, MG, "", 0) +OPTION("--print-multi-directory", _print_multi_directory, Flag, INVALID, print_multi_directory, "", 0) +OPTION("--print-multi-lib", _print_multi_lib, Flag, INVALID, print_multi_lib, "", 0) +OPTION("--print-multi-os-directory", _print_multi_os_directory, Flag, INVALID, print_multi_os_directory, "", 0) +OPTION("--print-prog-name=", _print_prog_name_EQ, Joined, INVALID, print_prog_name_EQ, "", 0) +OPTION("--print-prog-name", _print_prog_name, Separate, INVALID, print_prog_name_EQ, "", 0) +OPTION("--print-search-dirs", _print_search_dirs, Flag, INVALID, print_search_dirs, "", 0) +OPTION("--profile-blocks", _profile_blocks, Flag, INVALID, a, "", 0) +OPTION("--profile", _profile, Flag, INVALID, p, "", 0) +OPTION("--resource=", _resource_EQ, Joined, INVALID, fcompile_resource_EQ, "", 0) +OPTION("--resource", _resource, Separate, INVALID, fcompile_resource_EQ, "J", 0) +OPTION("--save-temps", _save_temps, Flag, INVALID, save_temps, "", 0) +OPTION("--specs=", _specs_EQ, Joined, INVALID, specs_EQ, "u", 0) +OPTION("--specs", _specs, Separate, INVALID, specs_EQ, "uJ", 0) +OPTION("--static", _static, Flag, INVALID, static, "", 0) +OPTION("--std=", _std_EQ, Joined, INVALID, std_EQ, "", 0) +OPTION("--std", _std, Separate, INVALID, std_EQ, "J", 0) OPTION("--sysroot=", _sysroot_EQ, Joined, INVALID, INVALID, "", 0) -OPTION("--sysroot", _sysroot, Separate, INVALID, _sysroot, "", 0) +OPTION("--sysroot", _sysroot, Separate, INVALID, _sysroot_EQ, "J", 0) OPTION("--target-help", _target_help, Flag, INVALID, INVALID, "", 0) -OPTION("--trace-includes", _trace_includes, Flag, INVALID, _trace_includes, "", 0) -OPTION("--traditional-cpp", _traditional_cpp, Flag, INVALID, _traditional_cpp, "", 0) -OPTION("--traditional", _traditional, Flag, INVALID, _traditional, "", 0) -OPTION("--trigraphs", _trigraphs, Flag, INVALID, _trigraphs, "", 0) -OPTION("--undefine-macro=", _undefine_macro_EQ, Joined, INVALID, _undefine_macro_EQ, "", 0) -OPTION("--undefine-macro", _undefine_macro, Separate, INVALID, _undefine_macro, "", 0) -OPTION("--user-dependencies", _user_dependencies, Flag, INVALID, _user_dependencies, "", 0) -OPTION("--verbose", _verbose, Flag, INVALID, _verbose, "", 0) +OPTION("--trace-includes", _trace_includes, Flag, INVALID, H, "", 0) +OPTION("--traditional-cpp", _traditional_cpp, Flag, INVALID, traditional_cpp, "", 0) +OPTION("--traditional", _traditional, Flag, INVALID, traditional, "", 0) +OPTION("--trigraphs", _trigraphs, Flag, INVALID, trigraphs, "", 0) +OPTION("--undefine-macro=", _undefine_macro_EQ, Joined, INVALID, U, "", 0) +OPTION("--undefine-macro", _undefine_macro, Separate, INVALID, U, "J", 0) +OPTION("--user-dependencies", _user_dependencies, Flag, INVALID, MM, "", 0) +OPTION("--verbose", _verbose, Flag, INVALID, v, "", 0) OPTION("--version", _version, Flag, INVALID, INVALID, "", 0) -OPTION("--warn-=", _warn__EQ, Joined, INVALID, _warn__EQ, "", 0) -OPTION("--warn-", _warn_, Joined, INVALID, _warn_, "", 0) -OPTION("--write-dependencies", _write_dependencies, Flag, INVALID, _write_dependencies, "", 0) -OPTION("--write-user-dependencies", _write_user_dependencies, Flag, INVALID, _write_user_dependencies, "", 0) -OPTION("--", _, Joined, INVALID, _, "", 0) +OPTION("--warn-=", _warn__EQ, Joined, INVALID, W, "u", 0) +OPTION("--warn-", _warn_, Joined, INVALID, W, "u", 0) +OPTION("--write-dependencies", _write_dependencies, Flag, INVALID, MD, "", 0) +OPTION("--write-user-dependencies", _write_user_dependencies, Flag, INVALID, MMD, "", 0) +OPTION("--", _, Joined, INVALID, f, "u", 0) OPTION("-A", A, JoinedOrSeparate, INVALID, INVALID, "", 0) -OPTION("-B", B, JoinedOrSeparate, INVALID, INVALID, "", 0) +OPTION("-B", B, JoinedOrSeparate, INVALID, INVALID, "u", 0) OPTION("-CC", CC, Flag, INVALID, INVALID, "", 0) OPTION("-C", C, Flag, INVALID, INVALID, "", 0) OPTION("-D", D, JoinedOrSeparate, INVALID, INVALID, "", 0) @@ -249,12 +249,12 @@ OPTION("-Tdata", Tdata, JoinedOrSeparate, T_Group, INVALID, "", 0) OPTION("-Ttext", Ttext, JoinedOrSeparate, T_Group, INVALID, "", 0) OPTION("-T", T, JoinedOrSeparate, T_Group, INVALID, "", 0) OPTION("-U", U, JoinedOrSeparate, INVALID, INVALID, "", 0) -OPTION("-V", V, JoinedOrSeparate, INVALID, INVALID, "", 0) +OPTION("-V", V, JoinedOrSeparate, INVALID, INVALID, "u", 0) OPTION("-Wa,", Wa_COMMA, CommaJoined, INVALID, INVALID, "", 0) OPTION("-Wall", Wall, Flag, W_Group, INVALID, "", 0) OPTION("-Wfloat-equal", Wfloat_equal, Flag, clang_W_Group, INVALID, "", 0) OPTION("-Wimplicit-function-declaration", Wimplicit_function_declaration, Flag, clang_W_Group, INVALID, "", 0) -OPTION("-Wl,", Wl_COMMA, CommaJoined, INVALID, INVALID, "", 0) +OPTION("-Wl,", Wl_COMMA, CommaJoined, INVALID, INVALID, "l", 0) OPTION("-Wno-format-nonliteral", Wno_format_nonliteral, Flag, clang_W_Group, INVALID, "", 0) OPTION("-Wno-nonportable-cfstrings", Wno_nonportable_cfstrings, Joined, W_Group, INVALID, "", 0) OPTION("-Wno-strict-selector-match", Wno_strict_selector_match, Flag, clang_W_Group, INVALID, "", 0) @@ -268,7 +268,7 @@ OPTION("-Xanalyzer", Xanalyzer, Separate, INVALID, INVALID, "", 0) OPTION("-Xarch_", Xarch__, JoinedAndSeparate, INVALID, INVALID, "", 0) OPTION("-Xassembler", Xassembler, Separate, INVALID, INVALID, "", 0) OPTION("-Xclang", Xclang, Separate, INVALID, INVALID, "", 0) -OPTION("-Xlinker", Xlinker, Separate, INVALID, INVALID, "", 0) +OPTION("-Xlinker", Xlinker, Separate, INVALID, INVALID, "li", 0) OPTION("-Xpreprocessor", Xpreprocessor, Separate, INVALID, INVALID, "", 0) OPTION("-X", X_Flag, Flag, INVALID, INVALID, "", 0) OPTION("-X", X_Joined, Joined, INVALID, INVALID, "", 0) @@ -281,9 +281,9 @@ OPTION("-a", a, Joined, a_Group, INVALID, "", 0) OPTION("-bind_at_load", bind__at__load, Flag, INVALID, INVALID, "", 0) OPTION("-bundle_loader", bundle__loader, Separate, INVALID, INVALID, "", 0) OPTION("-bundle", bundle, Flag, INVALID, INVALID, "", 0) -OPTION("-b", b, JoinedOrSeparate, INVALID, INVALID, "", 0) +OPTION("-b", b, JoinedOrSeparate, INVALID, INVALID, "u", 0) OPTION("-client_name", client__name, JoinedOrSeparate, INVALID, INVALID, "", 0) -OPTION("-combine", combine, Flag, INVALID, INVALID, "", 0) +OPTION("-combine", combine, Flag, INVALID, INVALID, "u", 0) OPTION("-compatibility_version", compatibility__version, JoinedOrSeparate, INVALID, INVALID, "", 0) OPTION("-coverage", coverage, Flag, INVALID, INVALID, "", 0) OPTION("-cpp-precomp", cpp_precomp, Flag, INVALID, INVALID, "", 0) @@ -327,7 +327,7 @@ OPTION("-fexceptions", fexceptions, Flag, clang_f_Group, INVALID, "", 0) OPTION("-fextdirs=", fextdirs_EQ, Joined, f_Group, INVALID, "", 0) OPTION("-ffreestanding", ffreestanding, Flag, clang_f_Group, INVALID, "", 0) OPTION("-fgnu-runtime", fgnu_runtime, Flag, clang_f_Group, INVALID, "", 0) -OPTION("-filelist", filelist, Separate, INVALID, INVALID, "", 0) +OPTION("-filelist", filelist, Separate, INVALID, INVALID, "l", 0) OPTION("-findirect-virtual-calls", findirect_virtual_calls, Flag, f_Group, INVALID, "", 0) OPTION("-flat_namespace", flat__namespace, Flag, INVALID, INVALID, "", 0) OPTION("-flax-vector-conversions", flax_vector_conversions, Flag, clang_f_Group, INVALID, "", 0) @@ -362,7 +362,7 @@ OPTION("-fpic", fpic, Flag, f_Group, INVALID, "", 0) OPTION("-fpie", fpie, Flag, f_Group, INVALID, "", 0) OPTION("-fprofile-arcs", fprofile_arcs, Flag, f_Group, INVALID, "", 0) OPTION("-fprofile-generate", fprofile_generate, Flag, f_Group, INVALID, "", 0) -OPTION("-framework", framework, Separate, INVALID, INVALID, "", 0) +OPTION("-framework", framework, Separate, INVALID, INVALID, "l", 0) OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "", 0) OPTION("-ftemplate-depth-", ftemplate_depth_, Joined, f_Group, INVALID, "", 0) OPTION("-fterminated-vtables", fterminated_vtables, Flag, f_Group, INVALID, "", 0) @@ -395,7 +395,7 @@ OPTION("-iwithprefix", iwithprefix, JoinedOrSeparate, i_Group, INVALID, "", 0) OPTION("-iwithsysroot", iwithsysroot, JoinedOrSeparate, i_Group, INVALID, "", 0) OPTION("-i", i, Joined, i_Group, INVALID, "", 0) OPTION("-keep_private_externs", keep__private__externs, JoinedOrSeparate, INVALID, INVALID, "", 0) -OPTION("-l", l, JoinedOrSeparate, INVALID, INVALID, "", 0) +OPTION("-l", l, JoinedOrSeparate, INVALID, INVALID, "l", 0) OPTION("-m32", m32, Flag, m_Group, INVALID, "", 0) OPTION("-m3dnowa", m3dnowa, Flag, m_Group, INVALID, "", 0) OPTION("-m3dnow", m3dnow, Flag, m_Group, INVALID, "", 0) @@ -450,7 +450,7 @@ OPTION("-nostartfiles", nostartfiles, Flag, INVALID, INVALID, "", 0) OPTION("-nostdinc", nostdinc, Flag, INVALID, INVALID, "", 0) OPTION("-nostdlib", nostdlib, Flag, INVALID, INVALID, "", 0) OPTION("-object", object, Flag, INVALID, INVALID, "", 0) -OPTION("-o", o, JoinedOrSeparate, INVALID, INVALID, "", 0) +OPTION("-o", o, JoinedOrSeparate, INVALID, INVALID, "i", 0) OPTION("-pagezero_size", pagezero__size, Flag, INVALID, INVALID, "", 0) OPTION("-pass-exit-codes", pass_exit_codes, Flag, INVALID, INVALID, "", 0) OPTION("-pedantic-errors", pedantic_errors, Flag, pedantic_Group, INVALID, "", 0) @@ -475,15 +475,15 @@ OPTION("-read_only_relocs", read__only__relocs, Separate, INVALID, INVALID, "", OPTION("-remap", remap, Flag, INVALID, INVALID, "", 0) OPTION("-r", r, JoinedOrSeparate, INVALID, INVALID, "", 0) OPTION("-save-temps", save_temps, Flag, INVALID, INVALID, "", 0) -OPTION("-sectalign", sectalign, MultiArg, INVALID, INVALID, "", 0) -OPTION("-sectcreate", sectcreate, MultiArg, INVALID, INVALID, "", 0) -OPTION("-sectobjectsymbols", sectobjectsymbols, MultiArg, INVALID, INVALID, "", 0) -OPTION("-sectorder", sectorder, MultiArg, INVALID, INVALID, "", 0) +OPTION("-sectalign", sectalign, MultiArg, INVALID, INVALID, "", 3) +OPTION("-sectcreate", sectcreate, MultiArg, INVALID, INVALID, "", 3) +OPTION("-sectobjectsymbols", sectobjectsymbols, MultiArg, INVALID, INVALID, "", 2) +OPTION("-sectorder", sectorder, MultiArg, INVALID, INVALID, "", 3) OPTION("-seg1addr", seg1addr, JoinedOrSeparate, INVALID, INVALID, "", 0) OPTION("-seg_addr_table_filename", seg__addr__table__filename, Separate, INVALID, INVALID, "", 0) OPTION("-seg_addr_table", seg__addr__table, Separate, INVALID, INVALID, "", 0) OPTION("-segaddr", segaddr, Separate, INVALID, INVALID, "", 0) -OPTION("-segcreate", segcreate, MultiArg, INVALID, INVALID, "", 0) +OPTION("-segcreate", segcreate, MultiArg, INVALID, INVALID, "", 3) OPTION("-seglinkedit", seglinkedit, Flag, INVALID, INVALID, "", 0) OPTION("-segprot", segprot, JoinedOrSeparate, INVALID, INVALID, "", 0) OPTION("-segs_read_only_addr", segs__read__only__addr, Separate, INVALID, INVALID, "", 0) @@ -493,7 +493,7 @@ OPTION("-shared-libgcc", shared_libgcc, Flag, INVALID, INVALID, "", 0) OPTION("-shared", shared, Flag, INVALID, INVALID, "", 0) OPTION("-single_module", single__module, Flag, INVALID, INVALID, "", 0) OPTION("-specs=", specs_EQ, Joined, INVALID, INVALID, "", 0) -OPTION("-specs", specs, Separate, INVALID, INVALID, "", 0) +OPTION("-specs", specs, Separate, INVALID, INVALID, "u", 0) OPTION("-static-libgcc", static_libgcc, Flag, INVALID, INVALID, "", 0) OPTION("-static", static, Flag, INVALID, INVALID, "", 0) OPTION("-std=", std_EQ, Joined, INVALID, INVALID, "", 0) @@ -513,9 +513,9 @@ OPTION("-undef", undef, Flag, u_Group, INVALID, "", 0) OPTION("-unexported_symbols_list", unexported__symbols__list, Separate, u_Group, INVALID, "", 0) OPTION("-u", u, JoinedOrSeparate, u_Group, INVALID, "", 0) OPTION("-v", v, Flag, INVALID, INVALID, "", 0) -OPTION("-weak-l", weak_l, Joined, INVALID, INVALID, "", 0) -OPTION("-weak_framework", weak__framework, Separate, INVALID, INVALID, "", 0) -OPTION("-weak_library", weak__library, Separate, INVALID, INVALID, "", 0) +OPTION("-weak-l", weak_l, Joined, INVALID, INVALID, "l", 0) +OPTION("-weak_framework", weak__framework, Separate, INVALID, INVALID, "l", 0) +OPTION("-weak_library", weak__library, Separate, INVALID, INVALID, "l", 0) OPTION("-weak_reference_mismatches", weak__reference__mismatches, Separate, INVALID, INVALID, "", 0) OPTION("-whatsloaded", whatsloaded, Flag, INVALID, INVALID, "", 0) OPTION("-whyload", whyload, Flag, INVALID, INVALID, "", 0) diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp index 5caaace3ad..00a949f086 100644 --- a/lib/Driver/OptTable.cpp +++ b/lib/Driver/OptTable.cpp @@ -46,6 +46,7 @@ static Info &getInfo(unsigned id) { } OptTable::OptTable() : Options(new Option*[numOptions]) { + memset(Options, 0, sizeof(*Options) * numOptions); } OptTable::~OptTable() { @@ -108,11 +109,11 @@ Option *OptTable::constructOption(options::ID id) const { for (const char *s = info.Flags; *s; ++s) { switch (*s) { default: assert(0 && "Invalid option flag."); - case 'l': Opt->setLinkerInput(true); break; - case 'i': Opt->setNoOptAsInput(true); break; case 'J': Opt->setForceJoinedRender(true); break; case 'S': Opt->setForceSeparateRender(true); break; - case 'U': Opt->setUnsupported(true); break; + case 'i': Opt->setNoOptAsInput(true); break; + case 'l': Opt->setLinkerInput(true); break; + case 'u': Opt->setUnsupported(true); break; } } diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp index 7a53009455..083eb8e9da 100644 --- a/lib/Driver/Option.cpp +++ b/lib/Driver/Option.cpp @@ -190,6 +190,7 @@ MultiArgOption::MultiArgOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias, unsigned _NumArgs) : Option(Option::MultiArgClass, ID, Name, Group, Alias), NumArgs(_NumArgs) { + assert(NumArgs > 1 && "Invalid MultiArgOption!"); } Arg *MultiArgOption::accept(const ArgList &Args, unsigned &Index) const { |