blob: 7596afadc8888be4037456763f052b9b129eb213 [file] [log] [blame]
Richard Smith081ad4d2017-01-24 19:39:46 +00001..
2 -------------------------------------------------------------------
3 NOTE: This file is automatically generated by running clang-tblgen
4 -gen-opt-docs. Do not edit this file by hand!!
5 -------------------------------------------------------------------
6
7=====================================
8Clang command line argument reference
9=====================================
10.. contents::
11 :local:
12
13Introduction
14============
15
16This page lists the command line arguments currently supported by the
17GCC-compatible ``clang`` and ``clang++`` drivers.
18
19
20.. program:: clang
Richard Smithc5b2e002017-01-27 02:08:37 +000021.. option:: -B<dir>, --prefix <arg>, --prefix=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +000022
Richard Smithc5b2e002017-01-27 02:08:37 +000023Add <dir> to search path for binaries and object files used implicitly
Richard Smith081ad4d2017-01-24 19:39:46 +000024
Richard Smith081ad4d2017-01-24 19:39:46 +000025.. option:: -F<arg>
26
27Add directory to framework include search path
28
Richard Smith081ad4d2017-01-24 19:39:46 +000029.. option:: -ObjC
30
31Treat source input files as Objective-C inputs
32
Richard Smithb2c82a62017-01-27 01:54:42 +000033.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +000034.. option:: -ObjC++
Richard Smithb2c82a62017-01-27 01:54:42 +000035.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +000036
37Treat source input files as Objective-C++ inputs
38
Richard Smith081ad4d2017-01-24 19:39:46 +000039.. option:: -Qunused-arguments
40
41Don't emit warning for unused driver arguments
42
Richard Smith081ad4d2017-01-24 19:39:46 +000043.. option:: -Wa,<arg>,<arg2>...
44
45Pass the comma separated arguments in <arg> to the assembler
46
Richard Smith081ad4d2017-01-24 19:39:46 +000047.. option:: -Wlarge-by-value-copy=<arg>
48
Richard Smith081ad4d2017-01-24 19:39:46 +000049.. option:: -Xarch\_<arg1> <arg2>
50
Richard Smith081ad4d2017-01-24 19:39:46 +000051.. option:: -Xcuda-fatbinary <arg>
52
53Pass <arg> to fatbinary invocation
54
Richard Smith081ad4d2017-01-24 19:39:46 +000055.. option:: -Xcuda-ptxas <arg>
56
57Pass <arg> to the ptxas assembler
58
Boris Kolpackovb150d242017-08-30 09:15:53 +000059.. option:: -Xopenmp-target <arg>
60
61Pass <arg> to the target offloading toolchain.
62
63.. program:: clang1
64.. option:: -Xopenmp-target=<arg> <arg2>
65.. program:: clang
66
67Pass <arg> to the specified target offloading toolchain. The triple that identifies the toolchain must be provided after the equals sign.
68
Richard Smith081ad4d2017-01-24 19:39:46 +000069.. option:: -Z<arg>
70
Richard Smith081ad4d2017-01-24 19:39:46 +000071.. option:: -a<arg>, --profile-blocks
72
Richard Smith081ad4d2017-01-24 19:39:46 +000073.. option:: -all\_load
74
Richard Smith081ad4d2017-01-24 19:39:46 +000075.. option:: -allowable\_client <arg>
76
Richard Smith081ad4d2017-01-24 19:39:46 +000077.. option:: --analyze
78
79Run the static analyzer
80
Richard Smith081ad4d2017-01-24 19:39:46 +000081.. option:: --analyze-auto
82
Richard Smith081ad4d2017-01-24 19:39:46 +000083.. option:: --analyzer-no-default-checks
84
Richard Smith081ad4d2017-01-24 19:39:46 +000085.. option:: --analyzer-output<arg>
86
87Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text).
88
Richard Smith081ad4d2017-01-24 19:39:46 +000089.. option:: -ansi, --ansi
90
Richard Smith081ad4d2017-01-24 19:39:46 +000091.. option:: -arch <arg>
92
Richard Smithb2c82a62017-01-27 01:54:42 +000093.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +000094.. option:: -arch\_errors\_fatal
Richard Smithb2c82a62017-01-27 01:54:42 +000095.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +000096
Richard Smithb2c82a62017-01-27 01:54:42 +000097.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +000098.. option:: -arch\_only <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +000099.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000100
Richard Smith081ad4d2017-01-24 19:39:46 +0000101.. option:: -arcmt-migrate-emit-errors
102
103Emit ARC errors even if the migrator can fix them
104
Richard Smith081ad4d2017-01-24 19:39:46 +0000105.. option:: -arcmt-migrate-report-output <arg>
106
107Output path for the plist report
108
Craig Topperd23254a2017-07-20 17:52:48 +0000109.. option:: --autocomplete=<arg>
110
Richard Smith081ad4d2017-01-24 19:39:46 +0000111.. option:: -bind\_at\_load
112
Richard Smith081ad4d2017-01-24 19:39:46 +0000113.. option:: -bundle
114
Richard Smithb2c82a62017-01-27 01:54:42 +0000115.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000116.. option:: -bundle\_loader <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000117.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000118
Richard Smith081ad4d2017-01-24 19:39:46 +0000119.. option:: -client\_name<arg>
120
Richard Smith081ad4d2017-01-24 19:39:46 +0000121.. option:: -compatibility\_version<arg>
122
Richard Smith081ad4d2017-01-24 19:39:46 +0000123.. option:: --constant-cfstrings
124
Richard Smith081ad4d2017-01-24 19:39:46 +0000125.. option:: -coverage, --coverage
126
Richard Smith081ad4d2017-01-24 19:39:46 +0000127.. option:: --cuda-compile-host-device
128
129Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations.
130
Richard Smith081ad4d2017-01-24 19:39:46 +0000131.. option:: --cuda-device-only
132
133Compile CUDA code for device only
134
Richard Smith081ad4d2017-01-24 19:39:46 +0000135.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
136
137CUDA GPU architecture (e.g. sm\_35). May be specified more than once.
138
Richard Smith081ad4d2017-01-24 19:39:46 +0000139.. option:: --cuda-host-only
140
141Compile CUDA code for host only. Has no effect on non-CUDA compilations.
142
Richard Smith081ad4d2017-01-24 19:39:46 +0000143.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
144
145Enable device-side debug info generation. Disables ptxas optimizations.
146
Richard Smith081ad4d2017-01-24 19:39:46 +0000147.. option:: -current\_version<arg>
148
Richard Smith081ad4d2017-01-24 19:39:46 +0000149.. option:: -dead\_strip
150
Richard Smith081ad4d2017-01-24 19:39:46 +0000151.. option:: -dependency-dot <arg>
152
153Filename to write DOT-formatted header dependencies to
154
Richard Smith081ad4d2017-01-24 19:39:46 +0000155.. option:: -dependency-file <arg>
156
157Filename (or -) to write dependency output to
158
Richard Smith081ad4d2017-01-24 19:39:46 +0000159.. option:: -dumpmachine
160
Richard Smith081ad4d2017-01-24 19:39:46 +0000161.. option:: -dumpversion
162
Richard Smith081ad4d2017-01-24 19:39:46 +0000163.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
164
Richard Smith081ad4d2017-01-24 19:39:46 +0000165.. option:: -dylib\_file <arg>
166
Richard Smith081ad4d2017-01-24 19:39:46 +0000167.. option:: -dylinker
168
Richard Smithb2c82a62017-01-27 01:54:42 +0000169.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000170.. option:: -dylinker\_install\_name<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000171.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000172
Richard Smith081ad4d2017-01-24 19:39:46 +0000173.. option:: -dynamic
174
Richard Smith081ad4d2017-01-24 19:39:46 +0000175.. option:: -dynamiclib
176
Richard Smith081ad4d2017-01-24 19:39:46 +0000177.. option:: -emit-ast
178
179Emit Clang AST files for source inputs
180
Richard Smith081ad4d2017-01-24 19:39:46 +0000181.. option:: -exported\_symbols\_list <arg>
182
Richard Smith081ad4d2017-01-24 19:39:46 +0000183.. option:: -faligned-new=<arg>
184
Richard Smith081ad4d2017-01-24 19:39:46 +0000185.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
186
187Use approximate transcendental functions
188
Richard Smith081ad4d2017-01-24 19:39:46 +0000189.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
190
191Flush denormal floating point values to zero in CUDA device mode.
192
Richard Smith081ad4d2017-01-24 19:39:46 +0000193.. option:: -fheinous-gnu-extensions
194
Richard Smith081ad4d2017-01-24 19:39:46 +0000195.. option:: -flat\_namespace
196
Richard Smith081ad4d2017-01-24 19:39:46 +0000197.. option:: -fopenmp-targets=<arg1>,<arg2>...
198
199Specify comma-separated list of triples OpenMP offloading targets to be supported
200
Richard Smith081ad4d2017-01-24 19:39:46 +0000201.. option:: -force\_cpusubtype\_ALL
202
Richard Smithb2c82a62017-01-27 01:54:42 +0000203.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000204.. option:: -force\_flat\_namespace
Richard Smithb2c82a62017-01-27 01:54:42 +0000205.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000206
Richard Smithb2c82a62017-01-27 01:54:42 +0000207.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000208.. option:: -force\_load <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000209.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000210
Richard Smith081ad4d2017-01-24 19:39:46 +0000211.. option:: -framework <arg>
212
Richard Smith78e23fd2017-04-13 22:39:49 +0000213.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
214
215Add -rpath with architecture-specific resource directory to the linker flags
216
Richard Smith081ad4d2017-01-24 19:39:46 +0000217.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
218
219Use the gcc toolchain at the given directory
220
Richard Smith081ad4d2017-01-24 19:39:46 +0000221.. option:: -gcodeview
222
223Generate CodeView debug information
224
Richard Smith081ad4d2017-01-24 19:39:46 +0000225.. option:: -headerpad\_max\_install\_names<arg>
226
Richard Smith081ad4d2017-01-24 19:39:46 +0000227.. option:: -help, --help
228
229Display available options
230
Richard Smith081ad4d2017-01-24 19:39:46 +0000231.. option:: --help-hidden
232
Richard Smith081ad4d2017-01-24 19:39:46 +0000233.. option:: -image\_base <arg>
234
Richard Smith081ad4d2017-01-24 19:39:46 +0000235.. option:: -index-header-map
236
237Make the next included directory (-I or -F) an indexer header map
238
Richard Smith081ad4d2017-01-24 19:39:46 +0000239.. option:: -init <arg>
240
Richard Smith081ad4d2017-01-24 19:39:46 +0000241.. option:: -install\_name <arg>
242
Richard Smith081ad4d2017-01-24 19:39:46 +0000243.. option:: -keep\_private\_externs
244
Richard Smith081ad4d2017-01-24 19:39:46 +0000245.. option:: -lazy\_framework <arg>
246
Richard Smithb2c82a62017-01-27 01:54:42 +0000247.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000248.. option:: -lazy\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000249.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000250
Richard Smith081ad4d2017-01-24 19:39:46 +0000251.. option:: -mbig-endian, -EB
252
Richard Smith081ad4d2017-01-24 19:39:46 +0000253.. option:: --migrate
254
255Run the migrator
256
Richard Smith78e23fd2017-04-13 22:39:49 +0000257.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
258
Richard Smith081ad4d2017-01-24 19:39:46 +0000259.. option:: -mlinker-version=<arg>
260
Richard Smith081ad4d2017-01-24 19:39:46 +0000261.. option:: -mlittle-endian, -EL
262
Richard Smith081ad4d2017-01-24 19:39:46 +0000263.. option:: -mllvm <arg>
264
265Additional arguments to forward to LLVM's option processing
266
Richard Smith081ad4d2017-01-24 19:39:46 +0000267.. option:: -module-dependency-dir <arg>
268
269Directory to dump module dependencies to
270
Richard Smith78e23fd2017-04-13 22:39:49 +0000271.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
272
Richard Smith081ad4d2017-01-24 19:39:46 +0000273.. option:: -multi\_module
274
Richard Smith081ad4d2017-01-24 19:39:46 +0000275.. option:: -multiply\_defined <arg>
276
Richard Smithb2c82a62017-01-27 01:54:42 +0000277.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000278.. option:: -multiply\_defined\_unused <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000279.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000280
Richard Smith78e23fd2017-04-13 22:39:49 +0000281.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
282
Richard Smith081ad4d2017-01-24 19:39:46 +0000283.. option:: --no-cuda-version-check
284
285Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
286
Richard Smith081ad4d2017-01-24 19:39:46 +0000287.. option:: -no-integrated-cpp, --no-integrated-cpp
288
Richard Smith081ad4d2017-01-24 19:39:46 +0000289.. option:: -no\_dead\_strip\_inits\_and\_terms
290
Richard Smith081ad4d2017-01-24 19:39:46 +0000291.. option:: -nobuiltininc
292
293Disable builtin #include directories
294
Richard Smith081ad4d2017-01-24 19:39:46 +0000295.. option:: -nocudainc
296
Richard Smith081ad4d2017-01-24 19:39:46 +0000297.. option:: -nocudalib
298
Richard Smith081ad4d2017-01-24 19:39:46 +0000299.. option:: -nodefaultlibs
300
Richard Smith081ad4d2017-01-24 19:39:46 +0000301.. option:: -nofixprebinding
302
Richard Smith081ad4d2017-01-24 19:39:46 +0000303.. option:: -nolibc
304
Richard Smith081ad4d2017-01-24 19:39:46 +0000305.. option:: -nomultidefs
306
Craig Topperd23254a2017-07-20 17:52:48 +0000307.. option:: -nopie, -no-pie
Richard Smith081ad4d2017-01-24 19:39:46 +0000308
Richard Smith081ad4d2017-01-24 19:39:46 +0000309.. option:: -noprebind
310
Richard Smith081ad4d2017-01-24 19:39:46 +0000311.. option:: -noseglinkedit
312
Richard Smith081ad4d2017-01-24 19:39:46 +0000313.. option:: -nostartfiles
314
Richard Smith081ad4d2017-01-24 19:39:46 +0000315.. option:: -nostdinc, --no-standard-includes
316
Richard Smithb2c82a62017-01-27 01:54:42 +0000317.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000318.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000319.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000320
321Disable standard #include directories for the C++ standard library
322
Richard Smith081ad4d2017-01-24 19:39:46 +0000323.. option:: -nostdlib, --no-standard-libraries
324
Boris Kolpackovb150d242017-08-30 09:15:53 +0000325.. program:: clang1
326.. option:: -nostdlib++
327.. program:: clang
328
Richard Smith081ad4d2017-01-24 19:39:46 +0000329.. option:: -nostdlibinc
330
Richard Smith081ad4d2017-01-24 19:39:46 +0000331.. option:: -o<file>, --output <arg>, --output=<arg>
332
333Write output to <file>
334
Richard Smith081ad4d2017-01-24 19:39:46 +0000335.. option:: -objcmt-atomic-property
336
337Make migration to 'atomic' properties
338
Richard Smith081ad4d2017-01-24 19:39:46 +0000339.. option:: -objcmt-migrate-all
340
341Enable migration to modern ObjC
342
Richard Smith081ad4d2017-01-24 19:39:46 +0000343.. option:: -objcmt-migrate-annotation
344
345Enable migration to property and method annotations
346
Richard Smith081ad4d2017-01-24 19:39:46 +0000347.. option:: -objcmt-migrate-designated-init
348
349Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
350
Richard Smith081ad4d2017-01-24 19:39:46 +0000351.. option:: -objcmt-migrate-instancetype
352
353Enable migration to infer instancetype for method result type
354
Richard Smith081ad4d2017-01-24 19:39:46 +0000355.. option:: -objcmt-migrate-literals
356
357Enable migration to modern ObjC literals
358
Richard Smith081ad4d2017-01-24 19:39:46 +0000359.. option:: -objcmt-migrate-ns-macros
360
361Enable migration to NS\_ENUM/NS\_OPTIONS macros
362
Richard Smith081ad4d2017-01-24 19:39:46 +0000363.. option:: -objcmt-migrate-property
364
365Enable migration to modern ObjC property
366
Richard Smith081ad4d2017-01-24 19:39:46 +0000367.. option:: -objcmt-migrate-property-dot-syntax
368
369Enable migration of setter/getter messages to property-dot syntax
370
Richard Smith081ad4d2017-01-24 19:39:46 +0000371.. option:: -objcmt-migrate-protocol-conformance
372
373Enable migration to add protocol conformance on classes
374
Richard Smith081ad4d2017-01-24 19:39:46 +0000375.. option:: -objcmt-migrate-readonly-property
376
377Enable migration to modern ObjC readonly property
378
Richard Smith081ad4d2017-01-24 19:39:46 +0000379.. option:: -objcmt-migrate-readwrite-property
380
381Enable migration to modern ObjC readwrite property
382
Richard Smith081ad4d2017-01-24 19:39:46 +0000383.. option:: -objcmt-migrate-subscripting
384
385Enable migration to modern ObjC subscripting
386
Richard Smith081ad4d2017-01-24 19:39:46 +0000387.. option:: -objcmt-ns-nonatomic-iosonly
388
389Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
390
Richard Smith081ad4d2017-01-24 19:39:46 +0000391.. option:: -objcmt-returns-innerpointer-property
392
393Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
394
Richard Smith081ad4d2017-01-24 19:39:46 +0000395.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
396
397Only modify files with a filename contained in the provided directory path
398
Richard Smith081ad4d2017-01-24 19:39:46 +0000399.. option:: -object
400
Richard Smith081ad4d2017-01-24 19:39:46 +0000401.. option:: -p, --profile
402
Richard Smith081ad4d2017-01-24 19:39:46 +0000403.. option:: -pagezero\_size<arg>
404
Richard Smith081ad4d2017-01-24 19:39:46 +0000405.. option:: -pg
406
407Enable mcount instrumentation
408
Richard Smith081ad4d2017-01-24 19:39:46 +0000409.. option:: -pie
410
Richard Smith081ad4d2017-01-24 19:39:46 +0000411.. option:: -pipe, --pipe
412
413Use pipes between commands, when possible
414
Richard Smith081ad4d2017-01-24 19:39:46 +0000415.. option:: -prebind
416
Richard Smithb2c82a62017-01-27 01:54:42 +0000417.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000418.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000419.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000420
Richard Smith081ad4d2017-01-24 19:39:46 +0000421.. option:: -preload
422
Richard Smith081ad4d2017-01-24 19:39:46 +0000423.. option:: --print-diagnostic-categories
424
Richard Smith081ad4d2017-01-24 19:39:46 +0000425.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
426
427Print the full library path of <file>
428
Richard Smith081ad4d2017-01-24 19:39:46 +0000429.. option:: -print-ivar-layout
430
431Enable Objective-C Ivar layout bitmap print trace
432
Richard Smith081ad4d2017-01-24 19:39:46 +0000433.. option:: -print-libgcc-file-name, --print-libgcc-file-name
434
435Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
436
Richard Smith081ad4d2017-01-24 19:39:46 +0000437.. option:: -print-multi-directory, --print-multi-directory
438
Richard Smith081ad4d2017-01-24 19:39:46 +0000439.. option:: -print-multi-lib, --print-multi-lib
440
Richard Smith081ad4d2017-01-24 19:39:46 +0000441.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
442
443Print the full program path of <name>
444
Richard Smith78e23fd2017-04-13 22:39:49 +0000445.. option:: -print-resource-dir, --print-resource-dir
446
447Print the resource directory pathname
448
Richard Smith081ad4d2017-01-24 19:39:46 +0000449.. option:: -print-search-dirs, --print-search-dirs
450
451Print the paths used for finding libraries and programs
452
Richard Smith081ad4d2017-01-24 19:39:46 +0000453.. option:: -private\_bundle
454
Richard Smith081ad4d2017-01-24 19:39:46 +0000455.. option:: -pthread, -no-pthread
456
457Support POSIX threads in generated code
458
Richard Smith081ad4d2017-01-24 19:39:46 +0000459.. option:: -pthreads
460
Richard Smith081ad4d2017-01-24 19:39:46 +0000461.. option:: -rdynamic
462
Richard Smith081ad4d2017-01-24 19:39:46 +0000463.. option:: -read\_only\_relocs <arg>
464
Richard Smith081ad4d2017-01-24 19:39:46 +0000465.. option:: -relocatable-pch, --relocatable-pch
466
467Whether to build a relocatable precompiled header
468
Richard Smith081ad4d2017-01-24 19:39:46 +0000469.. option:: -remap
470
Richard Smith081ad4d2017-01-24 19:39:46 +0000471.. option:: -rewrite-legacy-objc
472
473Rewrite Legacy Objective-C source to C++
474
Richard Smith081ad4d2017-01-24 19:39:46 +0000475.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
476
477Compiler runtime library to use
478
Richard Smith081ad4d2017-01-24 19:39:46 +0000479.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
480
481Save llvm statistics.
482
Richard Smith081ad4d2017-01-24 19:39:46 +0000483.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
484
485Save intermediate compilation results.
486
Richard Smith081ad4d2017-01-24 19:39:46 +0000487.. option:: -sectalign <arg1> <arg2> <arg3>
488
Richard Smith081ad4d2017-01-24 19:39:46 +0000489.. option:: -sectcreate <arg1> <arg2> <arg3>
490
Richard Smith081ad4d2017-01-24 19:39:46 +0000491.. option:: -sectobjectsymbols <arg1> <arg2>
492
Richard Smith081ad4d2017-01-24 19:39:46 +0000493.. option:: -sectorder <arg1> <arg2> <arg3>
494
Richard Smith081ad4d2017-01-24 19:39:46 +0000495.. option:: -seg1addr<arg>
496
Richard Smith081ad4d2017-01-24 19:39:46 +0000497.. option:: -seg\_addr\_table <arg>
498
Richard Smithb2c82a62017-01-27 01:54:42 +0000499.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000500.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000501.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000502
Richard Smith081ad4d2017-01-24 19:39:46 +0000503.. option:: -segaddr <arg1> <arg2>
504
Richard Smith081ad4d2017-01-24 19:39:46 +0000505.. option:: -segcreate <arg1> <arg2> <arg3>
506
Richard Smith081ad4d2017-01-24 19:39:46 +0000507.. option:: -seglinkedit
508
Richard Smith081ad4d2017-01-24 19:39:46 +0000509.. option:: -segprot <arg1> <arg2> <arg3>
510
Richard Smith081ad4d2017-01-24 19:39:46 +0000511.. option:: -segs\_read\_<arg>
512
Richard Smithb2c82a62017-01-27 01:54:42 +0000513.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000514.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000515.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000516
Richard Smithb2c82a62017-01-27 01:54:42 +0000517.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000518.. option:: -segs\_read\_write\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000519.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000520
Richard Smith081ad4d2017-01-24 19:39:46 +0000521.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
522
523Serialize compiler diagnostics to a file
524
Richard Smith081ad4d2017-01-24 19:39:46 +0000525.. option:: -shared, --shared
526
Richard Smith081ad4d2017-01-24 19:39:46 +0000527.. option:: -shared-libgcc
528
Craig Topper16418662017-11-20 18:07:43 +0000529.. option:: -shared-libsan, -shared-libasan
530
Richard Smith081ad4d2017-01-24 19:39:46 +0000531.. option:: -single\_module
532
Richard Smith081ad4d2017-01-24 19:39:46 +0000533.. option:: -specs=<arg>, --specs=<arg>
534
Richard Smith081ad4d2017-01-24 19:39:46 +0000535.. option:: -static, --static
536
Richard Smith081ad4d2017-01-24 19:39:46 +0000537.. option:: -static-libgcc
538
Craig Topper16418662017-11-20 18:07:43 +0000539.. option:: -static-libsan
540
Richard Smith081ad4d2017-01-24 19:39:46 +0000541.. option:: -static-libstdc++
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -std-default=<arg>
544
Richard Smith081ad4d2017-01-24 19:39:46 +0000545.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
546
547C++ standard library to use
548
Richard Smith081ad4d2017-01-24 19:39:46 +0000549.. option:: -sub\_library<arg>
550
Richard Smithb2c82a62017-01-27 01:54:42 +0000551.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000552.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000553.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000554
Richard Smith081ad4d2017-01-24 19:39:46 +0000555.. option:: --sysroot=<arg>, --sysroot <arg>
556
Richard Smith081ad4d2017-01-24 19:39:46 +0000557.. option:: --target-help
558
Richard Smith081ad4d2017-01-24 19:39:46 +0000559.. option:: --target=<arg>, -target <arg>
560
561Generate code for the given target
562
Richard Smith081ad4d2017-01-24 19:39:46 +0000563.. option:: -time
564
565Time individual commands
566
Richard Smith081ad4d2017-01-24 19:39:46 +0000567.. option:: -traditional, --traditional
568
Richard Smith081ad4d2017-01-24 19:39:46 +0000569.. option:: -traditional-cpp, --traditional-cpp
570
571Enable some traditional CPP emulation
572
Richard Smith081ad4d2017-01-24 19:39:46 +0000573.. option:: -twolevel\_namespace
574
Richard Smithb2c82a62017-01-27 01:54:42 +0000575.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000576.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000577.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000578
Richard Smith081ad4d2017-01-24 19:39:46 +0000579.. option:: -umbrella <arg>
580
Richard Smith081ad4d2017-01-24 19:39:46 +0000581.. option:: -unexported\_symbols\_list <arg>
582
Richard Smith081ad4d2017-01-24 19:39:46 +0000583.. option:: -v, --verbose
584
585Show commands to run and use verbose output
586
Richard Smith081ad4d2017-01-24 19:39:46 +0000587.. option:: --verify-debug-info
588
589Verify the binary representation of debug output
590
Richard Smith081ad4d2017-01-24 19:39:46 +0000591.. option:: --version
592
Craig Topper16418662017-11-20 18:07:43 +0000593Print version information
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -w, --no-warnings
596
597Suppress all warnings
598
Richard Smith081ad4d2017-01-24 19:39:46 +0000599.. option:: -weak-l<arg>
600
Richard Smith081ad4d2017-01-24 19:39:46 +0000601.. option:: -weak\_framework <arg>
602
Richard Smithb2c82a62017-01-27 01:54:42 +0000603.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000604.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000605.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000606
Richard Smithb2c82a62017-01-27 01:54:42 +0000607.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000608.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000609.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000610
Richard Smith081ad4d2017-01-24 19:39:46 +0000611.. option:: -whatsloaded
612
Richard Smith081ad4d2017-01-24 19:39:46 +0000613.. option:: -whyload
614
Richard Smith081ad4d2017-01-24 19:39:46 +0000615.. option:: -working-directory<arg>, -working-directory=<arg>
616
617Resolve file paths relative to the specified directory
618
Richard Smith081ad4d2017-01-24 19:39:46 +0000619.. option:: -x<language>, --language <arg>, --language=<arg>
620
621Treat subsequent input files as having type <language>
622
Richard Smith081ad4d2017-01-24 19:39:46 +0000623.. option:: -y<arg>
624
625Actions
626=======
627The action to perform on the input.
628
Richard Smith081ad4d2017-01-24 19:39:46 +0000629.. option:: -E, --preprocess
630
631Only run the preprocessor
632
Richard Smith081ad4d2017-01-24 19:39:46 +0000633.. option:: -S, --assemble
634
635Only run preprocess and compilation steps
636
Richard Smithc5b2e002017-01-27 02:08:37 +0000637.. option:: -c, --compile
638
639Only run preprocess, compile, and assemble steps
640
Richard Smith081ad4d2017-01-24 19:39:46 +0000641.. option:: -emit-llvm
642
643Use the LLVM representation for assembler and object files
644
Richard Smith081ad4d2017-01-24 19:39:46 +0000645.. option:: -fsyntax-only
646
Richard Smith081ad4d2017-01-24 19:39:46 +0000647.. option:: -module-file-info
648
649Provide information about a particular module file
650
Richard Smith081ad4d2017-01-24 19:39:46 +0000651.. option:: --precompile
652
653Only precompile the input
654
Richard Smith081ad4d2017-01-24 19:39:46 +0000655.. option:: -rewrite-objc
656
657Rewrite Objective-C source to C++
658
Richard Smith081ad4d2017-01-24 19:39:46 +0000659.. option:: -verify-pch
660
661Load and verify that a pre-compiled header file is not stale
662
663Compilation flags
664=================
665
666Flags controlling the behavior of Clang during compilation. These flags have
667no effect during actions that do not perform compilation.
668
Richard Smithc5b2e002017-01-27 02:08:37 +0000669.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000670
Richard Smithc5b2e002017-01-27 02:08:37 +0000671Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000672
Richard Smith081ad4d2017-01-24 19:39:46 +0000673.. option:: -Xclang <arg>
674
675Pass <arg> to the clang compiler
676
Boris Kolpackovb150d242017-08-30 09:15:53 +0000677.. option:: -fclang-abi-compat=<version>
678
679Attempt to match the ABI of Clang <version>
680
Richard Smith081ad4d2017-01-24 19:39:46 +0000681.. option:: -fcomment-block-commands=<arg>,<arg2>...
682
683Treat each comma separated argument in <arg> as a documentation comment block command
684
Richard Smith081ad4d2017-01-24 19:39:46 +0000685.. option:: -fdeclspec, -fno-declspec
686
687Allow \_\_declspec as a keyword
688
Richard Smith081ad4d2017-01-24 19:39:46 +0000689.. option:: -fdepfile-entry=<arg>
690
Richard Smith081ad4d2017-01-24 19:39:46 +0000691.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
692
Richard Smith081ad4d2017-01-24 19:39:46 +0000693.. option:: -fdiagnostics-format=<arg>
694
Richard Smith081ad4d2017-01-24 19:39:46 +0000695.. option:: -fdiagnostics-parseable-fixits
696
697Print fix-its in machine parseable form
698
Richard Smith081ad4d2017-01-24 19:39:46 +0000699.. option:: -fdiagnostics-print-source-range-info
700
701Print source range spans in numeric form
702
Richard Smith081ad4d2017-01-24 19:39:46 +0000703.. option:: -fdiagnostics-show-category=<arg>
704
Richard Smith081ad4d2017-01-24 19:39:46 +0000705.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
706
707Enables an experimental new pass manager in LLVM.
708
Craig Topper16418662017-11-20 18:07:43 +0000709.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
710
711Use separate accesses for bitfields with legal widths and alignments.
712
Richard Smith081ad4d2017-01-24 19:39:46 +0000713.. option:: -finline-functions, -fno-inline-functions
714
715Inline suitable functions
716
Richard Smith081ad4d2017-01-24 19:39:46 +0000717.. option:: -finline-hint-functions
718
719Inline functions which are (explicitly or implicitly) marked inline
720
Richard Smith081ad4d2017-01-24 19:39:46 +0000721.. option:: -fno-crash-diagnostics
722
Richard Smith78e23fd2017-04-13 22:39:49 +0000723Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
724
Richard Smith081ad4d2017-01-24 19:39:46 +0000725.. option:: -fno-sanitize-blacklist
726
727Don't use blacklist file for sanitizers
728
Richard Smith081ad4d2017-01-24 19:39:46 +0000729.. option:: -fparse-all-comments
730
Richard Smith081ad4d2017-01-24 19:39:46 +0000731.. option:: -fsanitize-address-field-padding=<arg>
732
733Level of field padding for AddressSanitizer
734
Craig Topperd23254a2017-07-20 17:52:48 +0000735.. option:: -fsanitize-address-globals-dead-stripping
736
737Enable linker dead stripping of globals in AddressSanitizer
738
Richard Smith081ad4d2017-01-24 19:39:46 +0000739.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
740
741Enable use-after-scope detection in AddressSanitizer
742
Richard Smith081ad4d2017-01-24 19:39:46 +0000743.. option:: -fsanitize-blacklist=<arg>
744
745Path to blacklist file for sanitizers
746
Richard Smith081ad4d2017-01-24 19:39:46 +0000747.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
748
749Enable control flow integrity (CFI) checks for cross-DSO calls.
750
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000751.. option:: -fsanitize-cfi-icall-generalize-pointers
752
Craig Topper16418662017-11-20 18:07:43 +0000753Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000754
Richard Smith081ad4d2017-01-24 19:39:46 +0000755.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
756
757Specify the type of coverage instrumentation for Sanitizers
758
Richard Smith081ad4d2017-01-24 19:39:46 +0000759.. option:: -fsanitize-link-c++-runtime
760
Richard Smith081ad4d2017-01-24 19:39:46 +0000761.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
762
763Enable origins tracking in MemorySanitizer
764
Richard Smithb2c82a62017-01-27 01:54:42 +0000765.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000766.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000767.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000768
769Enable origins tracking in MemorySanitizer
770
Craig Topper16418662017-11-20 18:07:43 +0000771.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000772
773Enable use-after-destroy detection in MemorySanitizer
774
Boris Kolpackovb150d242017-08-30 09:15:53 +0000775.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
776
Richard Smith081ad4d2017-01-24 19:39:46 +0000777.. option:: -fsanitize-recover, -fno-sanitize-recover
778
Richard Smithb2c82a62017-01-27 01:54:42 +0000779.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000780.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +0000781.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000782
783Enable recovery for specified sanitizers
784
Richard Smith081ad4d2017-01-24 19:39:46 +0000785.. option:: -fsanitize-stats, -fno-sanitize-stats
786
787Enable sanitizer statistics gathering.
788
Richard Smith081ad4d2017-01-24 19:39:46 +0000789.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
790
791Enable atomic operations instrumentation in ThreadSanitizer (default)
792
Richard Smith081ad4d2017-01-24 19:39:46 +0000793.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
794
795Enable function entry/exit instrumentation in ThreadSanitizer (default)
796
Richard Smith081ad4d2017-01-24 19:39:46 +0000797.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
798
799Enable memory access instrumentation in ThreadSanitizer (default)
800
Richard Smith081ad4d2017-01-24 19:39:46 +0000801.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
802
803Enable trapping for specified sanitizers
804
Richard Smith081ad4d2017-01-24 19:39:46 +0000805.. option:: -fsanitize-undefined-strip-path-components=<number>
806
807Strip (or keep only, if negative) a given number of path components when emitting check metadata.
808
Richard Smith081ad4d2017-01-24 19:39:46 +0000809.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
810
Richard Smith081ad4d2017-01-24 19:39:46 +0000811.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
812
813Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
814
Richard Smith081ad4d2017-01-24 19:39:46 +0000815.. option:: --param <arg>, --param=<arg>
816
Richard Smith081ad4d2017-01-24 19:39:46 +0000817.. option:: -std=<arg>, --std=<arg>, --std <arg>
818
819Language standard to compile for
820
Richard Smithc5b2e002017-01-27 02:08:37 +0000821Preprocessor flags
822~~~~~~~~~~~~~~~~~~
823
824Flags controlling the behavior of the Clang preprocessor.
825
826.. option:: -C, --comments
827
828Include comments in preprocessed output
829
830.. option:: -CC, --comments-in-macros
831
832Include comments from within macros in preprocessed output
833
834.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
835
836Define <macro> to <value> (or 1 if <value> omitted)
837
838.. option:: -H, --trace-includes
839
840Show header includes and nesting depth
841
842.. option:: -P, --no-line-commands
843
844Disable linemarker output in -E mode
845
846.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
847
848Undefine macro <macro>
849
850.. option:: -Wp,<arg>,<arg2>...
851
852Pass the comma separated arguments in <arg> to the preprocessor
853
854.. option:: -Xpreprocessor <arg>
855
856Pass <arg> to the preprocessor
857
Richard Smith081ad4d2017-01-24 19:39:46 +0000858Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +0000859-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +0000860
861Flags controlling how ``#include``\s are resolved to files.
862
Richard Smithc5b2e002017-01-27 02:08:37 +0000863.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000864
865Add directory to include search path
866
Richard Smith081ad4d2017-01-24 19:39:46 +0000867.. option:: -I-, --include-barrier
868
Richard Smithc5b2e002017-01-27 02:08:37 +0000869Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
870
Richard Smith081ad4d2017-01-24 19:39:46 +0000871.. option:: --cuda-path=<arg>
872
873CUDA installation path
874
Richard Smith081ad4d2017-01-24 19:39:46 +0000875.. option:: -cxx-isystem<directory>
876
877Add directory to the C++ SYSTEM include search path
878
Richard Smith081ad4d2017-01-24 19:39:46 +0000879.. option:: -fbuild-session-file=<file>
880
881Use the last modification time of <file> as the build session timestamp
882
Richard Smith081ad4d2017-01-24 19:39:46 +0000883.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
884
885Time when the current build session started
886
Boris Kolpackovb150d242017-08-30 09:15:53 +0000887.. option:: -fmodule-file=\[<name>=\]<file>
888
889Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
890
Richard Smith081ad4d2017-01-24 19:39:46 +0000891.. option:: -fmodules-cache-path=<directory>
892
893Specify the module cache path
894
Richard Smith081ad4d2017-01-24 19:39:46 +0000895.. option:: -fmodules-disable-diagnostic-validation
896
897Disable validation of the diagnostic options when loading the module
898
Richard Smith081ad4d2017-01-24 19:39:46 +0000899.. option:: -fmodules-prune-after=<seconds>
900
901Specify the interval (in seconds) after which a module file will be considered unused
902
Richard Smith081ad4d2017-01-24 19:39:46 +0000903.. option:: -fmodules-prune-interval=<seconds>
904
905Specify the interval (in seconds) between attempts to prune the module cache
906
Richard Smith081ad4d2017-01-24 19:39:46 +0000907.. option:: -fmodules-user-build-path <directory>
908
909Specify the module user build path
910
Richard Smith081ad4d2017-01-24 19:39:46 +0000911.. option:: -fmodules-validate-once-per-build-session
912
913Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
914
Richard Smith081ad4d2017-01-24 19:39:46 +0000915.. option:: -fmodules-validate-system-headers
916
917Validate the system headers that a module depends on when loading the module
918
Richard Smith081ad4d2017-01-24 19:39:46 +0000919.. option:: -fprebuilt-module-path=<directory>
920
921Specify the prebuilt module path
922
Richard Smith081ad4d2017-01-24 19:39:46 +0000923.. option:: -i<arg>
924
Richard Smith081ad4d2017-01-24 19:39:46 +0000925.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
926
927Add directory to AFTER include search path
928
Richard Smith081ad4d2017-01-24 19:39:46 +0000929.. option:: -iframework<arg>
930
931Add directory to SYSTEM framework search path
932
Richard Smith78e23fd2017-04-13 22:39:49 +0000933.. option:: -iframeworkwithsysroot<directory>
934
935Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
936
Richard Smith081ad4d2017-01-24 19:39:46 +0000937.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
938
939Include macros from file before parsing
940
Richard Smith081ad4d2017-01-24 19:39:46 +0000941.. option:: -include<file>, --include<file>, --include=<arg>
942
943Include file before parsing
944
Richard Smith081ad4d2017-01-24 19:39:46 +0000945.. option:: -include-pch <file>
946
947Include precompiled header file
948
Richard Smith081ad4d2017-01-24 19:39:46 +0000949.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
950
951Set the -iwithprefix/-iwithprefixbefore prefix
952
Richard Smith081ad4d2017-01-24 19:39:46 +0000953.. option:: -iquote<directory>
954
955Add directory to QUOTE include search path
956
Richard Smith081ad4d2017-01-24 19:39:46 +0000957.. option:: -isysroot<dir>
958
959Set the system root directory (usually /)
960
Richard Smith081ad4d2017-01-24 19:39:46 +0000961.. option:: -isystem<directory>
962
963Add directory to SYSTEM include search path
964
Richard Smith081ad4d2017-01-24 19:39:46 +0000965.. option:: -isystem-after<directory>
966
967Add directory to end of the SYSTEM include search path
968
Richard Smith081ad4d2017-01-24 19:39:46 +0000969.. option:: -ivfsoverlay<arg>
970
971Overlay the virtual filesystem described by file over the real file system
972
Richard Smith081ad4d2017-01-24 19:39:46 +0000973.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
974
975Set directory to SYSTEM include search path with prefix
976
Richard Smith081ad4d2017-01-24 19:39:46 +0000977.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
978
979Set directory to include search path with prefix
980
Richard Smith081ad4d2017-01-24 19:39:46 +0000981.. option:: -iwithsysroot<directory>
982
983Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
984
Richard Smith081ad4d2017-01-24 19:39:46 +0000985.. option:: --ptxas-path=<arg>
986
987Path to ptxas (used for compiling CUDA code)
988
Richard Smith081ad4d2017-01-24 19:39:46 +0000989.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
990
991Treat all #include paths starting with <prefix> as including a system header.
992
993Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +0000994--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +0000995
996Flags controlling generation of a dependency file for ``make``-like build
997systems.
998
Richard Smith081ad4d2017-01-24 19:39:46 +0000999.. option:: -M, --dependencies
1000
1001Like -MD, but also implies -E and writes to stdout by default
1002
Richard Smith081ad4d2017-01-24 19:39:46 +00001003.. option:: -MD, --write-dependencies
1004
1005Write a depfile containing user and system headers
1006
Richard Smith081ad4d2017-01-24 19:39:46 +00001007.. option:: -MF<file>
1008
1009Write depfile output from -MMD, -MD, -MM, or -M to <file>
1010
Richard Smith081ad4d2017-01-24 19:39:46 +00001011.. option:: -MG, --print-missing-file-dependencies
1012
1013Add missing headers to depfile
1014
Richard Smith081ad4d2017-01-24 19:39:46 +00001015.. option:: -MJ<arg>
1016
1017Write a compilation database entry per input
1018
Richard Smith081ad4d2017-01-24 19:39:46 +00001019.. option:: -MM, --user-dependencies
1020
1021Like -MMD, but also implies -E and writes to stdout by default
1022
Richard Smith081ad4d2017-01-24 19:39:46 +00001023.. option:: -MMD, --write-user-dependencies
1024
1025Write a depfile containing user headers
1026
Richard Smith081ad4d2017-01-24 19:39:46 +00001027.. option:: -MP
1028
1029Create phony target for each dependency (other than main file)
1030
Richard Smith081ad4d2017-01-24 19:39:46 +00001031.. option:: -MQ<arg>
1032
1033Specify name of main file output to quote in depfile
1034
Richard Smith081ad4d2017-01-24 19:39:46 +00001035.. option:: -MT<arg>
1036
1037Specify name of main file output in depfile
1038
Richard Smith081ad4d2017-01-24 19:39:46 +00001039.. option:: -MV
1040
1041Use NMake/Jom format for the depfile
1042
1043Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001044--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001045
1046Flags allowing the state of the preprocessor to be dumped in various ways.
1047
Richard Smith081ad4d2017-01-24 19:39:46 +00001048.. option:: -d
1049
Richard Smithb2c82a62017-01-27 01:54:42 +00001050.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001051.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001052.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001053
Richard Smith081ad4d2017-01-24 19:39:46 +00001054.. option:: -dA
1055
Richard Smith081ad4d2017-01-24 19:39:46 +00001056.. option:: -dD
1057
1058Print macro definitions in -E mode in addition to normal output
1059
Richard Smith081ad4d2017-01-24 19:39:46 +00001060.. option:: -dI
1061
1062Print include directives in -E mode in addition to normal output
1063
Richard Smith081ad4d2017-01-24 19:39:46 +00001064.. option:: -dM
1065
1066Print macro definitions in -E mode instead of normal output
1067
1068Diagnostic flags
1069~~~~~~~~~~~~~~~~
1070
1071Flags controlling which warnings, errors, and remarks Clang will generate.
1072See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1073
Richard Smith081ad4d2017-01-24 19:39:46 +00001074.. option:: -R<remark>
1075
1076Enable the specified remark
1077
Richard Smith081ad4d2017-01-24 19:39:46 +00001078.. option:: -Rpass-analysis=<arg>
1079
1080Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1081
Richard Smith081ad4d2017-01-24 19:39:46 +00001082.. option:: -Rpass-missed=<arg>
1083
1084Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1085
Richard Smith081ad4d2017-01-24 19:39:46 +00001086.. option:: -Rpass=<arg>
1087
1088Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1089
Richard Smith081ad4d2017-01-24 19:39:46 +00001090.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1091
1092Enable the specified warning
1093
Richard Smith081ad4d2017-01-24 19:39:46 +00001094.. option:: -Wdeprecated, -Wno-deprecated
1095
Richard Smithc5b2e002017-01-27 02:08:37 +00001096Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001097
Richard Smith081ad4d2017-01-24 19:39:46 +00001098.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1099
Richard Smith081ad4d2017-01-24 19:39:46 +00001100Target-independent compilation options
1101~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001102.. option:: -Wframe-larger-than=<arg>
1103
Richard Smith081ad4d2017-01-24 19:39:46 +00001104.. option:: -fPIC, -fno-PIC
1105
Richard Smith081ad4d2017-01-24 19:39:46 +00001106.. option:: -fPIE, -fno-PIE
1107
Richard Smith081ad4d2017-01-24 19:39:46 +00001108.. option:: -faccess-control, -fno-access-control
1109
Richard Smithb2c82a62017-01-27 01:54:42 +00001110.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001111.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001112.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001113
1114Enable C++17 aligned allocation functions
1115
Craig Topperd23254a2017-07-20 17:52:48 +00001116.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1117
1118Treat editor placeholders as valid source code
1119
Richard Smith081ad4d2017-01-24 19:39:46 +00001120.. option:: -fallow-unsupported
1121
Richard Smith78e23fd2017-04-13 22:39:49 +00001122.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001123
Richard Smith081ad4d2017-01-24 19:39:46 +00001124.. option:: -fansi-escape-codes
1125
1126Use ANSI escape codes for diagnostics
1127
Richard Smith081ad4d2017-01-24 19:39:46 +00001128.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1129
1130Use Apple's kernel extensions ABI
1131
Richard Smith081ad4d2017-01-24 19:39:46 +00001132.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1133
1134Enable Apple gcc-compatible #pragma pack handling
1135
Richard Smith081ad4d2017-01-24 19:39:46 +00001136.. option:: -fapplication-extension, -fno-application-extension
1137
1138Restrict code to those available for App Extensions
1139
Richard Smith081ad4d2017-01-24 19:39:46 +00001140.. option:: -fasm, -fno-asm
1141
Richard Smith081ad4d2017-01-24 19:39:46 +00001142.. option:: -fasm-blocks, -fno-asm-blocks
1143
Richard Smith081ad4d2017-01-24 19:39:46 +00001144.. option:: -fassociative-math, -fno-associative-math
1145
Richard Smith081ad4d2017-01-24 19:39:46 +00001146.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1147
Richard Smith081ad4d2017-01-24 19:39:46 +00001148.. option:: -fast
1149
Richard Smith081ad4d2017-01-24 19:39:46 +00001150.. option:: -fastcp
1151
Richard Smith081ad4d2017-01-24 19:39:46 +00001152.. option:: -fastf
1153
Richard Smith081ad4d2017-01-24 19:39:46 +00001154.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1155
Richard Smith081ad4d2017-01-24 19:39:46 +00001156.. option:: -fautolink, -fno-autolink
1157
Richard Smith081ad4d2017-01-24 19:39:46 +00001158.. option:: -fblocks, -fno-blocks
1159
1160Enable the 'blocks' language feature
1161
Richard Smith081ad4d2017-01-24 19:39:46 +00001162.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1163
Richard Smith081ad4d2017-01-24 19:39:46 +00001164.. option:: -fborland-extensions, -fno-borland-extensions
1165
1166Accept non-standard constructs supported by the Borland compiler
1167
Richard Smith081ad4d2017-01-24 19:39:46 +00001168.. option:: -fbracket-depth=<arg>
1169
Richard Smith081ad4d2017-01-24 19:39:46 +00001170.. option:: -fbuiltin, -fno-builtin
1171
Richard Smith081ad4d2017-01-24 19:39:46 +00001172.. option:: -fbuiltin-module-map
1173
1174Load the clang builtins module map file.
1175
Richard Smith081ad4d2017-01-24 19:39:46 +00001176.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1177
Richard Smith081ad4d2017-01-24 19:39:46 +00001178.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1179
Richard Smith081ad4d2017-01-24 19:39:46 +00001180.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1181
1182Use colors in diagnostics
1183
Richard Smith081ad4d2017-01-24 19:39:46 +00001184.. option:: -fcommon, -fno-common
1185
Richard Smith081ad4d2017-01-24 19:39:46 +00001186.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1187
Richard Smith081ad4d2017-01-24 19:39:46 +00001188.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1189
Richard Smith081ad4d2017-01-24 19:39:46 +00001190.. option:: -fconstant-string-class=<arg>
1191
Richard Smith081ad4d2017-01-24 19:39:46 +00001192.. option:: -fconstexpr-backtrace-limit=<arg>
1193
Richard Smith081ad4d2017-01-24 19:39:46 +00001194.. option:: -fconstexpr-depth=<arg>
1195
Richard Smith081ad4d2017-01-24 19:39:46 +00001196.. option:: -fconstexpr-steps=<arg>
1197
Richard Smith081ad4d2017-01-24 19:39:46 +00001198.. option:: -fcoroutines-ts, -fno-coroutines-ts
1199
1200Enable support for the C++ Coroutines TS
1201
Richard Smith081ad4d2017-01-24 19:39:46 +00001202.. option:: -fcoverage-mapping, -fno-coverage-mapping
1203
1204Generate coverage mapping to enable code coverage analysis
1205
Richard Smith081ad4d2017-01-24 19:39:46 +00001206.. option:: -fcreate-profile
1207
Richard Smith081ad4d2017-01-24 19:39:46 +00001208.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1209
1210Enable C++ exceptions
1211
Richard Smith081ad4d2017-01-24 19:39:46 +00001212.. option:: -fcxx-modules, -fno-cxx-modules
1213
Richard Smith081ad4d2017-01-24 19:39:46 +00001214.. option:: -fdata-sections, -fno-data-sections
1215
1216Place each data in its own section (ELF Only)
1217
Richard Smith081ad4d2017-01-24 19:39:46 +00001218.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1219
1220Emit extra debug info to make sample profile more accurate.
1221
Richard Smith78e23fd2017-04-13 22:39:49 +00001222.. option:: -fdebug-macro, -fno-debug-macro
1223
1224Emit macro debug information
1225
Richard Smith081ad4d2017-01-24 19:39:46 +00001226.. option:: -fdebug-pass-arguments
1227
Richard Smith081ad4d2017-01-24 19:39:46 +00001228.. option:: -fdebug-pass-structure
1229
Richard Smith081ad4d2017-01-24 19:39:46 +00001230.. option:: -fdebug-prefix-map=<arg>
1231
1232remap file source paths in debug info
1233
Richard Smith081ad4d2017-01-24 19:39:46 +00001234.. option:: -fdebug-types-section, -fno-debug-types-section
1235
1236Place debug types in their own section (ELF Only)
1237
Richard Smith081ad4d2017-01-24 19:39:46 +00001238.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1239
1240Parse templated function definitions at the end of the translation unit
1241
Richard Smith081ad4d2017-01-24 19:39:46 +00001242.. option:: -fdenormal-fp-math=<arg>
1243
Richard Smith081ad4d2017-01-24 19:39:46 +00001244.. option:: -fdiagnostics-absolute-paths
1245
1246Print absolute paths in diagnostics
1247
Richard Smith081ad4d2017-01-24 19:39:46 +00001248.. option:: -fdiagnostics-color, -fno-diagnostics-color
1249
Richard Smithb2c82a62017-01-27 01:54:42 +00001250.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001251.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001252.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001253
Craig Topperd23254a2017-07-20 17:52:48 +00001254.. option:: -fdiagnostics-hotness-threshold=<number>
1255
1256Prevent optimization remarks from being output if they do not have at least this profile count
1257
Richard Smith081ad4d2017-01-24 19:39:46 +00001258.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1259
1260Enable profile hotness information in diagnostic line
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1263
1264Display include stacks for diagnostic notes
1265
Richard Smith081ad4d2017-01-24 19:39:46 +00001266.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1267
1268Print option name with mappable diagnostics
1269
Richard Smith081ad4d2017-01-24 19:39:46 +00001270.. option:: -fdiagnostics-show-template-tree
1271
1272Print a template comparison tree for differing templates
1273
Richard Smith081ad4d2017-01-24 19:39:46 +00001274.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1275
1276Allow '$' in identifiers
1277
Craig Topper16418662017-11-20 18:07:43 +00001278.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1279
1280Enable '\[\[\]\]' attributes in all C and C++ language modes
1281
Richard Smith081ad4d2017-01-24 19:39:46 +00001282.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1283
Richard Smith081ad4d2017-01-24 19:39:46 +00001284.. option:: -felide-constructors, -fno-elide-constructors
1285
Richard Smith081ad4d2017-01-24 19:39:46 +00001286.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1287
Richard Smith081ad4d2017-01-24 19:39:46 +00001288.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1289
1290Embed LLVM bitcode (option: off, all, bitcode, marker)
1291
Richard Smith081ad4d2017-01-24 19:39:46 +00001292.. option:: -femit-all-decls
1293
1294Emit all declarations, even if unused
1295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -femulated-tls, -fno-emulated-tls
1297
1298Use emutls functions to access thread\_local variables
1299
Richard Smith081ad4d2017-01-24 19:39:46 +00001300.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1301
Richard Smith081ad4d2017-01-24 19:39:46 +00001302.. option:: -ferror-limit=<arg>
1303
Richard Smith081ad4d2017-01-24 19:39:46 +00001304.. option:: -fexceptions, -fno-exceptions
1305
1306Enable support for exception handling
1307
Richard Smith081ad4d2017-01-24 19:39:46 +00001308.. option:: -fexec-charset=<arg>
1309
Richard Smith081ad4d2017-01-24 19:39:46 +00001310.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1311
Richard Smith081ad4d2017-01-24 19:39:46 +00001312.. option:: -ffast-math, -fno-fast-math
1313
1314Allow aggressive, lossy floating-point optimizations
1315
Richard Smith081ad4d2017-01-24 19:39:46 +00001316.. option:: -ffinite-math-only, -fno-finite-math-only
1317
Richard Smith081ad4d2017-01-24 19:39:46 +00001318.. option:: -ffor-scope, -fno-for-scope
1319
Richard Smith081ad4d2017-01-24 19:39:46 +00001320.. option:: -ffp-contract=<arg>
1321
1322Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1323
Richard Smith081ad4d2017-01-24 19:39:46 +00001324.. option:: -ffreestanding
1325
1326Assert that the compilation takes place in a freestanding environment
1327
Richard Smith081ad4d2017-01-24 19:39:46 +00001328.. option:: -ffunction-sections, -fno-function-sections
1329
1330Place each function in its own section (ELF Only)
1331
Richard Smith081ad4d2017-01-24 19:39:46 +00001332.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1333
Richard Smith081ad4d2017-01-24 19:39:46 +00001334.. option:: -fgnu-keywords, -fno-gnu-keywords
1335
1336Allow GNU-extension keywords regardless of language standard
1337
Richard Smith081ad4d2017-01-24 19:39:46 +00001338.. option:: -fgnu-runtime
1339
1340Generate output compatible with the standard GNU Objective-C runtime
1341
Richard Smith081ad4d2017-01-24 19:39:46 +00001342.. option:: -fgnu89-inline, -fno-gnu89-inline
1343
1344Use the gnu89 inline semantics
1345
Richard Smith081ad4d2017-01-24 19:39:46 +00001346.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fhonor-nans, -fno-honor-nans
1349
Richard Smith081ad4d2017-01-24 19:39:46 +00001350.. option:: -fhosted
1351
Richard Smith081ad4d2017-01-24 19:39:46 +00001352.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1353
1354Implicitly search the file system for module map files.
1355
Richard Smith081ad4d2017-01-24 19:39:46 +00001356.. option:: -fimplicit-modules, -fno-implicit-modules
1357
Richard Smith081ad4d2017-01-24 19:39:46 +00001358.. option:: -finput-charset=<arg>
1359
Richard Smith081ad4d2017-01-24 19:39:46 +00001360.. option:: -finstrument-functions
1361
1362Generate calls to instrument function entry and exit
1363
Craig Topper16418662017-11-20 18:07:43 +00001364.. option:: -finstrument-functions-after-inlining
1365
1366Like -finstrument-functions, but insert the calls after inlining
1367
Richard Smith081ad4d2017-01-24 19:39:46 +00001368.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1369
1370Enable the integrated assembler
1371
Richard Smith081ad4d2017-01-24 19:39:46 +00001372.. option:: -fjump-tables, -fno-jump-tables
1373
Richard Smith081ad4d2017-01-24 19:39:46 +00001374.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1375
Richard Smith081ad4d2017-01-24 19:39:46 +00001376.. option:: -flimited-precision=<arg>
1377
Richard Smith081ad4d2017-01-24 19:39:46 +00001378.. option:: -flto, -fno-lto
1379
1380Enable LTO in 'full' mode
1381
Richard Smith081ad4d2017-01-24 19:39:46 +00001382.. option:: -flto-jobs=<arg>
1383
1384Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1385
Richard Smithb2c82a62017-01-27 01:54:42 +00001386.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001387.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001388.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001389
1390Set LTO mode to either 'full' or 'thin'
1391
Richard Smith081ad4d2017-01-24 19:39:46 +00001392.. option:: -fmacro-backtrace-limit=<arg>
1393
Richard Smith081ad4d2017-01-24 19:39:46 +00001394.. option:: -fmath-errno, -fno-math-errno
1395
1396Require math functions to indicate errors by setting errno
1397
Richard Smith081ad4d2017-01-24 19:39:46 +00001398.. option:: -fmax-type-align=<arg>
1399
1400Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1401
Richard Smith081ad4d2017-01-24 19:39:46 +00001402.. option:: -fmerge-all-constants, -fno-merge-all-constants
1403
Richard Smith081ad4d2017-01-24 19:39:46 +00001404.. option:: -fmessage-length=<arg>
1405
Richard Smith081ad4d2017-01-24 19:39:46 +00001406.. option:: -fmodule-file-deps, -fno-module-file-deps
1407
Richard Smith081ad4d2017-01-24 19:39:46 +00001408.. option:: -fmodule-map-file=<file>
1409
1410Load this module map file
1411
Richard Smith081ad4d2017-01-24 19:39:46 +00001412.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1413
1414Specify the name of the module to build
1415
Richard Smith081ad4d2017-01-24 19:39:46 +00001416.. option:: -fmodules, -fno-modules
1417
1418Enable the 'modules' language feature
1419
Richard Smith081ad4d2017-01-24 19:39:46 +00001420.. option:: -fmodules-decluse, -fno-modules-decluse
1421
1422Require declaration of modules used within a module
1423
Richard Smith081ad4d2017-01-24 19:39:46 +00001424.. option:: -fmodules-ignore-macro=<arg>
1425
1426Ignore the definition of the given macro when building and loading modules
1427
Richard Smith081ad4d2017-01-24 19:39:46 +00001428.. option:: -fmodules-search-all, -fno-modules-search-all
1429
1430Search even non-imported modules to resolve references
1431
Richard Smith081ad4d2017-01-24 19:39:46 +00001432.. option:: -fmodules-strict-decluse
1433
1434Like -fmodules-decluse but requires all headers to be in modules
1435
Richard Smith081ad4d2017-01-24 19:39:46 +00001436.. option:: -fmodules-ts
1437
1438Enable support for the C++ Modules TS
1439
Richard Smith081ad4d2017-01-24 19:39:46 +00001440.. option:: -fms-compatibility, -fno-ms-compatibility
1441
1442Enable full Microsoft Visual C++ compatibility
1443
Richard Smith081ad4d2017-01-24 19:39:46 +00001444.. option:: -fms-compatibility-version=<arg>
1445
1446Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1447
Richard Smith081ad4d2017-01-24 19:39:46 +00001448.. option:: -fms-extensions, -fno-ms-extensions
1449
1450Accept some non-standard constructs supported by the Microsoft compiler
1451
Richard Smith081ad4d2017-01-24 19:39:46 +00001452.. option:: -fms-memptr-rep=<arg>
1453
Richard Smith081ad4d2017-01-24 19:39:46 +00001454.. option:: -fms-volatile<arg>
1455
Richard Smith081ad4d2017-01-24 19:39:46 +00001456.. option:: -fmsc-version=<arg>
1457
1458Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1459
Richard Smith081ad4d2017-01-24 19:39:46 +00001460.. option:: -fmudflap
1461
Richard Smith081ad4d2017-01-24 19:39:46 +00001462.. option:: -fmudflapth
1463
Richard Smith081ad4d2017-01-24 19:39:46 +00001464.. option:: -fnested-functions
1465
Richard Smith081ad4d2017-01-24 19:39:46 +00001466.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1467
1468Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1469
Richard Smith081ad4d2017-01-24 19:39:46 +00001470.. option:: -fnext-runtime
1471
Richard Smith081ad4d2017-01-24 19:39:46 +00001472.. option:: -fno-builtin-<arg>
1473
1474Disable implicit builtin knowledge of a specific function
1475
Richard Smith081ad4d2017-01-24 19:39:46 +00001476.. option:: -fno-elide-type
1477
1478Do not elide types when printing diagnostics
1479
Richard Smith081ad4d2017-01-24 19:39:46 +00001480.. option:: -fno-max-type-align
1481
Richard Smith081ad4d2017-01-24 19:39:46 +00001482.. option:: -fno-operator-names
1483
1484Do not treat C++ operator name keywords as synonyms for operators
1485
Richard Smith081ad4d2017-01-24 19:39:46 +00001486.. option:: -fno-strict-modules-decluse
1487
Richard Smith081ad4d2017-01-24 19:39:46 +00001488.. option:: -fno-working-directory
1489
Boris Kolpackovb150d242017-08-30 09:15:53 +00001490.. option:: -fnoopenmp-relocatable-target
1491
1492Do not compile OpenMP target code as relocatable.
1493
Richard Smith081ad4d2017-01-24 19:39:46 +00001494.. option:: -fnoopenmp-use-tls
1495
Richard Smith081ad4d2017-01-24 19:39:46 +00001496.. option:: -fobjc-abi-version=<arg>
1497
Richard Smith081ad4d2017-01-24 19:39:46 +00001498.. option:: -fobjc-arc, -fno-objc-arc
1499
1500Synthesize retain and release calls for Objective-C pointers
1501
Richard Smith081ad4d2017-01-24 19:39:46 +00001502.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1503
1504Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1505
Richard Smith081ad4d2017-01-24 19:39:46 +00001506.. option:: -fobjc-exceptions, -fno-objc-exceptions
1507
1508Enable Objective-C exceptions
1509
Richard Smith081ad4d2017-01-24 19:39:46 +00001510.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1511
Richard Smith081ad4d2017-01-24 19:39:46 +00001512.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1513
Richard Smith081ad4d2017-01-24 19:39:46 +00001514.. option:: -fobjc-link-runtime
1515
Richard Smith081ad4d2017-01-24 19:39:46 +00001516.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1517
Richard Smith081ad4d2017-01-24 19:39:46 +00001518.. option:: -fobjc-nonfragile-abi-version=<arg>
1519
Richard Smith081ad4d2017-01-24 19:39:46 +00001520.. option:: -fobjc-runtime=<arg>
1521
1522Specify the target Objective-C runtime kind and version
1523
Richard Smith081ad4d2017-01-24 19:39:46 +00001524.. option:: -fobjc-sender-dependent-dispatch
1525
Richard Smith081ad4d2017-01-24 19:39:46 +00001526.. option:: -fobjc-weak, -fno-objc-weak
1527
1528Enable ARC-style weak references in Objective-C
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1531
Richard Smith081ad4d2017-01-24 19:39:46 +00001532.. option:: -fopenmp, -fno-openmp
1533
Richard Smith081ad4d2017-01-24 19:39:46 +00001534.. option:: -fopenmp-dump-offload-linker-script
1535
Boris Kolpackovb150d242017-08-30 09:15:53 +00001536.. option:: -fopenmp-relocatable-target
1537
1538OpenMP target code is compiled as relocatable using the -c flag. For OpenMP targets the code is relocatable by default.
1539
Richard Smith081ad4d2017-01-24 19:39:46 +00001540.. option:: -fopenmp-use-tls
1541
Richard Smith081ad4d2017-01-24 19:39:46 +00001542.. option:: -fopenmp-version=<arg>
1543
Richard Smithb2c82a62017-01-27 01:54:42 +00001544.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001545.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001546.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001547
Richard Smith081ad4d2017-01-24 19:39:46 +00001548.. option:: -foperator-arrow-depth=<arg>
1549
Richard Smith081ad4d2017-01-24 19:39:46 +00001550.. option:: -foptimization-record-file=<arg>
1551
1552Specify the file name of any generated YAML optimization record
1553
Richard Smith081ad4d2017-01-24 19:39:46 +00001554.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1555
Richard Smith081ad4d2017-01-24 19:39:46 +00001556.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1557
Richard Smith081ad4d2017-01-24 19:39:46 +00001558.. option:: -fpack-struct, -fno-pack-struct
1559
Richard Smithb2c82a62017-01-27 01:54:42 +00001560.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001561.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001562.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001563
1564Specify the default maximum struct packing alignment
1565
Richard Smith081ad4d2017-01-24 19:39:46 +00001566.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1567
1568Recognize and construct Pascal-style string literals
1569
Richard Smith081ad4d2017-01-24 19:39:46 +00001570.. option:: -fpcc-struct-return
1571
1572Override the default ABI to return all structs on the stack
1573
Richard Smith081ad4d2017-01-24 19:39:46 +00001574.. option:: -fpch-preprocess
1575
Richard Smith081ad4d2017-01-24 19:39:46 +00001576.. option:: -fpic, -fno-pic
1577
Richard Smith081ad4d2017-01-24 19:39:46 +00001578.. option:: -fpie, -fno-pie
1579
Craig Topper16418662017-11-20 18:07:43 +00001580.. option:: -fplt, -fno-plt
1581
1582Use the PLT to make function calls
1583
Richard Smith081ad4d2017-01-24 19:39:46 +00001584.. option:: -fplugin=<dsopath>
1585
1586Load the named plugin (dynamic shared object)
1587
Richard Smith081ad4d2017-01-24 19:39:46 +00001588.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1589
Richard Smith081ad4d2017-01-24 19:39:46 +00001590.. option:: -fprofile-arcs, -fno-profile-arcs
1591
Richard Smith081ad4d2017-01-24 19:39:46 +00001592.. option:: -fprofile-dir=<arg>
1593
Richard Smith081ad4d2017-01-24 19:39:46 +00001594.. option:: -fprofile-generate, -fno-profile-generate
1595
1596Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1597
Richard Smithb2c82a62017-01-27 01:54:42 +00001598.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001599.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001600.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001601
1602Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1603
Richard Smith081ad4d2017-01-24 19:39:46 +00001604.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1605
1606Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1607
Richard Smithb2c82a62017-01-27 01:54:42 +00001608.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001609.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001610.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001611
1612Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1615
Richard Smithb2c82a62017-01-27 01:54:42 +00001616.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001617.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001618.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001619
1620Use instrumentation data for profile-guided optimization
1621
Boris Kolpackovb150d242017-08-30 09:15:53 +00001622.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1623
1624Specifies that the sample profile is accurate. If the sample
1625 profile is accurate, callsites without profile samples are marked
1626 as cold. Otherwise, treat callsites without profile samples as if
1627 we have no profile
1628
Richard Smith78e23fd2017-04-13 22:39:49 +00001629.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1630
1631.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001632.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001633.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001634
1635Enable sample-based profile guided optimizations
1636
Richard Smithb2c82a62017-01-27 01:54:42 +00001637.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001638.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001639.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001640
1641Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1642
Richard Smith081ad4d2017-01-24 19:39:46 +00001643.. option:: -freciprocal-math, -fno-reciprocal-math
1644
1645Allow division operations to be reassociated
1646
Richard Smith081ad4d2017-01-24 19:39:46 +00001647.. option:: -freg-struct-return
1648
1649Override the default ABI to return small structs in registers
1650
Richard Smith081ad4d2017-01-24 19:39:46 +00001651.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1652
1653Enable C++17 relaxed template template argument matching
1654
Richard Smith081ad4d2017-01-24 19:39:46 +00001655.. option:: -freroll-loops, -fno-reroll-loops
1656
1657Turn on loop reroller
1658
Richard Smith081ad4d2017-01-24 19:39:46 +00001659.. option:: -fretain-comments-from-system-headers
1660
Craig Topperd23254a2017-07-20 17:52:48 +00001661.. option:: -frewrite-imports, -fno-rewrite-imports
1662
Richard Smith081ad4d2017-01-24 19:39:46 +00001663.. option:: -frewrite-includes, -fno-rewrite-includes
1664
Richard Smith081ad4d2017-01-24 19:39:46 +00001665.. option:: -frewrite-map-file <arg>
1666
Richard Smithb2c82a62017-01-27 01:54:42 +00001667.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001669.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001670
Richard Smith081ad4d2017-01-24 19:39:46 +00001671.. option:: -fropi, -fno-ropi
1672
Richard Smith081ad4d2017-01-24 19:39:46 +00001673.. option:: -frtti, -fno-rtti
1674
Richard Smith081ad4d2017-01-24 19:39:46 +00001675.. option:: -frwpi, -fno-rwpi
1676
Richard Smith081ad4d2017-01-24 19:39:46 +00001677.. option:: -fsave-optimization-record, -fno-save-optimization-record
1678
1679Generate a YAML optimization record file
1680
Richard Smith081ad4d2017-01-24 19:39:46 +00001681.. option:: -fshort-enums, -fno-short-enums
1682
1683Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1684
Richard Smith081ad4d2017-01-24 19:39:46 +00001685.. option:: -fshort-wchar, -fno-short-wchar
1686
1687Force wchar\_t to be a short unsigned int
1688
Richard Smith081ad4d2017-01-24 19:39:46 +00001689.. option:: -fshow-column, -fno-show-column
1690
Richard Smith081ad4d2017-01-24 19:39:46 +00001691.. option:: -fshow-overloads=<arg>
1692
1693Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1694
Richard Smith081ad4d2017-01-24 19:39:46 +00001695.. option:: -fshow-source-location, -fno-show-source-location
1696
Richard Smith081ad4d2017-01-24 19:39:46 +00001697.. option:: -fsignaling-math, -fno-signaling-math
1698
Richard Smith081ad4d2017-01-24 19:39:46 +00001699.. option:: -fsigned-bitfields
1700
Richard Smith081ad4d2017-01-24 19:39:46 +00001701.. option:: -fsigned-char, -fno-signed-char, --signed-char
1702
Richard Smith081ad4d2017-01-24 19:39:46 +00001703.. option:: -fsigned-zeros, -fno-signed-zeros
1704
Richard Smith081ad4d2017-01-24 19:39:46 +00001705.. option:: -fsized-deallocation, -fno-sized-deallocation
1706
1707Enable C++14 sized global deallocation functions
1708
Richard Smith081ad4d2017-01-24 19:39:46 +00001709.. option:: -fsjlj-exceptions
1710
1711Use SjLj style exceptions
1712
Richard Smith081ad4d2017-01-24 19:39:46 +00001713.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1714
1715Enable the superword-level parallelism vectorization passes
1716
Richard Smith081ad4d2017-01-24 19:39:46 +00001717.. option:: -fspell-checking, -fno-spell-checking
1718
Richard Smith081ad4d2017-01-24 19:39:46 +00001719.. option:: -fspell-checking-limit=<arg>
1720
Richard Smith081ad4d2017-01-24 19:39:46 +00001721.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1722
1723Place debug types in their own section (ELF Only)
1724
Richard Smith081ad4d2017-01-24 19:39:46 +00001725.. option:: -fsplit-stack
1726
Richard Smith081ad4d2017-01-24 19:39:46 +00001727.. option:: -fstack-protector, -fno-stack-protector
1728
1729Enable stack protectors for functions potentially vulnerable to stack smashing
1730
Richard Smith081ad4d2017-01-24 19:39:46 +00001731.. option:: -fstack-protector-all
1732
1733Force the usage of stack protectors for all functions
1734
Richard Smith081ad4d2017-01-24 19:39:46 +00001735.. option:: -fstack-protector-strong
1736
1737Use a strong heuristic to apply stack protectors to functions
1738
Richard Smith081ad4d2017-01-24 19:39:46 +00001739.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1740
1741Emit full debug info for all types used by the program
1742
Richard Smith081ad4d2017-01-24 19:39:46 +00001743.. option:: -fstrict-aliasing, -fno-strict-aliasing
1744
Richard Smith081ad4d2017-01-24 19:39:46 +00001745.. option:: -fstrict-enums, -fno-strict-enums
1746
1747Enable optimizations based on the strict definition of an enum's value range
1748
Richard Smith081ad4d2017-01-24 19:39:46 +00001749.. option:: -fstrict-overflow, -fno-strict-overflow
1750
Richard Smith081ad4d2017-01-24 19:39:46 +00001751.. option:: -fstrict-return, -fno-strict-return
1752
Richard Smith78e23fd2017-04-13 22:39:49 +00001753Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00001754
Richard Smith081ad4d2017-01-24 19:39:46 +00001755.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1756
1757Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1758
Richard Smith081ad4d2017-01-24 19:39:46 +00001759.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1760
Richard Smith081ad4d2017-01-24 19:39:46 +00001761.. option:: -ftabstop=<arg>
1762
Richard Smith081ad4d2017-01-24 19:39:46 +00001763.. option:: -ftemplate-backtrace-limit=<arg>
1764
Richard Smith081ad4d2017-01-24 19:39:46 +00001765.. option:: -ftemplate-depth-<arg>
1766
Richard Smith081ad4d2017-01-24 19:39:46 +00001767.. option:: -ftemplate-depth=<arg>
1768
Richard Smith081ad4d2017-01-24 19:39:46 +00001769.. option:: -ftest-coverage
1770
Richard Smith081ad4d2017-01-24 19:39:46 +00001771.. option:: -fthinlto-index=<arg>
1772
1773Perform ThinLTO importing using provided function summary index
1774
Richard Smith081ad4d2017-01-24 19:39:46 +00001775.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1776
Richard Smith081ad4d2017-01-24 19:39:46 +00001777.. option:: -ftime-report
1778
Richard Smith081ad4d2017-01-24 19:39:46 +00001779.. option:: -ftls-model=<arg>
1780
Richard Smith081ad4d2017-01-24 19:39:46 +00001781.. option:: -ftrap-function=<arg>
1782
1783Issue call to specified function rather than a trap instruction
1784
Richard Smith081ad4d2017-01-24 19:39:46 +00001785.. option:: -ftrapping-math, -fno-trapping-math
1786
Richard Smith081ad4d2017-01-24 19:39:46 +00001787.. option:: -ftrapv
1788
1789Trap on integer overflow
1790
Richard Smith081ad4d2017-01-24 19:39:46 +00001791.. option:: -ftrapv-handler <arg>
1792
Richard Smithb2c82a62017-01-27 01:54:42 +00001793.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001794.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00001795.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001796
1797Specify the function to be called on overflow
1798
Richard Smith081ad4d2017-01-24 19:39:46 +00001799.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1800
1801Process trigraph sequences
1802
Richard Smith081ad4d2017-01-24 19:39:46 +00001803.. option:: -funique-section-names, -fno-unique-section-names
1804
1805Use unique names for text and data sections (ELF Only)
1806
Richard Smith081ad4d2017-01-24 19:39:46 +00001807.. option:: -funit-at-a-time, -fno-unit-at-a-time
1808
Richard Smith081ad4d2017-01-24 19:39:46 +00001809.. option:: -funroll-loops, -fno-unroll-loops
1810
1811Turn on loop unroller
1812
Richard Smith081ad4d2017-01-24 19:39:46 +00001813.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
1814
Richard Smith081ad4d2017-01-24 19:39:46 +00001815.. option:: -funsigned-bitfields
1816
Richard Smith081ad4d2017-01-24 19:39:46 +00001817.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
1818
Richard Smith081ad4d2017-01-24 19:39:46 +00001819.. option:: -funwind-tables, -fno-unwind-tables
1820
Richard Smith081ad4d2017-01-24 19:39:46 +00001821.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
1822
Richard Smith081ad4d2017-01-24 19:39:46 +00001823.. option:: -fuse-init-array, -fno-use-init-array
1824
1825Use .init\_array instead of .ctors
1826
Richard Smith081ad4d2017-01-24 19:39:46 +00001827.. option:: -fuse-ld=<arg>
1828
Richard Smith081ad4d2017-01-24 19:39:46 +00001829.. option:: -fuse-line-directives, -fno-use-line-directives
1830
Richard Smith081ad4d2017-01-24 19:39:46 +00001831.. option:: -fveclib=<arg>
1832
1833Use the given vector functions library
1834
Richard Smith081ad4d2017-01-24 19:39:46 +00001835.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
1836
1837Enable the loop vectorization passes
1838
Richard Smith081ad4d2017-01-24 19:39:46 +00001839.. option:: -fverbose-asm, -fno-verbose-asm
1840
Richard Smith081ad4d2017-01-24 19:39:46 +00001841.. option:: -fvisibility-inlines-hidden
1842
1843Give inline C++ member functions default visibility by default
1844
Richard Smith081ad4d2017-01-24 19:39:46 +00001845.. option:: -fvisibility-ms-compat
1846
1847Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
1848
Richard Smith081ad4d2017-01-24 19:39:46 +00001849.. option:: -fvisibility=<arg>
1850
1851Set the default symbol visibility for all global declarations
1852
Richard Smith081ad4d2017-01-24 19:39:46 +00001853.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
1854
1855Enables whole-program vtable optimization. Requires -flto
1856
Richard Smith081ad4d2017-01-24 19:39:46 +00001857.. option:: -fwrapv, -fno-wrapv
1858
1859Treat signed integer overflow as two's complement
1860
Richard Smith081ad4d2017-01-24 19:39:46 +00001861.. option:: -fwritable-strings
1862
1863Store string literals as writable data
1864
Richard Smith78e23fd2017-04-13 22:39:49 +00001865.. option:: -fxray-always-instrument=<arg>
1866
1867Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
1868
Richard Smith081ad4d2017-01-24 19:39:46 +00001869.. option:: -fxray-instruction-threshold<arg>
1870
Richard Smithb2c82a62017-01-27 01:54:42 +00001871.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001872.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001873.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001874
1875Sets the minimum function size to instrument with XRay
1876
Richard Smith081ad4d2017-01-24 19:39:46 +00001877.. option:: -fxray-instrument, -fno-xray-instrument
1878
1879Generate XRay instrumentation sleds on function entry and exit
1880
Richard Smith78e23fd2017-04-13 22:39:49 +00001881.. option:: -fxray-never-instrument=<arg>
1882
1883Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
1884
Richard Smith081ad4d2017-01-24 19:39:46 +00001885.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
1886
Richard Smith081ad4d2017-01-24 19:39:46 +00001887.. option:: -fzvector, -fno-zvector, -mzvector
1888
1889Enable System z vector language extension
1890
Richard Smith081ad4d2017-01-24 19:39:46 +00001891.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
1892
Richard Smith081ad4d2017-01-24 19:39:46 +00001893.. option:: -pedantic-errors, --pedantic-errors
1894
1895OpenCL flags
1896------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001897.. option:: -cl-denorms-are-zero
1898
1899OpenCL only. Allow denormals to be flushed to zero.
1900
Richard Smith081ad4d2017-01-24 19:39:46 +00001901.. option:: -cl-fast-relaxed-math
1902
1903OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
1904
Richard Smith081ad4d2017-01-24 19:39:46 +00001905.. option:: -cl-finite-math-only
1906
1907OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
1908
Richard Smith081ad4d2017-01-24 19:39:46 +00001909.. option:: -cl-fp32-correctly-rounded-divide-sqrt
1910
1911OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
1912
Richard Smith081ad4d2017-01-24 19:39:46 +00001913.. option:: -cl-kernel-arg-info
1914
1915OpenCL only. Generate kernel argument metadata.
1916
Richard Smith081ad4d2017-01-24 19:39:46 +00001917.. option:: -cl-mad-enable
1918
1919OpenCL only. Allow use of less precise MAD computations in the generated binary.
1920
Richard Smith081ad4d2017-01-24 19:39:46 +00001921.. option:: -cl-no-signed-zeros
1922
1923OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
1924
Richard Smith081ad4d2017-01-24 19:39:46 +00001925.. option:: -cl-opt-disable
1926
1927OpenCL only. This option disables all optimizations. By default optimizations are enabled.
1928
Richard Smith081ad4d2017-01-24 19:39:46 +00001929.. option:: -cl-single-precision-constant
1930
1931OpenCL only. Treat double precision floating-point constant as single precision constant.
1932
Richard Smith081ad4d2017-01-24 19:39:46 +00001933.. option:: -cl-std=<arg>
1934
1935OpenCL language standard to compile for.
1936
Richard Smith081ad4d2017-01-24 19:39:46 +00001937.. option:: -cl-strict-aliasing
1938
1939OpenCL only. This option is added for compatibility with OpenCL 1.0.
1940
Richard Smith081ad4d2017-01-24 19:39:46 +00001941.. option:: -cl-unsafe-math-optimizations
1942
1943OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
1944
1945Target-dependent compilation options
1946~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00001947.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
1948
1949Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
1950
Richard Smith081ad4d2017-01-24 19:39:46 +00001951.. option:: -m16
1952
Richard Smith081ad4d2017-01-24 19:39:46 +00001953.. option:: -m32
1954
Richard Smith081ad4d2017-01-24 19:39:46 +00001955.. option:: -m64
1956
Richard Smith081ad4d2017-01-24 19:39:46 +00001957.. option:: -mabi=<arg>
1958
Richard Smith081ad4d2017-01-24 19:39:46 +00001959.. option:: -mabicalls, -mno-abicalls
1960
1961Enable SVR4-style position-independent code (Mips only)
1962
Boris Kolpackovb150d242017-08-30 09:15:53 +00001963.. option:: -mabs=<arg>
1964
Richard Smith081ad4d2017-01-24 19:39:46 +00001965.. option:: -malign-double
1966
1967Align doubles to two words in structs (x86 only)
1968
Richard Smith081ad4d2017-01-24 19:39:46 +00001969.. option:: -march=<arg>
1970
Richard Smith081ad4d2017-01-24 19:39:46 +00001971.. option:: -masm=<arg>
1972
Richard Smith081ad4d2017-01-24 19:39:46 +00001973.. option:: -mbackchain, -mno-backchain
1974
1975Link stack frames through backchain on System Z
1976
Richard Smith081ad4d2017-01-24 19:39:46 +00001977.. option:: -mcheck-zero-division, -mno-check-zero-division
1978
Richard Smith081ad4d2017-01-24 19:39:46 +00001979.. option:: -mcmodel=<arg>
1980
Richard Smith081ad4d2017-01-24 19:39:46 +00001981.. option:: -mcompact-branches=<arg>
1982
Richard Smith081ad4d2017-01-24 19:39:46 +00001983.. option:: -mconsole<arg>
1984
Richard Smith78e23fd2017-04-13 22:39:49 +00001985.. option:: -mcpu=<arg>, -mv4 (equivalent to -mcpu=hexagonv4), -mv5 (equivalent to -mcpu=hexagonv5), -mv55 (equivalent to -mcpu=hexagonv55), -mv60 (equivalent to -mcpu=hexagonv60), -mv62 (equivalent to -mcpu=hexagonv62)
Richard Smith081ad4d2017-01-24 19:39:46 +00001986
Craig Topperd23254a2017-07-20 17:52:48 +00001987.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
1988
Richard Smith081ad4d2017-01-24 19:39:46 +00001989.. option:: -mdll<arg>
1990
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -mdouble-float
1992
Richard Smith081ad4d2017-01-24 19:39:46 +00001993.. option:: -mdsp, -mno-dsp
1994
Richard Smith081ad4d2017-01-24 19:39:46 +00001995.. option:: -mdspr2, -mno-dspr2
1996
Richard Smith081ad4d2017-01-24 19:39:46 +00001997.. option:: -mdynamic-no-pic<arg>
1998
Richard Smith081ad4d2017-01-24 19:39:46 +00001999.. option:: -meabi <arg>
2000
2001Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2002
Boris Kolpackovb150d242017-08-30 09:15:53 +00002003.. option:: -membedded-data, -mno-embedded-data
2004
2005Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2006
2007.. option:: -mextern-sdata, -mno-extern-sdata
2008
2009Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2010
Richard Smith78e23fd2017-04-13 22:39:49 +00002011.. option:: -mfentry
2012
2013Insert calls to fentry at function entry (x86 only)
2014
Richard Smith081ad4d2017-01-24 19:39:46 +00002015.. option:: -mfloat-abi=<arg>
2016
Richard Smith081ad4d2017-01-24 19:39:46 +00002017.. option:: -mfp32
2018
2019Use 32-bit floating point registers (MIPS only)
2020
Richard Smith081ad4d2017-01-24 19:39:46 +00002021.. option:: -mfp64
2022
2023Use 64-bit floating point registers (MIPS only)
2024
Richard Smith081ad4d2017-01-24 19:39:46 +00002025.. option:: -mfpmath=<arg>
2026
Richard Smith081ad4d2017-01-24 19:39:46 +00002027.. option:: -mfpu=<arg>
2028
Richard Smith081ad4d2017-01-24 19:39:46 +00002029.. option:: -mglobal-merge, -mno-global-merge
2030
2031Enable merging of globals
2032
Craig Topperd23254a2017-07-20 17:52:48 +00002033.. option:: -mgpopt, -mno-gpopt
2034
2035Use GP relative accesses for symbols known to be in a small data section (MIPS)
2036
Richard Smith081ad4d2017-01-24 19:39:46 +00002037.. option:: -mhard-float
2038
Richard Smith081ad4d2017-01-24 19:39:46 +00002039.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2040
Richard Smith081ad4d2017-01-24 19:39:46 +00002041.. option:: -miamcu, -mno-iamcu
2042
2043Use Intel MCU ABI
2044
Richard Smith081ad4d2017-01-24 19:39:46 +00002045.. option:: -mimplicit-float, -mno-implicit-float
2046
Richard Smith081ad4d2017-01-24 19:39:46 +00002047.. option:: -mimplicit-it=<arg>
2048
Richard Smith081ad4d2017-01-24 19:39:46 +00002049.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2050
2051(integrated-as) Emit an object file which can be used with an incremental linker
2052
Richard Smith78e23fd2017-04-13 22:39:49 +00002053.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002054
Richard Smith081ad4d2017-01-24 19:39:46 +00002055.. option:: -mips16
2056
Richard Smith081ad4d2017-01-24 19:39:46 +00002057.. option:: -mkernel
2058
Richard Smith081ad4d2017-01-24 19:39:46 +00002059.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2060
Boris Kolpackovb150d242017-08-30 09:15:53 +00002061.. option:: -mlocal-sdata, -mno-local-sdata
2062
2063Extend the -G behaviour to object local data (MIPS)
2064
Richard Smith081ad4d2017-01-24 19:39:46 +00002065.. option:: -mlong-calls, -mno-long-calls
2066
2067Generate branches with extended addressability, usually via indirect jumps.
2068
Craig Topperd23254a2017-07-20 17:52:48 +00002069.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002070
2071Set Mac OS X deployment target
2072
Craig Topperd23254a2017-07-20 17:52:48 +00002073.. option:: -mmadd4, -mno-madd4
2074
2075Enable the generation of 4-operand madd.s, madd.d and related instructions.
2076
2077.. option:: -mmcu=<arg>
2078
Richard Smith081ad4d2017-01-24 19:39:46 +00002079.. option:: -mmicromips, -mno-micromips
2080
Richard Smith081ad4d2017-01-24 19:39:46 +00002081.. option:: -mms-bitfields, -mno-ms-bitfields
2082
2083Set the default structure layout to be compatible with the Microsoft compiler standard
2084
Richard Smith081ad4d2017-01-24 19:39:46 +00002085.. option:: -mmsa, -mno-msa
2086
2087Enable MSA ASE (MIPS only)
2088
Craig Topperd23254a2017-07-20 17:52:48 +00002089.. option:: -mmt, -mno-mt
2090
2091Enable MT ASE (MIPS only)
2092
Richard Smith081ad4d2017-01-24 19:39:46 +00002093.. option:: -mnan=<arg>
2094
Richard Smith081ad4d2017-01-24 19:39:46 +00002095.. option:: -mno-mips16
2096
Richard Smith081ad4d2017-01-24 19:39:46 +00002097.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2098
2099Omit frame pointer setup for leaf functions
2100
Richard Smith081ad4d2017-01-24 19:39:46 +00002101.. option:: -moslib=<arg>
2102
Richard Smith081ad4d2017-01-24 19:39:46 +00002103.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2104
2105Use copy relocations support for PIE builds
2106
Richard Smith081ad4d2017-01-24 19:39:46 +00002107.. option:: -mqdsp6-compat
2108
2109Enable hexagon-qdsp6 backward compatibility
2110
Richard Smith081ad4d2017-01-24 19:39:46 +00002111.. option:: -mrecip
2112
Richard Smithb2c82a62017-01-27 01:54:42 +00002113.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002114.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002115.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002116
Richard Smith081ad4d2017-01-24 19:39:46 +00002117.. option:: -mred-zone, -mno-red-zone
2118
Richard Smith081ad4d2017-01-24 19:39:46 +00002119.. option:: -mregparm=<arg>
2120
Richard Smith081ad4d2017-01-24 19:39:46 +00002121.. option:: -mrelax-all, -mno-relax-all
2122
2123(integrated-as) Relax all machine instructions
2124
Richard Smith081ad4d2017-01-24 19:39:46 +00002125.. option:: -mrtd, -mno-rtd
2126
2127Make StdCall calling convention the default
2128
Richard Smith081ad4d2017-01-24 19:39:46 +00002129.. option:: -msingle-float
2130
Richard Smith081ad4d2017-01-24 19:39:46 +00002131.. option:: -msoft-float, -mno-soft-float
2132
2133Use software floating point
2134
Richard Smith081ad4d2017-01-24 19:39:46 +00002135.. option:: -mstack-alignment=<arg>
2136
2137Set the stack alignment
2138
Richard Smith081ad4d2017-01-24 19:39:46 +00002139.. option:: -mstack-probe-size=<arg>
2140
2141Set the stack probe size
2142
Richard Smith081ad4d2017-01-24 19:39:46 +00002143.. option:: -mstackrealign, -mno-stackrealign
2144
2145Force realign the stack at entry to every function
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -mthread-model <arg>
2148
2149The thread model to use, e.g. posix, single (posix by default)
2150
Richard Smith081ad4d2017-01-24 19:39:46 +00002151.. option:: -mthreads<arg>
2152
Richard Smith081ad4d2017-01-24 19:39:46 +00002153.. option:: -mthumb, -mno-thumb
2154
Richard Smith081ad4d2017-01-24 19:39:46 +00002155.. option:: -mtune=<arg>
2156
Richard Smith78e23fd2017-04-13 22:39:49 +00002157.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002158
Richard Smith081ad4d2017-01-24 19:39:46 +00002159.. option:: -municode<arg>
2160
Richard Smith081ad4d2017-01-24 19:39:46 +00002161.. option:: -mvx, -mno-vx
2162
Richard Smith081ad4d2017-01-24 19:39:46 +00002163.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2164
Richard Smith78e23fd2017-04-13 22:39:49 +00002165.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002166
Richard Smith081ad4d2017-01-24 19:39:46 +00002167.. option:: -mwindows<arg>
2168
Richard Smith081ad4d2017-01-24 19:39:46 +00002169.. option:: -mx32
2170
Richard Smith081ad4d2017-01-24 19:39:46 +00002171.. option:: -mxgot, -mno-xgot
2172
2173AARCH64
2174-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002175.. option:: -ffixed-x18
2176
2177Reserve the x18 register (AArch64 only)
2178
Richard Smith081ad4d2017-01-24 19:39:46 +00002179.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2180
2181Workaround Cortex-A53 erratum 835769 (AArch64 only)
2182
Richard Smith081ad4d2017-01-24 19:39:46 +00002183.. option:: -mgeneral-regs-only
2184
2185Generate code which only uses the general purpose registers (AArch64 only)
2186
2187AMDGPU
2188------
Craig Topper16418662017-11-20 18:07:43 +00002189.. option:: -mxnack, -mno-xnack
2190
2191Enable XNACK (AMDGPU only)
2192
Richard Smith081ad4d2017-01-24 19:39:46 +00002193ARM
2194---
Richard Smith081ad4d2017-01-24 19:39:46 +00002195.. option:: -ffixed-r9
2196
2197Reserve the r9 register (ARM only)
2198
Richard Smith081ad4d2017-01-24 19:39:46 +00002199.. option:: -mcrc
2200
2201Allow use of CRC instructions (ARM only)
2202
Richard Smith081ad4d2017-01-24 19:39:46 +00002203.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2204
2205Disallow generation of data access to code sections (ARM only)
2206
Richard Smith081ad4d2017-01-24 19:39:46 +00002207.. option:: -mno-movt
2208
2209Disallow use of movt/movw pairs (ARM only)
2210
Richard Smith78e23fd2017-04-13 22:39:49 +00002211.. option:: -mno-neg-immediates
2212
2213Disallow converting instructions with negative immediates to their negation or inversion.
2214
Richard Smith081ad4d2017-01-24 19:39:46 +00002215.. option:: -mnocrc
2216
2217Disallow use of CRC instructions (ARM only)
2218
Richard Smith081ad4d2017-01-24 19:39:46 +00002219.. option:: -mrestrict-it, -mno-restrict-it
2220
2221Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2222
Craig Topper16418662017-11-20 18:07:43 +00002223.. option:: -mtp=<arg>
2224
2225Read thread pointer from coprocessor register (ARM only)
2226
Richard Smith081ad4d2017-01-24 19:39:46 +00002227.. option:: -munaligned-access, -mno-unaligned-access
2228
2229Allow memory accesses to be unaligned (AArch32/AArch64 only)
2230
2231Hexagon
2232-------
Craig Topper16418662017-11-20 18:07:43 +00002233.. option:: -mieee-rnd-near
2234
2235Hexagon
2236-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002237.. option:: -mhvx, -mno-hvx
2238
2239Enable Hexagon Vector eXtensions
2240
Richard Smith081ad4d2017-01-24 19:39:46 +00002241.. option:: -mhvx-double, -mno-hvx-double
2242
2243Enable Hexagon Double Vector eXtensions
2244
Craig Topper16418662017-11-20 18:07:43 +00002245.. option:: -mhvx-length=<arg>
2246
2247Set Hexagon Vector Length
2248
2249.. program:: clang1
2250.. option:: -mhvx=<arg>
2251.. program:: clang
2252
2253Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002254
2255PowerPC
2256-------
Richard Smith78e23fd2017-04-13 22:39:49 +00002257.. option:: -maltivec, -mno-altivec
2258
Richard Smith081ad4d2017-01-24 19:39:46 +00002259.. option:: -mcmpb, -mno-cmpb
2260
Richard Smith081ad4d2017-01-24 19:39:46 +00002261.. option:: -mcrbits, -mno-crbits
2262
Richard Smith081ad4d2017-01-24 19:39:46 +00002263.. option:: -mcrypto, -mno-crypto
2264
Richard Smith081ad4d2017-01-24 19:39:46 +00002265.. option:: -mdirect-move, -mno-direct-move
2266
Richard Smith081ad4d2017-01-24 19:39:46 +00002267.. option:: -mfloat128, -mno-float128
2268
Richard Smith081ad4d2017-01-24 19:39:46 +00002269.. option:: -mfprnd, -mno-fprnd
2270
Richard Smith081ad4d2017-01-24 19:39:46 +00002271.. option:: -mhtm, -mno-htm
2272
Richard Smith081ad4d2017-01-24 19:39:46 +00002273.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2274
Richard Smith081ad4d2017-01-24 19:39:46 +00002275.. option:: -misel, -mno-isel
2276
Richard Smith081ad4d2017-01-24 19:39:46 +00002277.. option:: -mlongcall, -mno-longcall
2278
Richard Smith081ad4d2017-01-24 19:39:46 +00002279.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2280
Richard Smith081ad4d2017-01-24 19:39:46 +00002281.. option:: -mpopcntd, -mno-popcntd
2282
Richard Smith081ad4d2017-01-24 19:39:46 +00002283.. option:: -mpower8-vector, -mno-power8-vector
2284
Richard Smith081ad4d2017-01-24 19:39:46 +00002285.. option:: -mpower9-vector, -mno-power9-vector
2286
Richard Smith081ad4d2017-01-24 19:39:46 +00002287.. option:: -mqpx, -mno-qpx
2288
Richard Smith081ad4d2017-01-24 19:39:46 +00002289.. option:: -mvsx, -mno-vsx
2290
2291WebAssembly
2292-----------
Richard Smith081ad4d2017-01-24 19:39:46 +00002293.. option:: -msimd128, -mno-simd128
2294
2295X86
2296---
Richard Smith081ad4d2017-01-24 19:39:46 +00002297.. option:: -m3dnow, -mno-3dnow
2298
Richard Smith081ad4d2017-01-24 19:39:46 +00002299.. option:: -m3dnowa, -mno-3dnowa
2300
Richard Smith081ad4d2017-01-24 19:39:46 +00002301.. option:: -madx, -mno-adx
2302
Richard Smith081ad4d2017-01-24 19:39:46 +00002303.. option:: -maes, -mno-aes
2304
Richard Smith081ad4d2017-01-24 19:39:46 +00002305.. option:: -mavx, -mno-avx
2306
Richard Smith081ad4d2017-01-24 19:39:46 +00002307.. option:: -mavx2, -mno-avx2
2308
Richard Smith081ad4d2017-01-24 19:39:46 +00002309.. option:: -mavx512bw, -mno-avx512bw
2310
Richard Smith081ad4d2017-01-24 19:39:46 +00002311.. option:: -mavx512cd, -mno-avx512cd
2312
Richard Smith081ad4d2017-01-24 19:39:46 +00002313.. option:: -mavx512dq, -mno-avx512dq
2314
Richard Smith081ad4d2017-01-24 19:39:46 +00002315.. option:: -mavx512er, -mno-avx512er
2316
Richard Smith081ad4d2017-01-24 19:39:46 +00002317.. option:: -mavx512f, -mno-avx512f
2318
Richard Smith081ad4d2017-01-24 19:39:46 +00002319.. option:: -mavx512ifma, -mno-avx512ifma
2320
Richard Smith081ad4d2017-01-24 19:39:46 +00002321.. option:: -mavx512pf, -mno-avx512pf
2322
Richard Smith081ad4d2017-01-24 19:39:46 +00002323.. option:: -mavx512vbmi, -mno-avx512vbmi
2324
Richard Smith081ad4d2017-01-24 19:39:46 +00002325.. option:: -mavx512vl, -mno-avx512vl
2326
Craig Topperd23254a2017-07-20 17:52:48 +00002327.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2328
Richard Smith081ad4d2017-01-24 19:39:46 +00002329.. option:: -mbmi, -mno-bmi
2330
Richard Smith081ad4d2017-01-24 19:39:46 +00002331.. option:: -mbmi2, -mno-bmi2
2332
Craig Topper78b47872017-02-08 06:48:58 +00002333.. option:: -mclflushopt, -mno-clflushopt
2334
Craig Topper177a57c2017-02-08 07:57:01 +00002335.. option:: -mclwb, -mno-clwb
2336
Richard Smith78e23fd2017-04-13 22:39:49 +00002337.. option:: -mclzero, -mno-clzero
2338
Richard Smith081ad4d2017-01-24 19:39:46 +00002339.. option:: -mcx16, -mno-cx16
2340
Richard Smith081ad4d2017-01-24 19:39:46 +00002341.. option:: -mf16c, -mno-f16c
2342
Richard Smith081ad4d2017-01-24 19:39:46 +00002343.. option:: -mfma, -mno-fma
2344
Richard Smith081ad4d2017-01-24 19:39:46 +00002345.. option:: -mfma4, -mno-fma4
2346
Richard Smith081ad4d2017-01-24 19:39:46 +00002347.. option:: -mfsgsbase, -mno-fsgsbase
2348
Richard Smith081ad4d2017-01-24 19:39:46 +00002349.. option:: -mfxsr, -mno-fxsr
2350
Craig Topperd23254a2017-07-20 17:52:48 +00002351.. option:: -mlwp, -mno-lwp
2352
Richard Smith081ad4d2017-01-24 19:39:46 +00002353.. option:: -mlzcnt, -mno-lzcnt
2354
Richard Smith081ad4d2017-01-24 19:39:46 +00002355.. option:: -mmmx, -mno-mmx
2356
Craig Topper177a57c2017-02-08 07:57:01 +00002357.. option:: -mmovbe, -mno-movbe
2358
Craig Topperb16cb822017-02-08 07:56:42 +00002359.. option:: -mmpx, -mno-mpx
2360
Richard Smith081ad4d2017-01-24 19:39:46 +00002361.. option:: -mmwaitx, -mno-mwaitx
2362
Richard Smith081ad4d2017-01-24 19:39:46 +00002363.. option:: -mpclmul, -mno-pclmul
2364
Richard Smith081ad4d2017-01-24 19:39:46 +00002365.. option:: -mpku, -mno-pku
2366
Richard Smith081ad4d2017-01-24 19:39:46 +00002367.. option:: -mpopcnt, -mno-popcnt
2368
Craig Topperd2bf7b02017-02-08 08:23:40 +00002369.. option:: -mprefetchwt1, -mno-prefetchwt1
2370
Richard Smith081ad4d2017-01-24 19:39:46 +00002371.. option:: -mprfchw, -mno-prfchw
2372
Richard Smith081ad4d2017-01-24 19:39:46 +00002373.. option:: -mrdrnd, -mno-rdrnd
2374
Richard Smith081ad4d2017-01-24 19:39:46 +00002375.. option:: -mrdseed, -mno-rdseed
2376
Richard Smith081ad4d2017-01-24 19:39:46 +00002377.. option:: -mrtm, -mno-rtm
2378
Craig Topper204ecff2017-02-08 08:23:17 +00002379.. option:: -msgx, -mno-sgx
2380
Richard Smith081ad4d2017-01-24 19:39:46 +00002381.. option:: -msha, -mno-sha
2382
Richard Smith081ad4d2017-01-24 19:39:46 +00002383.. option:: -msse, -mno-sse
2384
Richard Smith081ad4d2017-01-24 19:39:46 +00002385.. option:: -msse2, -mno-sse2
2386
Richard Smith081ad4d2017-01-24 19:39:46 +00002387.. option:: -msse3, -mno-sse3
2388
Richard Smith081ad4d2017-01-24 19:39:46 +00002389.. option:: -msse4.1, -mno-sse4.1
2390
Richard Smithb2c82a62017-01-27 01:54:42 +00002391.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002392.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00002393.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002394
Richard Smith081ad4d2017-01-24 19:39:46 +00002395.. option:: -msse4a, -mno-sse4a
2396
Richard Smith081ad4d2017-01-24 19:39:46 +00002397.. option:: -mssse3, -mno-ssse3
2398
Richard Smith081ad4d2017-01-24 19:39:46 +00002399.. option:: -mtbm, -mno-tbm
2400
Richard Smith081ad4d2017-01-24 19:39:46 +00002401.. option:: -mx87, -m80387, -mno-x87
2402
Richard Smith081ad4d2017-01-24 19:39:46 +00002403.. option:: -mxop, -mno-xop
2404
Richard Smith081ad4d2017-01-24 19:39:46 +00002405.. option:: -mxsave, -mno-xsave
2406
Richard Smith081ad4d2017-01-24 19:39:46 +00002407.. option:: -mxsavec, -mno-xsavec
2408
Richard Smith081ad4d2017-01-24 19:39:46 +00002409.. option:: -mxsaveopt, -mno-xsaveopt
2410
Richard Smith081ad4d2017-01-24 19:39:46 +00002411.. option:: -mxsaves, -mno-xsaves
2412
2413Optimization level
2414~~~~~~~~~~~~~~~~~~
2415
2416Flags controlling how much optimization should be performed.
2417
Richard Smith081ad4d2017-01-24 19:39:46 +00002418.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2419
Richard Smith081ad4d2017-01-24 19:39:46 +00002420.. option:: -Ofast<arg>
2421
2422Debug information generation
2423~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2424
2425Flags controlling how much and what kind of debug information should be
2426generated.
2427
2428Kind and level of debug information
2429-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002430.. option:: -g, --debug, --debug=<arg>
2431
2432Generate source-level debug information
2433
Richard Smith081ad4d2017-01-24 19:39:46 +00002434.. option:: -gdwarf-2
2435
2436Generate source-level debug information with dwarf version 2
2437
Richard Smith081ad4d2017-01-24 19:39:46 +00002438.. option:: -gdwarf-3
2439
2440Generate source-level debug information with dwarf version 3
2441
Richard Smith081ad4d2017-01-24 19:39:46 +00002442.. option:: -gdwarf-4, -gdwarf
2443
2444Generate source-level debug information with dwarf version 4
2445
Richard Smith081ad4d2017-01-24 19:39:46 +00002446.. option:: -gdwarf-5
2447
2448Generate source-level debug information with dwarf version 5
2449
Richard Smith081ad4d2017-01-24 19:39:46 +00002450.. option:: -gfull
2451
Richard Smith081ad4d2017-01-24 19:39:46 +00002452.. option:: -gused
2453
2454Debug level
2455___________
Richard Smith081ad4d2017-01-24 19:39:46 +00002456.. option:: -g0
2457
Richard Smith081ad4d2017-01-24 19:39:46 +00002458.. option:: -g2
2459
Richard Smith081ad4d2017-01-24 19:39:46 +00002460.. option:: -g3
2461
Richard Smith081ad4d2017-01-24 19:39:46 +00002462.. option:: -ggdb0
2463
Richard Smith081ad4d2017-01-24 19:39:46 +00002464.. option:: -ggdb1
2465
Richard Smith081ad4d2017-01-24 19:39:46 +00002466.. option:: -ggdb2
2467
Richard Smith081ad4d2017-01-24 19:39:46 +00002468.. option:: -ggdb3
2469
Richard Smith081ad4d2017-01-24 19:39:46 +00002470.. option:: -gline-tables-only, -g1, -gmlt
2471
2472Emit debug line number tables only
2473
Richard Smith081ad4d2017-01-24 19:39:46 +00002474.. option:: -gmodules
2475
2476Generate debug info with external references to clang modules or precompiled headers
2477
2478Debugger to tune debug information for
2479______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00002480.. option:: -ggdb
2481
Richard Smith081ad4d2017-01-24 19:39:46 +00002482.. option:: -glldb
2483
Richard Smith081ad4d2017-01-24 19:39:46 +00002484.. option:: -gsce
2485
2486Debug information flags
2487-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002488.. option:: -gcolumn-info, -gno-column-info
2489
Richard Smith081ad4d2017-01-24 19:39:46 +00002490.. option:: -gdwarf-aranges
2491
Richard Smith081ad4d2017-01-24 19:39:46 +00002492.. option:: -ggnu-pubnames
2493
Richard Smith081ad4d2017-01-24 19:39:46 +00002494.. option:: -grecord-gcc-switches, -gno-record-gcc-switches
2495
Richard Smith081ad4d2017-01-24 19:39:46 +00002496.. option:: -gsplit-dwarf
2497
Richard Smith081ad4d2017-01-24 19:39:46 +00002498.. option:: -gstrict-dwarf, -gno-strict-dwarf
2499
Craig Topperd23254a2017-07-20 17:52:48 +00002500.. option:: -gz
2501
2502DWARF debug sections compression type
2503
2504.. program:: clang1
2505.. option:: -gz=<arg>
2506.. program:: clang
2507
2508DWARF debug sections compression type
2509
Richard Smithc5b2e002017-01-27 02:08:37 +00002510Static analyzer flags
2511=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00002512
Richard Smithc5b2e002017-01-27 02:08:37 +00002513Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00002514
Richard Smithc5b2e002017-01-27 02:08:37 +00002515.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002516
Richard Smithc5b2e002017-01-27 02:08:37 +00002517Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00002518
2519Fortran compilation flags
2520=========================
2521
2522Flags that will be passed onto the ``gfortran`` compiler when Clang is given
2523a Fortran input.
2524
Richard Smithc5b2e002017-01-27 02:08:37 +00002525.. option:: -A<arg>, --assert <arg>, --assert=<arg>
2526
Richard Smith081ad4d2017-01-24 19:39:46 +00002527.. option:: -A-<arg>
2528
Richard Smith081ad4d2017-01-24 19:39:46 +00002529.. option:: -J<arg>
2530
Richard Smith081ad4d2017-01-24 19:39:46 +00002531.. option:: -cpp
2532
Richard Smith081ad4d2017-01-24 19:39:46 +00002533.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
2534
Richard Smith081ad4d2017-01-24 19:39:46 +00002535.. option:: -falign-commons, -fno-align-commons
2536
Richard Smith081ad4d2017-01-24 19:39:46 +00002537.. option:: -fall-intrinsics, -fno-all-intrinsics
2538
Richard Smith081ad4d2017-01-24 19:39:46 +00002539.. option:: -fautomatic, -fno-automatic
2540
Richard Smith081ad4d2017-01-24 19:39:46 +00002541.. option:: -fbackslash, -fno-backslash
2542
Richard Smith081ad4d2017-01-24 19:39:46 +00002543.. option:: -fbacktrace, -fno-backtrace
2544
Richard Smith081ad4d2017-01-24 19:39:46 +00002545.. option:: -fblas-matmul-limit=<arg>
2546
Richard Smith081ad4d2017-01-24 19:39:46 +00002547.. option:: -fbounds-check, -fno-bounds-check
2548
Richard Smith081ad4d2017-01-24 19:39:46 +00002549.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
2550
Richard Smith081ad4d2017-01-24 19:39:46 +00002551.. option:: -fcheck=<arg>
2552
Richard Smith081ad4d2017-01-24 19:39:46 +00002553.. option:: -fcoarray=<arg>
2554
Richard Smith081ad4d2017-01-24 19:39:46 +00002555.. option:: -fconvert=<arg>
2556
Richard Smith081ad4d2017-01-24 19:39:46 +00002557.. option:: -fcray-pointer, -fno-cray-pointer
2558
Richard Smith081ad4d2017-01-24 19:39:46 +00002559.. option:: -fd-lines-as-code, -fno-d-lines-as-code
2560
Richard Smith081ad4d2017-01-24 19:39:46 +00002561.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
2562
Richard Smith081ad4d2017-01-24 19:39:46 +00002563.. option:: -fdefault-double-8, -fno-default-double-8
2564
Richard Smith081ad4d2017-01-24 19:39:46 +00002565.. option:: -fdefault-integer-8, -fno-default-integer-8
2566
Richard Smith081ad4d2017-01-24 19:39:46 +00002567.. option:: -fdefault-real-8, -fno-default-real-8
2568
Richard Smith081ad4d2017-01-24 19:39:46 +00002569.. option:: -fdollar-ok, -fno-dollar-ok
2570
Richard Smith081ad4d2017-01-24 19:39:46 +00002571.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
2572
Richard Smith081ad4d2017-01-24 19:39:46 +00002573.. option:: -fdump-fortran-original, -fno-dump-fortran-original
2574
Richard Smith081ad4d2017-01-24 19:39:46 +00002575.. option:: -fdump-parse-tree, -fno-dump-parse-tree
2576
Richard Smith081ad4d2017-01-24 19:39:46 +00002577.. option:: -fexternal-blas, -fno-external-blas
2578
Richard Smith081ad4d2017-01-24 19:39:46 +00002579.. option:: -ff2c, -fno-f2c
2580
Richard Smith081ad4d2017-01-24 19:39:46 +00002581.. option:: -ffixed-form, -fno-fixed-form
2582
Richard Smith081ad4d2017-01-24 19:39:46 +00002583.. option:: -ffixed-line-length-<arg>
2584
Richard Smith081ad4d2017-01-24 19:39:46 +00002585.. option:: -ffpe-trap=<arg>
2586
Richard Smith081ad4d2017-01-24 19:39:46 +00002587.. option:: -ffree-form, -fno-free-form
2588
Richard Smith081ad4d2017-01-24 19:39:46 +00002589.. option:: -ffree-line-length-<arg>
2590
Richard Smith081ad4d2017-01-24 19:39:46 +00002591.. option:: -ffrontend-optimize, -fno-frontend-optimize
2592
Richard Smith081ad4d2017-01-24 19:39:46 +00002593.. option:: -fimplicit-none, -fno-implicit-none
2594
Richard Smith081ad4d2017-01-24 19:39:46 +00002595.. option:: -finit-character=<arg>
2596
Richard Smith081ad4d2017-01-24 19:39:46 +00002597.. option:: -finit-integer=<arg>
2598
Richard Smith081ad4d2017-01-24 19:39:46 +00002599.. option:: -finit-local-zero, -fno-init-local-zero
2600
Richard Smith081ad4d2017-01-24 19:39:46 +00002601.. option:: -finit-logical=<arg>
2602
Richard Smith081ad4d2017-01-24 19:39:46 +00002603.. option:: -finit-real=<arg>
2604
Richard Smith081ad4d2017-01-24 19:39:46 +00002605.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
2606
Richard Smith081ad4d2017-01-24 19:39:46 +00002607.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
2608
Richard Smith081ad4d2017-01-24 19:39:46 +00002609.. option:: -fmax-array-constructor=<arg>
2610
Richard Smith081ad4d2017-01-24 19:39:46 +00002611.. option:: -fmax-errors=<arg>
2612
Richard Smith081ad4d2017-01-24 19:39:46 +00002613.. option:: -fmax-identifier-length, -fno-max-identifier-length
2614
Richard Smith081ad4d2017-01-24 19:39:46 +00002615.. option:: -fmax-stack-var-size=<arg>
2616
Richard Smith081ad4d2017-01-24 19:39:46 +00002617.. option:: -fmax-subrecord-length=<arg>
2618
Richard Smith081ad4d2017-01-24 19:39:46 +00002619.. option:: -fmodule-private, -fno-module-private
2620
Richard Smith081ad4d2017-01-24 19:39:46 +00002621.. option:: -fpack-derived, -fno-pack-derived
2622
Richard Smith081ad4d2017-01-24 19:39:46 +00002623.. option:: -fprotect-parens, -fno-protect-parens
2624
Richard Smith081ad4d2017-01-24 19:39:46 +00002625.. option:: -frange-check, -fno-range-check
2626
Richard Smith081ad4d2017-01-24 19:39:46 +00002627.. option:: -freal-4-real-10, -fno-real-4-real-10
2628
Richard Smith081ad4d2017-01-24 19:39:46 +00002629.. option:: -freal-4-real-16, -fno-real-4-real-16
2630
Richard Smith081ad4d2017-01-24 19:39:46 +00002631.. option:: -freal-4-real-8, -fno-real-4-real-8
2632
Richard Smith081ad4d2017-01-24 19:39:46 +00002633.. option:: -freal-8-real-10, -fno-real-8-real-10
2634
Richard Smith081ad4d2017-01-24 19:39:46 +00002635.. option:: -freal-8-real-16, -fno-real-8-real-16
2636
Richard Smith081ad4d2017-01-24 19:39:46 +00002637.. option:: -freal-8-real-4, -fno-real-8-real-4
2638
Richard Smith081ad4d2017-01-24 19:39:46 +00002639.. option:: -frealloc-lhs, -fno-realloc-lhs
2640
Richard Smith081ad4d2017-01-24 19:39:46 +00002641.. option:: -frecord-marker=<arg>
2642
Richard Smith081ad4d2017-01-24 19:39:46 +00002643.. option:: -frecursive, -fno-recursive
2644
Richard Smith081ad4d2017-01-24 19:39:46 +00002645.. option:: -frepack-arrays, -fno-repack-arrays
2646
Richard Smith081ad4d2017-01-24 19:39:46 +00002647.. option:: -fsecond-underscore, -fno-second-underscore
2648
Richard Smith081ad4d2017-01-24 19:39:46 +00002649.. option:: -fsign-zero, -fno-sign-zero
2650
Richard Smith081ad4d2017-01-24 19:39:46 +00002651.. option:: -fstack-arrays, -fno-stack-arrays
2652
Richard Smith081ad4d2017-01-24 19:39:46 +00002653.. option:: -funderscoring, -fno-underscoring
2654
Richard Smith081ad4d2017-01-24 19:39:46 +00002655.. option:: -fwhole-file, -fno-whole-file
2656
Richard Smith081ad4d2017-01-24 19:39:46 +00002657.. option:: -nocpp
2658
Richard Smith081ad4d2017-01-24 19:39:46 +00002659.. option:: -static-libgfortran
2660
Richard Smithc5b2e002017-01-27 02:08:37 +00002661Linker flags
2662============
2663Flags that are passed on to the linker
2664
2665.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
2666
2667Add directory to library search path
2668
2669.. option:: -Mach
2670
2671.. option:: -T<script>
2672
2673Specify <script> as linker script
2674
Richard Smith78e23fd2017-04-13 22:39:49 +00002675.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00002676
2677Set starting address of BSS to <addr>
2678
Richard Smith78e23fd2017-04-13 22:39:49 +00002679.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00002680
2681Set starting address of BSS to <addr>
2682
Richard Smith78e23fd2017-04-13 22:39:49 +00002683.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00002684
2685Set starting address of BSS to <addr>
2686
2687.. option:: -Wl,<arg>,<arg2>...
2688
2689Pass the comma separated arguments in <arg> to the linker
2690
2691.. option:: -X
2692
2693.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
2694
2695Pass <arg> to the linker
2696
2697.. program:: clang1
2698.. option:: -Z
2699.. program:: clang
2700
2701.. option:: -e<arg>, --entry
2702
2703.. option:: -filelist <arg>
2704
2705.. option:: -l<arg>
2706
2707.. option:: -r
2708
2709.. option:: -rpath <arg>
2710
2711.. option:: -s
2712
2713.. option:: -t
2714
2715.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
2716
2717.. option:: -undef
2718
2719undef all system defines
2720
2721.. option:: -undefined<arg>, --no-undefined
2722
2723.. option:: -z <arg>
2724
2725Pass -z <arg> to the linker
2726