blob: b7db6932d7253ab0b53fcc965ce132d3ef535d5e [file] [log] [blame]
Daniel Dunbar8adfcff2009-11-19 07:19:04 +00001//===--- CC1Options.td - Options for clang -cc1 ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
Stephen Hinesc568f1e2014-07-21 00:47:37 -070010// This file defines the options accepted by clang -cc1 and clang -cc1as.
Daniel Dunbar8adfcff2009-11-19 07:19:04 +000011//
12//===----------------------------------------------------------------------===//
13
Richard Smithf1eaab12012-11-09 22:36:44 +000014let Flags = [CC1Option, NoDriverOption] in {
Daniel Dunbar8adfcff2009-11-19 07:19:04 +000015
Daniel Dunbar33a33d82009-11-24 00:54:16 +000016//===----------------------------------------------------------------------===//
Daniel Dunbar8adfcff2009-11-19 07:19:04 +000017// Target Options
Daniel Dunbar33a33d82009-11-24 00:54:16 +000018//===----------------------------------------------------------------------===//
Daniel Dunbar8adfcff2009-11-19 07:19:04 +000019
Stephen Hinesc568f1e2014-07-21 00:47:37 -070020let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
21
Michael J. Spencerc6357102012-10-22 22:13:48 +000022def target_cpu : Separate<["-"], "target-cpu">,
Daniel Dunbar38b48af2009-12-18 06:30:12 +000023 HelpText<"Target a specific cpu type">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000024def target_feature : Separate<["-"], "target-feature">,
Daniel Dunbar8adfcff2009-11-19 07:19:04 +000025 HelpText<"Target specific attributes">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000026def triple : Separate<["-"], "triple">,
Daniel Dunbar8adfcff2009-11-19 07:19:04 +000027 HelpText<"Specify target triple (e.g. i686-apple-darwin9)">;
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -070028def target_abi : Separate<["-"], "target-abi">,
29 HelpText<"Target a particular ABI type">;
Stephen Hinesc568f1e2014-07-21 00:47:37 -070030
31}
32
Stephen Hinesc568f1e2014-07-21 00:47:37 -070033def target_linker_version : Separate<["-"], "target-linker-version">,
34 HelpText<"Target linker version">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000035def triple_EQ : Joined<["-"], "triple=">, Alias<triple>;
Stephen Hinesc568f1e2014-07-21 00:47:37 -070036def mfpmath : Separate<["-"], "mfpmath">,
37 HelpText<"Which unit to use for fp math">;
Daniel Dunbar50a44872009-11-20 17:23:30 +000038
Daniel Dunbar33a33d82009-11-24 00:54:16 +000039//===----------------------------------------------------------------------===//
Daniel Dunbare2814d82009-11-22 22:08:20 +000040// Analyzer Options
Daniel Dunbar33a33d82009-11-24 00:54:16 +000041//===----------------------------------------------------------------------===//
Daniel Dunbare2814d82009-11-22 22:08:20 +000042
Michael J. Spencerc6357102012-10-22 22:13:48 +000043def analysis_UnoptimizedCFG : Flag<["-"], "unoptimized-cfg">,
Ted Kremenekc9c6b902010-08-20 05:53:47 +000044 HelpText<"Generate unoptimized CFGs for all analyses">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000045def analysis_CFGAddImplicitDtors : Flag<["-"], "cfg-add-implicit-dtors">,
46 HelpText<"Add C++ implicit destructors to CFGs for all analyses">;
Daniel Dunbare2814d82009-11-22 22:08:20 +000047
Michael J. Spencerc6357102012-10-22 22:13:48 +000048def analyzer_store : Separate<["-"], "analyzer-store">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000049 HelpText<"Source Code Analysis - Abstract Memory Store Models">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000050def analyzer_store_EQ : Joined<["-"], "analyzer-store=">, Alias<analyzer_store>;
Daniel Dunbare2814d82009-11-22 22:08:20 +000051
Michael J. Spencerc6357102012-10-22 22:13:48 +000052def analyzer_constraints : Separate<["-"], "analyzer-constraints">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000053 HelpText<"Source Code Analysis - Symbolic Constraint Engines">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000054def analyzer_constraints_EQ : Joined<["-"], "analyzer-constraints=">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000055 Alias<analyzer_constraints>;
56
Michael J. Spencerc6357102012-10-22 22:13:48 +000057def analyzer_output : Separate<["-"], "analyzer-output">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000058 HelpText<"Source Code Analysis - Output Options">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000059def analyzer_output_EQ : Joined<["-"], "analyzer-output=">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000060 Alias<analyzer_output>;
61
Michael J. Spencerc6357102012-10-22 22:13:48 +000062def analyzer_purge : Separate<["-"], "analyzer-purge">,
Anna Zaksd3095282011-09-30 02:03:00 +000063 HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000064def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias<analyzer_purge>;
Anna Zaksd3095282011-09-30 02:03:00 +000065
Michael J. Spencerc6357102012-10-22 22:13:48 +000066def analyzer_opt_analyze_headers : Flag<["-"], "analyzer-opt-analyze-headers">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000067 HelpText<"Force the static analyzer to analyze functions defined in header files">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000068def analyzer_opt_analyze_nested_blocks : Flag<["-"], "analyzer-opt-analyze-nested-blocks">,
Michael J. Spencer20249a12010-10-21 03:16:25 +000069 HelpText<"Analyze the definitions of blocks in addition to functions">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000070def analyzer_display_progress : Flag<["-"], "analyzer-display-progress">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000071 HelpText<"Emit verbose output about the analyzer's progress">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000072def analyze_function : Separate<["-"], "analyze-function">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000073 HelpText<"Run analysis on specific function">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000074def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias<analyze_function>;
75def analyzer_eagerly_assume : Flag<["-"], "analyzer-eagerly-assume">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000076 HelpText<"Eagerly assume the truth/falseness of some symbolic constraints">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000077def trim_egraph : Flag<["-"], "trim-egraph">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000078 HelpText<"Only show error-related paths in the analysis graph">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000079def analyzer_viz_egraph_graphviz : Flag<["-"], "analyzer-viz-egraph-graphviz">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000080 HelpText<"Display exploded graph using GraphViz">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000081def analyzer_viz_egraph_ubigraph : Flag<["-"], "analyzer-viz-egraph-ubigraph">,
Daniel Dunbare2814d82009-11-22 22:08:20 +000082 HelpText<"Display exploded graph using Ubigraph">;
Anna Zaks66253352012-03-08 23:16:35 +000083
Michael J. Spencerc6357102012-10-22 22:13:48 +000084def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack-depth">,
Anna Zaks8235f9c2012-03-02 19:05:03 +000085 HelpText<"Bound on stack depth while inlining (4 by default)">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000086def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">,
Anna Zaks66253352012-03-08 23:16:35 +000087 Alias<analyzer_inline_max_stack_depth>;
88
Michael J. Spencerc6357102012-10-22 22:13:48 +000089def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">,
Anna Zaks66253352012-03-08 23:16:35 +000090 HelpText<"Specify the function selection heuristic used during inlining">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000091def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>;
Anna Zaks5903a372012-03-27 20:02:53 +000092
Michael J. Spencerc6357102012-10-22 22:13:48 +000093def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">,
Anna Zaksb47dbcb2012-03-28 19:59:16 +000094 HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">;
Anna Zaks66253352012-03-08 23:16:35 +000095
Michael J. Spencerc6357102012-10-22 22:13:48 +000096def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">,
Zhongxing Xu6362b892010-05-18 00:28:37 +000097 HelpText<"The maximum number of times the analyzer will go through a loop">;
Michael J. Spencerc6357102012-10-22 22:13:48 +000098def analyzer_stats : Flag<["-"], "analyzer-stats">,
Anna Zaks81fb1692012-02-27 21:33:16 +000099 HelpText<"Print internal analyzer statistics.">;
Daniel Dunbare2814d82009-11-22 22:08:20 +0000100
Michael J. Spencerc6357102012-10-22 22:13:48 +0000101def analyzer_checker : Separate<["-"], "analyzer-checker">,
Argyrios Kyrtzidis43dee222011-02-14 18:13:31 +0000102 HelpText<"Choose analyzer checkers to enable">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000103def analyzer_checker_EQ : Joined<["-"], "analyzer-checker=">,
Argyrios Kyrtzidis43dee222011-02-14 18:13:31 +0000104 Alias<analyzer_checker>;
105
Michael J. Spencerc6357102012-10-22 22:13:48 +0000106def analyzer_disable_checker : Separate<["-"], "analyzer-disable-checker">,
Argyrios Kyrtzidis43dee222011-02-14 18:13:31 +0000107 HelpText<"Choose analyzer checkers to disable">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000108def analyzer_disable_checker_EQ : Joined<["-"], "analyzer-disable-checker=">,
Argyrios Kyrtzidis43dee222011-02-14 18:13:31 +0000109 Alias<analyzer_disable_checker>;
110
Stephen Hines176edba2014-12-01 14:53:08 -0800111def analyzer_disable_all_checks : Flag<["-"], "analyzer-disable-all-checks">,
112 HelpText<"Disable all static analyzer checks">;
113
Michael J. Spencerc6357102012-10-22 22:13:48 +0000114def analyzer_checker_help : Flag<["-"], "analyzer-checker-help">,
Argyrios Kyrtzidis116f3642011-02-25 00:09:51 +0000115 HelpText<"Display the list of analyzer checkers that are available">;
116
Michael J. Spencerc6357102012-10-22 22:13:48 +0000117def analyzer_config : Separate<["-"], "analyzer-config">,
Ted Kremenek318cc3c2012-08-30 05:49:16 +0000118 HelpText<"Choose analyzer options to enable">;
Ted Kremenek7b73e082012-08-29 05:55:00 +0000119
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000120//===----------------------------------------------------------------------===//
Fariborz Jahanianb5c6bab2012-01-25 00:20:29 +0000121// Migrator Options
122//===----------------------------------------------------------------------===//
Michael J. Spencerc6357102012-10-22 22:13:48 +0000123def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">,
Fariborz Jahanianb5c6bab2012-01-25 00:20:29 +0000124 HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">;
125
Michael J. Spencerc6357102012-10-22 22:13:48 +0000126def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">,
Fariborz Jahanian26f0e4e2012-01-26 00:08:04 +0000127 HelpText<"Do not remove finalize method in gc mode">;
128
Fariborz Jahanianb5c6bab2012-01-25 00:20:29 +0000129//===----------------------------------------------------------------------===//
Daniel Dunbar50a44872009-11-20 17:23:30 +0000130// CodeGen Options
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000131//===----------------------------------------------------------------------===//
Daniel Dunbar50a44872009-11-20 17:23:30 +0000132
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700133let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
134
135def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
136 HelpText<"The compilation directory to embed in the debug info.">;
137def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
138 HelpText<"The string to embed in the Dwarf debug flags record.">;
139def mno_exec_stack : Flag<["-"], "mnoexecstack">,
140 HelpText<"Mark the file as not needing an executable stack">;
Stephen Hines176edba2014-12-01 14:53:08 -0800141def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
142 HelpText<"Make assembler warnings fatal">;
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700143def compress_debug_sections : Flag<["-"], "compress-debug-sections">,
144 HelpText<"Compress DWARF debug sections using zlib">;
145def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
146 HelpText<"Save temporary labels in the symbol table. "
147 "Note this may change .s semantics and shouldn't generally be used "
148 "on compiler-generated code.">;
149
150}
151
Michael J. Spencerc6357102012-10-22 22:13:48 +0000152def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
Daniel Dunbar50a44872009-11-20 17:23:30 +0000153 HelpText<"Don't run LLVM optimization passes">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000154def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">,
John McCall824e19e2010-02-12 23:47:27 +0000155 HelpText<"Don't run the LLVM IR verifier pass">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000156def disable_red_zone : Flag<["-"], "disable-red-zone">,
Daniel Dunbar50a44872009-11-20 17:23:30 +0000157 HelpText<"Do not emit code that uses the red zone.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000158def dwarf_column_info : Flag<["-"], "dwarf-column-info">,
Eric Christopherda3301e2012-10-18 21:52:18 +0000159 HelpText<"Turn on column location information.">;
Eric Christopherc706c8e2013-02-05 07:29:57 +0000160def split_dwarf : Flag<["-"], "split-dwarf">,
161 HelpText<"Split out the dwarf .dwo sections">;
Eric Christopher0f43a6d2013-09-13 22:37:55 +0000162def gnu_pubnames : Flag<["-"], "gnu-pubnames">,
163 HelpText<"Emit newer GNU style pubnames">;
Stephen Hines651f13c2014-04-23 16:59:28 -0700164def arange_sections : Flag<["-"], "arange_sections">,
165 HelpText<"Emit DWARF .debug_arange sections">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000166def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">,
John McCall32096692011-03-18 02:56:14 +0000167 HelpText<"Emit an error if a C++ static local initializer would need a guard variable">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000168def no_implicit_float : Flag<["-"], "no-implicit-float">,
Chad Rosier005af272012-05-16 21:19:55 +0000169 HelpText<"Don't generate implicit floating point instructions">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000170def fdump_vtable_layouts : Flag<["-"], "fdump-vtable-layouts">,
Anders Carlsson824d7ea2010-02-11 08:02:13 +0000171 HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">;
Stephen Hines176edba2014-12-01 14:53:08 -0800172def fmerge_functions : Flag<["-"], "fmerge-functions">,
173 HelpText<"Permit merging of identical functions when optimizing.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000174def femit_coverage_notes : Flag<["-"], "femit-coverage-notes">,
Nick Lewyckye8ba8d72011-04-21 23:44:07 +0000175 HelpText<"Emit a gcov coverage notes file when compiling.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000176def femit_coverage_data: Flag<["-"], "femit-coverage-data">,
Nick Lewyckye8ba8d72011-04-21 23:44:07 +0000177 HelpText<"Instrument the program to emit gcov coverage data when run.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000178def coverage_file : Separate<["-"], "coverage-file">,
Nick Lewycky3dc05412011-05-05 00:08:20 +0000179 HelpText<"Emit coverage data to this filename. The extension will be replaced.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000180def coverage_file_EQ : Joined<["-"], "coverage-file=">, Alias<coverage_file>;
Nick Lewycky0f815f12013-03-07 08:28:53 +0000181def coverage_cfg_checksum : Flag<["-"], "coverage-cfg-checksum">,
182 HelpText<"Emit CFG checksum for functions in .gcno files.">;
Nick Lewycky83c546a2013-03-20 02:14:38 +0000183def coverage_no_function_names_in_data : Flag<["-"], "coverage-no-function-names-in-data">,
Nick Lewycky0f815f12013-03-07 08:28:53 +0000184 HelpText<"Emit function names in .gcda files.">;
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -0700185def coverage_exit_block_before_body : Flag<["-"], "coverage-exit-block-before-body">,
186 HelpText<"Emit the exit block before the body blocks in .gcno files.">;
Nick Lewycky0f815f12013-03-07 08:28:53 +0000187def coverage_version_EQ : Joined<["-"], "coverage-version=">,
188 HelpText<"Four-byte version string for gcov files.">;
Nick Lewyckyf2b5e072013-03-20 01:38:16 +0000189def test_coverage : Flag<["-"], "test-coverage">,
190 HelpText<"Do not generate coverage files or remove coverage changes from IR">;
Stephen Hines176edba2014-12-01 14:53:08 -0800191def dump_coverage_mapping : Flag<["-"], "dump-coverage-mapping">,
192 HelpText<"Dump the coverage mapping records, for testing">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000193def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">,
Daniel Dunbare26bdb92011-06-21 18:54:46 +0000194 HelpText<"Use register sized accesses to bit-fields, when possible.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000195def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
Devang Patelbe570122010-10-15 18:23:36 +0000196 HelpText<"Turn off Type Based Alias Analysis">;
Manman Ren96d6c452013-10-11 20:48:38 +0000197def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
198 HelpText<"Turn off struct-path aware Type Based Alias Analysis">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000199def masm_verbose : Flag<["-"], "masm-verbose">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000200 HelpText<"Generate verbose assembly output">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000201def mcode_model : Separate<["-"], "mcode-model">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000202 HelpText<"The code model to use">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000203def mdebug_pass : Separate<["-"], "mdebug-pass">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000204 HelpText<"Enable additional debug output">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000205def mdisable_fp_elim : Flag<["-"], "mdisable-fp-elim">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000206 HelpText<"Disable frame pointer elimination optimization">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000207def mdisable_tail_calls : Flag<["-"], "mdisable-tail-calls">,
Nick Lewycky1db772b2012-01-23 08:29:12 +0000208 HelpText<"Disable tail call optimization, keeping the call stack accurate">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000209def menable_no_infinities : Flag<["-"], "menable-no-infs">,
Daniel Dunbar001f6282011-12-09 23:41:18 +0000210 HelpText<"Allow optimization to assume there are no infinities.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000211def menable_no_nans : Flag<["-"], "menable-no-nans">,
Daniel Dunbar001f6282011-12-09 23:41:18 +0000212 HelpText<"Allow optimization to assume there are no NaNs.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000213def menable_unsafe_fp_math : Flag<["-"], "menable-unsafe-fp-math">,
Chandler Carruthabf07a72012-01-02 14:19:45 +0000214 HelpText<"Allow unsafe floating-point math optimizations which may decrease "
215 "precision">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000216def mfloat_abi : Separate<["-"], "mfloat-abi">,
Daniel Dunbar3b315262009-11-30 08:42:00 +0000217 HelpText<"The float ABI to use">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000218def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000219 HelpText<"Limit float precision to the given value">;
Eric Christopher31056272013-04-04 06:29:47 +0000220def split_stacks : Flag<["-"], "split-stacks">,
221 HelpText<"Try to use a split stack if possible.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000222def mno_zero_initialized_in_bss : Flag<["-"], "mno-zero-initialized-in-bss">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000223 HelpText<"Do not put zero initialized data in the BSS">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000224def backend_option : Separate<["-"], "backend-option">,
Daniel Dunbar3c66d302011-03-22 16:48:17 +0000225 HelpText<"Additional arguments to forward to LLVM backend (during code gen)">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000226def mregparm : Separate<["-"], "mregparm">,
Daniel Dunbar17d3fea2011-02-09 17:54:19 +0000227 HelpText<"Limit the number of registers available for integer arguments">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000228def mrelocation_model : Separate<["-"], "mrelocation-model">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000229 HelpText<"The relocation model to use">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000230def munwind_tables : Flag<["-"], "munwind-tables">,
Daniel Dunbarf219e7c2009-11-29 07:18:39 +0000231 HelpText<"Generate unwinding tables for all functions">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000232def mconstructor_aliases : Flag<["-"], "mconstructor-aliases">,
John McCalld46f9852010-02-19 01:32:20 +0000233 HelpText<"Emit complete constructors and destructors as aliases when possible">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000234def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">,
Peter Collingbourne22a7dfe2011-10-30 17:30:44 +0000235 HelpText<"Link the given bitcode file before performing optimizations.">;
Nick Lewyckyfdf137b2013-06-25 01:49:44 +0000236def vectorize_loops : Flag<["-"], "vectorize-loops">,
237 HelpText<"Run the Loop vectorization passes">;
238def vectorize_slp : Flag<["-"], "vectorize-slp">,
239 HelpText<"Run the SLP vectorization passes">;
240def vectorize_slp_aggressive : Flag<["-"], "vectorize-slp-aggressive">,
241 HelpText<"Run the BB vectorization passes">;
Hans Wennborgb3574792013-08-08 00:17:41 +0000242def dependent_lib : Joined<["--"], "dependent-lib=">,
243 HelpText<"Add dependent library">;
Daniel Dunbar1bed0c32009-11-20 23:28:07 +0000244
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000245//===----------------------------------------------------------------------===//
Daniel Dunbar1bed0c32009-11-20 23:28:07 +0000246// Dependency Output Options
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000247//===----------------------------------------------------------------------===//
248
Michael J. Spencerc6357102012-10-22 22:13:48 +0000249def sys_header_deps : Flag<["-"], "sys-header-deps">,
Daniel Dunbar1bed0c32009-11-20 23:28:07 +0000250 HelpText<"Include system headers in dependency output">;
Stephen Hines651f13c2014-04-23 16:59:28 -0700251def module_file_deps : Flag<["-"], "module-file-deps">,
252 HelpText<"Include module files in dependency output">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000253def header_include_file : Separate<["-"], "header-include-file">,
Daniel Dunbarb34d69b2011-02-02 21:11:31 +0000254 HelpText<"Filename (or -) to write header include output to">;
Hans Wennborg708002e2013-08-09 00:32:23 +0000255def show_includes : Flag<["--"], "show-includes">,
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700256 HelpText<"Print cl.exe style /showIncludes to stdout">;
Daniel Dunbar21affc02009-11-23 23:41:17 +0000257
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000258//===----------------------------------------------------------------------===//
Daniel Dunbar21affc02009-11-23 23:41:17 +0000259// Diagnostic Options
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000260//===----------------------------------------------------------------------===//
Daniel Dunbar21affc02009-11-23 23:41:17 +0000261
Michael J. Spencerc6357102012-10-22 22:13:48 +0000262def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">,
Daniel Dunbar08c66952011-04-07 18:11:14 +0000263 HelpText<"Filename (or -) to log diagnostics to">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000264def diagnostic_serialized_file : Separate<["-"], "serialize-diagnostic-file">,
Ted Kremenek78002122011-10-29 00:12:39 +0000265 MetaVarName<"<filename>">,
266 HelpText<"File for serializing diagnostics in a binary format">;
Daniel Dunbar21affc02009-11-23 23:41:17 +0000267
Michael J. Spencerc6357102012-10-22 22:13:48 +0000268def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">,
Douglas Gregorc9471b02011-05-21 17:07:29 +0000269 HelpText<"Change diagnostic formatting to match IDE and command line tools">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000270def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">,
Chris Lattner6fbe8392010-05-04 21:55:25 +0000271 HelpText<"Print diagnostic category">;
Richard Smith62221b12012-11-14 23:55:25 +0000272def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">,
273 HelpText<"Ignore #line directives when displaying diagnostic locations">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000274def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">,
Chris Lattner124fca52010-01-09 21:54:33 +0000275 HelpText<"Set the tab stop distance.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000276def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">,
Chris Lattnerc1002142010-04-07 20:37:06 +0000277 HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000278def fmacro_backtrace_limit : Separate<["-"], "fmacro-backtrace-limit">, MetaVarName<"<N>">,
Chandler Carruthb29a6102011-07-15 00:04:38 +0000279 HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit).">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000280def ftemplate_backtrace_limit : Separate<["-"], "ftemplate-backtrace-limit">, MetaVarName<"<N>">,
Douglas Gregor575cf372010-04-20 07:18:24 +0000281 HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit).">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000282def fconstexpr_backtrace_limit : Separate<["-"], "fconstexpr-backtrace-limit">, MetaVarName<"<N>">,
Richard Smith08d6e032011-12-16 19:06:07 +0000283 HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">;
Stephen Hines0e2c34f2015-03-23 12:09:02 -0700284def fspell_checking_limit : Separate<["-"], "fspell-checking-limit">, MetaVarName<"<N>">,
285 HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit).">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000286def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"<N>">,
Daniel Dunbar21affc02009-11-23 23:41:17 +0000287 HelpText<"Format message diagnostics so that they fit within N columns or fewer, when possible.">;
Stephen Hines651f13c2014-04-23 16:59:28 -0700288def verify : Flag<["-"], "verify">,
289 HelpText<"Verify diagnostic output using comment directives">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000290def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">,
Daniel Dunbar21affc02009-11-23 23:41:17 +0000291 HelpText<"Silence ObjC rewriting warnings">;
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000292
293//===----------------------------------------------------------------------===//
294// Frontend Options
295//===----------------------------------------------------------------------===//
296
Daniel Dunbar8ff5b282009-12-11 23:00:49 +0000297// This isn't normally used, it is just here so we can parse a
298// CompilerInvocation out of a driver-derived argument vector.
Michael J. Spencerc6357102012-10-22 22:13:48 +0000299def cc1 : Flag<["-"], "cc1">;
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700300def cc1as : Flag<["-"], "cc1as">;
Daniel Dunbar8ff5b282009-12-11 23:00:49 +0000301
Michael J. Spencerc6357102012-10-22 22:13:48 +0000302def ast_merge : Separate<["-"], "ast-merge">,
Douglas Gregor9bed8792010-02-09 19:21:46 +0000303 MetaVarName<"<ast file>">,
304 HelpText<"Merge the given AST file into the translation unit being compiled.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000305def code_completion_at : Separate<["-"], "code-completion-at">,
Daniel Dunbarb737fb12009-12-03 07:01:46 +0000306 MetaVarName<"<file>:<line>:<column>">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000307 HelpText<"Dump code-completion information at a location">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000308def remap_file : Separate<["-"], "remap-file">,
Daniel Dunbare14b5f52009-12-03 05:11:16 +0000309 MetaVarName<"<from>;<to>">,
310 HelpText<"Replace the contents of the <from> file with the contents of the <to> file">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000311def code_completion_at_EQ : Joined<["-"], "code-completion-at=">,
Daniel Dunbarce6bf1e2009-11-29 09:32:20 +0000312 Alias<code_completion_at>;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000313def code_completion_macros : Flag<["-"], "code-completion-macros">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000314 HelpText<"Include macros in code-completion results">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000315def code_completion_patterns : Flag<["-"], "code-completion-patterns">,
Douglas Gregord8e8a582010-05-25 21:41:55 +0000316 HelpText<"Include code patterns in code-completion results">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000317def no_code_completion_globals : Flag<["-"], "no-code-completion-globals">,
Douglas Gregor8071e422010-08-15 06:18:01 +0000318 HelpText<"Do not include global declarations in code-completion results.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000319def code_completion_brief_comments : Flag<["-"], "code-completion-brief-comments">,
Dmitri Gribenkod99ef532012-07-02 17:35:10 +0000320 HelpText<"Include brief documentation comments in code-completion results.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000321def disable_free : Flag<["-"], "disable-free">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000322 HelpText<"Disable freeing of memory on exit">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000323def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
Daniel Dunbarefba2272009-12-03 05:11:05 +0000324 HelpText<"Load the named plugin (dynamic shared object)">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000325def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
Nico Weber5aa74af2011-01-25 20:34:14 +0000326 HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000327def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">,
Daniel Dunbar3177aae2010-06-16 16:59:23 +0000328 MetaVarName<"<name> <arg>">,
329 HelpText<"Pass <arg> to plugin <name>">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000330def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"<name>">,
Nico Weber5aa74af2011-01-25 20:34:14 +0000331 HelpText<"Use the named plugin action in addition to the default action">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000332def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
Alexander Kornienkoe34a0522012-07-26 16:01:23 +0000333 MetaVarName<"<dump_filter>">,
334 HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
Alexander Kornienko171af642012-07-31 09:37:40 +0000335 " nodes having a certain substring in a qualified name. Use"
336 " -ast-list to list all filterable declaration node names.">;
Douglas Gregor20c6f2e2013-01-28 18:38:02 +0000337def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
338 HelpText<"Do not automatically generate or update the global module index">;
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700339def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,
340 HelpText<"Do not automatically import modules for error recovery">;
Stephen Hines176edba2014-12-01 14:53:08 -0800341def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
342 MetaVarName<"<name>">,
343 HelpText<"Specify the name of the module whose implementation file this is">;
Stephen Hines0e2c34f2015-03-23 12:09:02 -0700344def fmodule_map_file_home_is_cwd : Flag<["-"], "fmodule-map-file-home-is-cwd">,
345 HelpText<"Use the current working directory as the home directory of "
346 "module maps specified by -fmodule-map-file=<FILE>">;
347def fmodule_feature : Separate<["-"], "fmodule-feature">,
348 MetaVarName<"<feature>">,
349 HelpText<"Enable <feature> in module map requires declarations">;
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000350
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000351let Group = Action_Group in {
352
Michael J. Spencerc6357102012-10-22 22:13:48 +0000353def Eonly : Flag<["-"], "Eonly">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000354 HelpText<"Just run preprocessor, no output (for timings)">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000355def dump_raw_tokens : Flag<["-"], "dump-raw-tokens">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000356 HelpText<"Lex file in raw mode and dump raw tokens">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000357def analyze : Flag<["-"], "analyze">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000358 HelpText<"Run static analysis engine">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000359def dump_tokens : Flag<["-"], "dump-tokens">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000360 HelpText<"Run preprocessor, dump internal rep of tokens">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000361def init_only : Flag<["-"], "init-only">,
Daniel Dunbar27585952010-03-19 19:44:04 +0000362 HelpText<"Only execute frontend initialization">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000363def fixit : Flag<["-"], "fixit">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000364 HelpText<"Apply fix-it advice to the input source">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000365def fixit_EQ : Joined<["-"], "fixit=">,
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +0000366 HelpText<"Apply fix-it advice creating a file with the given suffix">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000367def print_preamble : Flag<["-"], "print-preamble">,
Douglas Gregorf033f1d2010-07-20 20:18:03 +0000368 HelpText<"Print the \"preamble\" of a file, which is a candidate for implicit"
369 " precompiled headers.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000370def emit_html : Flag<["-"], "emit-html">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000371 HelpText<"Output input source as HTML">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000372def ast_print : Flag<["-"], "ast-print">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000373 HelpText<"Build ASTs and then pretty-print them">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000374def ast_list : Flag<["-"], "ast-list">,
Alexander Kornienko171af642012-07-31 09:37:40 +0000375 HelpText<"Build ASTs and print the list of declaration node qualified names">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000376def ast_dump : Flag<["-"], "ast-dump">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000377 HelpText<"Build ASTs and then debug dump them">;
Stephen Hines176edba2014-12-01 14:53:08 -0800378def ast_dump_lookups : Flag<["-"], "ast-dump-lookups">,
379 HelpText<"Build ASTs and then debug dump their name lookup tables">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000380def ast_view : Flag<["-"], "ast-view">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000381 HelpText<"Build ASTs and view them with GraphViz">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000382def print_decl_contexts : Flag<["-"], "print-decl-contexts">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000383 HelpText<"Print DeclContexts and their Decls">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000384def emit_module : Flag<["-"], "emit-module">,
Douglas Gregor66490142011-11-29 22:42:06 +0000385 HelpText<"Generate pre-compiled module file from a module map">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000386def emit_pth : Flag<["-"], "emit-pth">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000387 HelpText<"Generate pre-tokenized header file">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000388def emit_pch : Flag<["-"], "emit-pch">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000389 HelpText<"Generate pre-compiled header file">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000390def emit_llvm_bc : Flag<["-"], "emit-llvm-bc">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000391 HelpText<"Build ASTs then convert to LLVM, emit .bc file">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000392def emit_llvm_only : Flag<["-"], "emit-llvm-only">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000393 HelpText<"Build ASTs and convert to LLVM, discarding output">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000394def emit_codegen_only : Flag<["-"], "emit-codegen-only">,
Daniel Dunbar32148ce2010-05-25 18:41:01 +0000395 HelpText<"Generate machine code, but discard output">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000396def emit_obj : Flag<["-"], "emit-obj">,
Daniel Dunbarda1573f2010-02-03 01:18:43 +0000397 HelpText<"Emit native object files">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000398def rewrite_test : Flag<["-"], "rewrite-test">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000399 HelpText<"Rewriter playground">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000400def rewrite_macros : Flag<["-"], "rewrite-macros">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000401 HelpText<"Expand macros without full preprocessing">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000402def migrate : Flag<["-"], "migrate">,
Ted Kremenek30660a82012-03-06 20:06:33 +0000403 HelpText<"Migrate source code">;
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000404}
405
Pirama Arumuga Nainar33337ca2015-05-06 11:48:57 -0700406def emit_llvm_uselists : Flag<["-"], "emit-llvm-uselists">,
407 HelpText<"Preserve order of LLVM use-lists when serializing">;
408def no_emit_llvm_uselists : Flag<["-"], "no-emit-llvm-uselists">,
409 HelpText<"Don't preserve order of LLVM use-lists when serializing">;
410
Michael J. Spencerc6357102012-10-22 22:13:48 +0000411def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
Ted Kremenek30660a82012-03-06 20:06:33 +0000412 HelpText<"Directory for temporary files produced during ARC or ObjC migration">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000413def arcmt_check : Flag<["-"], "arcmt-check">,
John McCallf85e1932011-06-15 23:02:42 +0000414 HelpText<"Check for ARC migration issues that need manual handling">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000415def arcmt_modify : Flag<["-"], "arcmt-modify">,
John McCallf85e1932011-06-15 23:02:42 +0000416 HelpText<"Apply modifications to files to conform to ARC">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000417def arcmt_migrate : Flag<["-"], "arcmt-migrate">,
Argyrios Kyrtzidis69325d52011-07-09 20:00:58 +0000418 HelpText<"Apply modifications and produces temporary files that conform to ARC">;
Argyrios Kyrtzidis389db162010-11-03 22:45:23 +0000419
Michael J. Spencerc6357102012-10-22 22:13:48 +0000420def print_stats : Flag<["-"], "print-stats">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000421 HelpText<"Print performance metrics and statistics">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000422def fdump_record_layouts : Flag<["-"], "fdump-record-layouts">,
Daniel Dunbarb69eca52010-04-08 02:59:56 +0000423 HelpText<"Dump record layout information">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000424def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">,
Douglas Gregor453dbcb2012-01-26 07:55:45 +0000425 HelpText<"Dump record layout information in a simple form used for testing">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000426def fix_what_you_can : Flag<["-"], "fix-what-you-can">,
Nick Lewycky1450f262010-08-13 17:31:00 +0000427 HelpText<"Apply fix-it advice even in the presence of unfixable errors">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000428def fix_only_warnings : Flag<["-"], "fix-only-warnings">,
Argyrios Kyrtzidis61d679a2012-01-26 02:40:48 +0000429 HelpText<"Apply fix-it advice only for warnings, not errors">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000430def fixit_recompile : Flag<["-"], "fixit-recompile">,
Argyrios Kyrtzidis61d679a2012-01-26 02:40:48 +0000431 HelpText<"Apply fix-it changes and recompile">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000432def fixit_to_temp : Flag<["-"], "fixit-to-temporary">,
Argyrios Kyrtzidis61d679a2012-01-26 02:40:48 +0000433 HelpText<"Apply fix-it changes to temporary files">;
Daniel Dunbarb69eca52010-04-08 02:59:56 +0000434
Michael J. Spencerc6357102012-10-22 22:13:48 +0000435def foverride_record_layout_EQ : Joined<["-"], "foverride-record-layout=">,
Douglas Gregor453dbcb2012-01-26 07:55:45 +0000436 HelpText<"Override record layouts with those in the given file">;
437
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000438//===----------------------------------------------------------------------===//
439// Language Options
440//===----------------------------------------------------------------------===//
441
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700442let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
443
444def version : Flag<["-"], "version">,
445 HelpText<"Print the compiler version">;
446def main_file_name : Separate<["-"], "main-file-name">,
447 HelpText<"Main file name to use for debug info">;
448
449}
450
Michael J. Spencerc6357102012-10-22 22:13:48 +0000451def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">,
John McCall13db5cf2011-09-09 20:41:01 +0000452 HelpText<"Weakly link in the blocks runtime">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000453def fsjlj_exceptions : Flag<["-"], "fsjlj-exceptions">,
Daniel Dunbar73482882010-02-10 18:48:44 +0000454 HelpText<"Use SjLj style exceptions">;
Eric Christopher80190392013-02-22 20:12:52 +0000455def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
456 HelpText<"File name to use for split dwarf debug info output">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000457def fno_wchar : Flag<["-"], "fno-wchar">,
Abramo Bagnara5b86ffd2012-09-05 17:30:57 +0000458 HelpText<"Disable C++ builtin type wchar_t">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000459def fconstant_string_class : Separate<["-"], "fconstant-string-class">,
Daniel Dunbarb737fb12009-12-03 07:01:46 +0000460 MetaVarName<"<class name>">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000461 HelpText<"Specify the class to use for constant Objective-C string objects.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000462def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,
John McCallf85e1932011-06-15 23:02:42 +0000463 HelpText<"Objective-C++ Automatic Reference Counting standard library kind">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000464def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,
John McCall9f084a32011-07-06 00:26:06 +0000465 HelpText<"The target Objective-C runtime supports ARC weak operations">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000466def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,
Daniel Dunbarf643b9b2010-04-24 17:56:46 +0000467 HelpText<"Objective-C dispatch method to use">;
Rafael Espindola14f98892013-09-27 20:21:48 +0000468def disable_objc_default_synthesize_properties : Flag<["-"], "disable-objc-default-synthesize-properties">,
Rafael Espindola5cf3e352013-09-27 20:42:38 +0000469 HelpText<"disable the default synthesis of Objective-C properties">;
Fariborz Jahanian3d145f62012-11-15 19:02:45 +0000470def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signature">,
471 HelpText<"enable extended encoding of block type signature">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000472def pic_level : Separate<["-"], "pic-level">,
Daniel Dunbarb737fb12009-12-03 07:01:46 +0000473 HelpText<"Value for __PIC__">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000474def pie_level : Separate<["-"], "pie-level">,
Chandler Carruth5e219cf2012-04-08 16:40:35 +0000475 HelpText<"Value for __PIE__">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000476def fno_validate_pch : Flag<["-"], "fno-validate-pch">,
Douglas Gregorfae3b2f2010-07-27 00:27:13 +0000477 HelpText<"Disable validation of precompiled headers">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000478def dump_deserialized_pch_decls : Flag<["-"], "dump-deserialized-decls">,
Argyrios Kyrtzidisb9728582010-10-14 20:14:18 +0000479 HelpText<"Dump declarations that are deserialized from PCH, for testing">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000480def error_on_deserialized_pch_decl : Separate<["-"], "error-on-deserialized-decl">,
Argyrios Kyrtzidis3e785932010-10-14 20:14:25 +0000481 HelpText<"Emit error if a specific declaration is deserialized from PCH, for testing">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000482def error_on_deserialized_pch_decl_EQ : Joined<["-"], "error-on-deserialized-decl=">,
Argyrios Kyrtzidis9a8cbc72011-10-28 22:54:24 +0000483 Alias<error_on_deserialized_pch_decl>;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000484def static_define : Flag<["-"], "static-define">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000485 HelpText<"Should __STATIC__ be defined">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000486def stack_protector : Separate<["-"], "stack-protector">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000487 HelpText<"Enable stack protectors">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000488def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
Chad Rosiera7afeb02012-08-21 16:16:06 +0000489 HelpText<"Lower bound for a buffer to be considered for stack protection">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000490def fvisibility : Separate<["-"], "fvisibility">,
John McCalla880b192013-02-19 01:57:35 +0000491 HelpText<"Default type and symbol visibility">;
492def ftype_visibility : Separate<["-"], "ftype-visibility">,
493 HelpText<"Default type visibility">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000494def ftemplate_depth : Separate<["-"], "ftemplate-depth">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000495 HelpText<"Maximum depth of recursive template instantiation">;
Richard Smith195dd7c2013-11-06 19:31:51 +0000496def foperator_arrow_depth : Separate<["-"], "foperator-arrow-depth">,
497 HelpText<"Maximum number of 'operator->'s to call for a member access">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000498def fconstexpr_depth : Separate<["-"], "fconstexpr-depth">,
Richard Smithc18c4232011-11-21 19:36:32 +0000499 HelpText<"Maximum depth of recursive constexpr function calls">;
Richard Smithe7565632013-05-08 02:12:03 +0000500def fconstexpr_steps : Separate<["-"], "fconstexpr-steps">,
501 HelpText<"Maximum number of steps in constexpr function evaluation">;
Richard Smith9e738cc2013-02-22 01:59:51 +0000502def fbracket_depth : Separate<["-"], "fbracket-depth">,
503 HelpText<"Maximum nesting level for parentheses, brackets, and braces">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000504def fconst_strings : Flag<["-"], "fconst-strings">,
Chandler Carruth50465d12011-04-23 06:30:43 +0000505 HelpText<"Use a const qualified type for string literals in C and ObjC">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000506def fno_const_strings : Flag<["-"], "fno-const-strings">,
Chandler Carruth50465d12011-04-23 06:30:43 +0000507 HelpText<"Don't use a const qualified type for string literals in C and ObjC">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000508def fno_bitfield_type_align : Flag<["-"], "fno-bitfield-type-align">,
Daniel Dunbarfb937b82010-04-15 15:06:22 +0000509 HelpText<"Ignore bit-field types when aligning structures">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000510def ffake_address_space_map : Flag<["-"], "ffake-address-space-map">,
Peter Collingbourne207f4d82011-03-18 22:38:29 +0000511 HelpText<"Use a fake address space map; OpenCL testing purposes only">;
David Tweed1eef8522013-09-13 12:04:22 +0000512def faddress_space_map_mangling_EQ : Joined<["-"], "faddress-space-map-mangling=">, MetaVarName<"<yes|no|target>">,
513 HelpText<"Set the mode for address space map based mangling; OpenCL testing purposes only">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000514def funknown_anytype : Flag<["-"], "funknown-anytype">,
John McCalla5fc4722011-04-09 22:50:59 +0000515 HelpText<"Enable parser support for the __unknown_anytype type; for testing purposes only">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000516def fdebugger_support : Flag<["-"], "fdebugger-support">,
John McCall48218c62011-07-13 17:56:40 +0000517 HelpText<"Enable special debugger support behavior">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000518def fdebugger_cast_result_to_id : Flag<["-"], "fdebugger-cast-result-to-id">,
Sean Callanan50a9a122012-02-04 01:29:37 +0000519 HelpText<"Enable casting unknown expression results to id">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000520def fdebugger_objc_literal : Flag<["-"], "fdebugger-objc-literal">,
Jordan Roseb13291a2012-07-19 18:10:18 +0000521 HelpText<"Enable special debugger support for Objective-C subscripting and literals">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000522def fdeprecated_macro : Flag<["-"], "fdeprecated-macro">,
Chandler Carruthf8c247d2011-04-23 19:48:40 +0000523 HelpText<"Defines the __DEPRECATED macro">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000524def fno_deprecated_macro : Flag<["-"], "fno-deprecated-macro">,
Chandler Carruthf8c247d2011-04-23 19:48:40 +0000525 HelpText<"Undefines the __DEPRECATED macro">;
Fariborz Jahaniand9553e32013-11-01 21:58:17 +0000526def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">,
527 HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">;
Stephen Hines651f13c2014-04-23 16:59:28 -0700528def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
529 HelpText<"Control vtordisp placement on win32 targets">;
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700530def fno_rtti_data : Flag<["-"], "fno-rtti-data">,
531 HelpText<"Control emission of RTTI data">;
Pirama Arumuga Nainar6270ca62015-05-20 13:00:06 -0700532def fnative_half_type: Flag<["-"], "fnative-half-type">,
533 HelpText<"Use the native half type for __fp16 instead of promoting to float">;
Stephen Hines176edba2014-12-01 14:53:08 -0800534def fallow_half_arguments_and_returns : Flag<["-"], "fallow-half-arguments-and-returns">,
535 HelpText<"Allow function arguments and returns of type half">;
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000536
537//===----------------------------------------------------------------------===//
538// Header Search Options
539//===----------------------------------------------------------------------===//
540
Michael J. Spencerc6357102012-10-22 22:13:48 +0000541def nostdsysteminc : Flag<["-"], "nostdsysteminc">,
Daniel Dunbara268fc02011-10-11 18:20:10 +0000542 HelpText<"Disable standard system #include directories">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000543def fdisable_module_hash : Flag<["-"], "fdisable-module-hash">,
Douglas Gregor6e975c42011-09-13 23:15:45 +0000544 HelpText<"Disable the module hash">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000545def c_isystem : JoinedOrSeparate<["-"], "c-isystem">, MetaVarName<"<directory>">,
Benjamin Kramer47adebe2011-09-22 21:41:16 +0000546 HelpText<"Add directory to the C SYSTEM include search path">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000547def objc_isystem : JoinedOrSeparate<["-"], "objc-isystem">,
Benjamin Kramer47adebe2011-09-22 21:41:16 +0000548 MetaVarName<"<directory>">,
549 HelpText<"Add directory to the ObjC SYSTEM include search path">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000550def objcxx_isystem : JoinedOrSeparate<["-"], "objcxx-isystem">,
Benjamin Kramer47adebe2011-09-22 21:41:16 +0000551 MetaVarName<"<directory>">,
552 HelpText<"Add directory to the ObjC++ SYSTEM include search path">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000553def internal_isystem : JoinedOrSeparate<["-"], "internal-isystem">,
Chandler Carruthac2bc4d2011-11-05 08:30:29 +0000554 MetaVarName<"<directory>">,
555 HelpText<"Add directory to the internal system include search path; these "
556 "are assumed to not be user-provided and are used to model system "
557 "and standard headers' paths.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000558def internal_externc_isystem : JoinedOrSeparate<["-"], "internal-externc-isystem">,
Chandler Carruthac2bc4d2011-11-05 08:30:29 +0000559 MetaVarName<"<directory>">,
560 HelpText<"Add directory to the internal system include search path with "
561 "implicit extern \"C\" semantics; these are assumed to not be "
562 "user-provided and are used to model system and standard headers' "
563 "paths.">;
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000564
565//===----------------------------------------------------------------------===//
566// Preprocessor Options
567//===----------------------------------------------------------------------===//
568
Michael J. Spencerc6357102012-10-22 22:13:48 +0000569def include_pth : Separate<["-"], "include-pth">, MetaVarName<"<file>">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000570 HelpText<"Include file before parsing">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000571def chain_include : Separate<["-"], "chain-include">, MetaVarName<"<file>">,
Argyrios Kyrtzidisb0f4b9a2011-03-09 17:21:42 +0000572 HelpText<"Include and chain a header file after turning it into PCH">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000573def preamble_bytes_EQ : Joined<["-"], "preamble-bytes=">,
Douglas Gregor3d398aa2010-07-26 16:29:14 +0000574 HelpText<"Assume that the precompiled header is a precompiled preamble "
575 "covering the first N bytes of the main file">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000576def token_cache : Separate<["-"], "token-cache">, MetaVarName<"<path>">,
Daniel Dunbar33a33d82009-11-24 00:54:16 +0000577 HelpText<"Use specified token cache file">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000578def detailed_preprocessing_record : Flag<["-"], "detailed-preprocessing-record">,
Douglas Gregor94dc8f62010-03-19 16:15:56 +0000579 HelpText<"include a detailed record of preprocessing actions">;
Peter Collingbourne61e07862010-12-04 01:50:45 +0000580
581//===----------------------------------------------------------------------===//
582// OpenCL Options
583//===----------------------------------------------------------------------===//
584
Michael J. Spencerc6357102012-10-22 22:13:48 +0000585def cl_opt_disable : Flag<["-"], "cl-opt-disable">,
Peter Collingbourne61e07862010-12-04 01:50:45 +0000586 HelpText<"OpenCL only. This option disables all optimizations. The default is optimizations are enabled.">;
Stephen Hines0e2c34f2015-03-23 12:09:02 -0700587def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">,
588 HelpText<"OpenCL only. This option does nothing and is for compatibility with OpenCL 1.0">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000589def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">,
Peter Collingbourne09821362010-12-04 01:50:56 +0000590 HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000591def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">,
Peter Collingbourne5d729a32010-12-04 01:51:05 +0000592 HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">;
Stephen Hines651f13c2014-04-23 16:59:28 -0700593def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">,
594 HelpText<"OpenCL only. Generate kernel argument metadata.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000595def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">,
Peter Collingbourne5f67e132010-12-04 01:51:14 +0000596 HelpText<"OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000597def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">,
Peter Collingbournef0840822010-12-04 01:51:23 +0000598 HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000599def cl_mad_enable : Flag<["-"], "cl-mad-enable">,
Peter Collingbourne4400cb82010-12-04 01:51:33 +0000600 HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">;
Michael J. Spencerc6357102012-10-22 22:13:48 +0000601def cl_std_EQ : Joined<["-"], "cl-std=">,
Peter Collingbourne91252d12010-12-04 01:51:40 +0000602 HelpText<"OpenCL language standard to compile for">;
Stephen Hines176edba2014-12-01 14:53:08 -0800603def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">,
604 HelpText<"OpenCL only. Allow denormals to be flushed to zero">;
Peter Collingbourned51e43a2011-10-06 18:29:46 +0000605
606//===----------------------------------------------------------------------===//
607// CUDA Options
608//===----------------------------------------------------------------------===//
609
Michael J. Spencerc6357102012-10-22 22:13:48 +0000610def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
Peter Collingbourned51e43a2011-10-06 18:29:46 +0000611 HelpText<"Generate code for CUDA device">;
Stephen Hines0e2c34f2015-03-23 12:09:02 -0700612def fcuda_allow_host_calls_from_host_device : Flag<["-"],
613 "fcuda-allow-host-calls-from-host-device">,
614 HelpText<"Allow host device functions to call host functions">;
Pirama Arumuga Nainar33337ca2015-05-06 11:48:57 -0700615def fcuda_disable_target_call_checks : Flag<["-"],
616 "fcuda-disable-target-call-checks">,
617 HelpText<"Disable all cross-target (host, device, etc.) call checks in CUDA">;
James Molloybfd7a522012-05-01 14:57:16 +0000618
619} // let Flags = [CC1Option]
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700620
621
622//===----------------------------------------------------------------------===//
623// cc1as-only Options
624//===----------------------------------------------------------------------===//
625
626let Flags = [CC1AsOption, NoDriverOption] in {
627
628// Language Options
629def n : Flag<["-"], "n">,
630 HelpText<"Don't automatically start assembly file with a text section">;
631
632// Frontend Options
633def filetype : Separate<["-"], "filetype">,
634 HelpText<"Specify the output file type ('asm', 'null', or 'obj')">;
635
636// Transliterate Options
637def output_asm_variant : Separate<["-"], "output-asm-variant">,
638 HelpText<"Select the asm variant index to use for output">;
639def show_encoding : Flag<["-"], "show-encoding">,
640 HelpText<"Show instruction encoding information in transliterate mode">;
641def show_inst : Flag<["-"], "show-inst">,
642 HelpText<"Show internal instruction representation in transliterate mode">;
643
644// Assemble Options
645def dwarf_debug_producer : Separate<["-"], "dwarf-debug-producer">,
646 HelpText<"The string to embed in the Dwarf debug AT_producer record.">;
647
648} // let Flags = [CC1AsOption]