blob: eb0519988fa2f99fd420a2f2b6b96a198c63ce7d [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
Vedant Kumar368540f2018-08-23 17:55:03 +000039.. option:: -Qn, -fno-ident
Craig Topper42da9cb2018-04-23 21:41:06 +000040
41Do not emit metadata containing compiler name and version
42
Richard Smith081ad4d2017-01-24 19:39:46 +000043.. option:: -Qunused-arguments
44
45Don't emit warning for unused driver arguments
46
Vedant Kumar368540f2018-08-23 17:55:03 +000047.. option:: -Qy, -fident
Craig Topper42da9cb2018-04-23 21:41:06 +000048
49Emit metadata containing compiler name and version
50
Richard Smith081ad4d2017-01-24 19:39:46 +000051.. option:: -Wa,<arg>,<arg2>...
52
53Pass the comma separated arguments in <arg> to the assembler
54
Richard Smith081ad4d2017-01-24 19:39:46 +000055.. option:: -Wlarge-by-value-copy=<arg>
56
Richard Smith081ad4d2017-01-24 19:39:46 +000057.. option:: -Xarch\_<arg1> <arg2>
58
Richard Smith081ad4d2017-01-24 19:39:46 +000059.. option:: -Xcuda-fatbinary <arg>
60
61Pass <arg> to fatbinary invocation
62
Richard Smith081ad4d2017-01-24 19:39:46 +000063.. option:: -Xcuda-ptxas <arg>
64
65Pass <arg> to the ptxas assembler
66
Boris Kolpackovb150d242017-08-30 09:15:53 +000067.. option:: -Xopenmp-target <arg>
68
69Pass <arg> to the target offloading toolchain.
70
71.. program:: clang1
Jonas Hahnfelda180fc42018-02-22 17:10:28 +000072.. option:: -Xopenmp-target=<triple> <arg>
Boris Kolpackovb150d242017-08-30 09:15:53 +000073.. program:: clang
74
Jonas Hahnfelda180fc42018-02-22 17:10:28 +000075Pass <arg> to the target offloading toolchain identified by <triple>.
Boris Kolpackovb150d242017-08-30 09:15:53 +000076
Richard Smith081ad4d2017-01-24 19:39:46 +000077.. option:: -Z<arg>
78
Richard Smith081ad4d2017-01-24 19:39:46 +000079.. option:: -a<arg>, --profile-blocks
80
Richard Smith081ad4d2017-01-24 19:39:46 +000081.. option:: -all\_load
82
Richard Smith081ad4d2017-01-24 19:39:46 +000083.. option:: -allowable\_client <arg>
84
Richard Smith081ad4d2017-01-24 19:39:46 +000085.. option:: --analyze
86
87Run the static analyzer
88
Richard Smith081ad4d2017-01-24 19:39:46 +000089.. option:: --analyzer-no-default-checks
90
Richard Smith081ad4d2017-01-24 19:39:46 +000091.. option:: --analyzer-output<arg>
92
93Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text).
94
Richard Smith081ad4d2017-01-24 19:39:46 +000095.. option:: -ansi, --ansi
96
Richard Smith081ad4d2017-01-24 19:39:46 +000097.. option:: -arch <arg>
98
Richard Smithb2c82a62017-01-27 01:54:42 +000099.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000100.. option:: -arch\_errors\_fatal
Richard Smithb2c82a62017-01-27 01:54:42 +0000101.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000102
Richard Smithb2c82a62017-01-27 01:54:42 +0000103.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000104.. option:: -arch\_only <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000105.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000106
Richard Smith081ad4d2017-01-24 19:39:46 +0000107.. option:: -arcmt-migrate-emit-errors
108
109Emit ARC errors even if the migrator can fix them
110
Richard Smith081ad4d2017-01-24 19:39:46 +0000111.. option:: -arcmt-migrate-report-output <arg>
112
113Output path for the plist report
114
Craig Topperd23254a2017-07-20 17:52:48 +0000115.. option:: --autocomplete=<arg>
116
Richard Smith081ad4d2017-01-24 19:39:46 +0000117.. option:: -bind\_at\_load
118
Richard Smith081ad4d2017-01-24 19:39:46 +0000119.. option:: -bundle
120
Richard Smithb2c82a62017-01-27 01:54:42 +0000121.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000122.. option:: -bundle\_loader <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000123.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000124
Craig Topper596527b2018-01-23 18:40:15 +0000125.. option:: -cfguard
126
Andrew Paverdd157a9b2019-10-28 13:22:19 +0000127Emit tables and checks for Windows Control Flow Guard.
128
129.. option:: -cfguard-no-checks
130
131Emit tables required for Windows Control Flow Guard without checks.
Craig Topper596527b2018-01-23 18:40:15 +0000132
Richard Smith081ad4d2017-01-24 19:39:46 +0000133.. option:: -client\_name<arg>
134
Richard Smith081ad4d2017-01-24 19:39:46 +0000135.. option:: -compatibility\_version<arg>
136
Craig Topper287c8012018-01-03 18:29:12 +0000137.. option:: --config <arg>
138
139Specifies configuration file
140
Richard Smith081ad4d2017-01-24 19:39:46 +0000141.. option:: --constant-cfstrings
142
Richard Smith081ad4d2017-01-24 19:39:46 +0000143.. option:: -coverage, --coverage
144
Richard Smith081ad4d2017-01-24 19:39:46 +0000145.. option:: --cuda-compile-host-device
146
147Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations.
148
Richard Smith081ad4d2017-01-24 19:39:46 +0000149.. option:: --cuda-device-only
150
151Compile CUDA code for device only
152
Richard Smith081ad4d2017-01-24 19:39:46 +0000153.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
154
155CUDA GPU architecture (e.g. sm\_35). May be specified more than once.
156
Richard Smith081ad4d2017-01-24 19:39:46 +0000157.. option:: --cuda-host-only
158
159Compile CUDA code for host only. Has no effect on non-CUDA compilations.
160
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000161.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg>
162
Sylvestre Ledru90f1dfb2019-01-01 12:51:14 +0000163Include PTX for the following GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once.
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000164
Richard Smith081ad4d2017-01-24 19:39:46 +0000165.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
166
167Enable device-side debug info generation. Disables ptxas optimizations.
168
Richard Smith081ad4d2017-01-24 19:39:46 +0000169.. option:: -current\_version<arg>
170
Richard Smith081ad4d2017-01-24 19:39:46 +0000171.. option:: -dead\_strip
172
Richard Smith081ad4d2017-01-24 19:39:46 +0000173.. option:: -dependency-dot <arg>
174
175Filename to write DOT-formatted header dependencies to
176
Richard Smith081ad4d2017-01-24 19:39:46 +0000177.. option:: -dependency-file <arg>
178
179Filename (or -) to write dependency output to
180
Richard Smith081ad4d2017-01-24 19:39:46 +0000181.. option:: -dumpmachine
182
Richard Smith081ad4d2017-01-24 19:39:46 +0000183.. option:: -dumpversion
184
Richard Smith081ad4d2017-01-24 19:39:46 +0000185.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
186
Richard Smith081ad4d2017-01-24 19:39:46 +0000187.. option:: -dylib\_file <arg>
188
Richard Smith081ad4d2017-01-24 19:39:46 +0000189.. option:: -dylinker
190
Richard Smithb2c82a62017-01-27 01:54:42 +0000191.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000192.. option:: -dylinker\_install\_name<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000193.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000194
Richard Smith081ad4d2017-01-24 19:39:46 +0000195.. option:: -dynamic
196
Richard Smith081ad4d2017-01-24 19:39:46 +0000197.. option:: -dynamiclib
198
Richard Smith081ad4d2017-01-24 19:39:46 +0000199.. option:: -emit-ast
200
201Emit Clang AST files for source inputs
202
Richard Smith081ad4d2017-01-24 19:39:46 +0000203.. option:: -exported\_symbols\_list <arg>
204
Richard Smith081ad4d2017-01-24 19:39:46 +0000205.. option:: -faligned-new=<arg>
206
Richard Smith081ad4d2017-01-24 19:39:46 +0000207.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
208
209Use approximate transcendental functions
210
Richard Smith081ad4d2017-01-24 19:39:46 +0000211.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
212
213Flush denormal floating point values to zero in CUDA device mode.
214
Craig Topper42da9cb2018-04-23 21:41:06 +0000215.. option:: -fcuda-rdc, -fno-cuda-rdc
216
217Generate relocatable device code, also known as separate compilation mode.
218
Vedant Kumar368540f2018-08-23 17:55:03 +0000219.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
220
221Use 32-bit pointers for accessing const/local/shared address spaces.
222
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000223.. option:: -ffixed-r19
224
Vedant Kumar368540f2018-08-23 17:55:03 +0000225Reserve register r19 (Hexagon only)
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000226
Richard Smith081ad4d2017-01-24 19:39:46 +0000227.. option:: -fheinous-gnu-extensions
228
Richard Smith081ad4d2017-01-24 19:39:46 +0000229.. option:: -flat\_namespace
230
Richard Smith081ad4d2017-01-24 19:39:46 +0000231.. option:: -fopenmp-targets=<arg1>,<arg2>...
232
233Specify comma-separated list of triples OpenMP offloading targets to be supported
234
Richard Smith081ad4d2017-01-24 19:39:46 +0000235.. option:: -force\_cpusubtype\_ALL
236
Richard Smithb2c82a62017-01-27 01:54:42 +0000237.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000238.. option:: -force\_flat\_namespace
Richard Smithb2c82a62017-01-27 01:54:42 +0000239.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000240
Richard Smithb2c82a62017-01-27 01:54:42 +0000241.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000242.. option:: -force\_load <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000243.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000244
Richard Smith081ad4d2017-01-24 19:39:46 +0000245.. option:: -framework <arg>
246
Richard Smith78e23fd2017-04-13 22:39:49 +0000247.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
248
249Add -rpath with architecture-specific resource directory to the linker flags
250
Richard Smith081ad4d2017-01-24 19:39:46 +0000251.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
252
253Use the gcc toolchain at the given directory
254
Richard Smith081ad4d2017-01-24 19:39:46 +0000255.. option:: -gcodeview
256
257Generate CodeView debug information
258
Richard Smith081ad4d2017-01-24 19:39:46 +0000259.. option:: -headerpad\_max\_install\_names<arg>
260
Richard Smith081ad4d2017-01-24 19:39:46 +0000261.. option:: -help, --help
262
263Display available options
264
Richard Smith081ad4d2017-01-24 19:39:46 +0000265.. option:: --help-hidden
266
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000267Display help for hidden options
268
Vedant Kumar368540f2018-08-23 17:55:03 +0000269.. option:: --hip-link
270
271Link clang-offload-bundler bundles for HIP
272
Richard Smith081ad4d2017-01-24 19:39:46 +0000273.. option:: -image\_base <arg>
274
Richard Smith081ad4d2017-01-24 19:39:46 +0000275.. option:: -index-header-map
276
277Make the next included directory (-I or -F) an indexer header map
278
Richard Smith081ad4d2017-01-24 19:39:46 +0000279.. option:: -init <arg>
280
Richard Smith081ad4d2017-01-24 19:39:46 +0000281.. option:: -install\_name <arg>
282
Richard Smith081ad4d2017-01-24 19:39:46 +0000283.. option:: -keep\_private\_externs
284
Richard Smith081ad4d2017-01-24 19:39:46 +0000285.. option:: -lazy\_framework <arg>
286
Richard Smithb2c82a62017-01-27 01:54:42 +0000287.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000288.. option:: -lazy\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000289.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000290
Richard Smith081ad4d2017-01-24 19:39:46 +0000291.. option:: -mbig-endian, -EB
292
Richard Smith081ad4d2017-01-24 19:39:46 +0000293.. option:: --migrate
294
295Run the migrator
296
Richard Smith78e23fd2017-04-13 22:39:49 +0000297.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
298
Richard Smith081ad4d2017-01-24 19:39:46 +0000299.. option:: -mlinker-version=<arg>
300
Richard Smith081ad4d2017-01-24 19:39:46 +0000301.. option:: -mlittle-endian, -EL
302
Richard Smith081ad4d2017-01-24 19:39:46 +0000303.. option:: -mllvm <arg>
304
305Additional arguments to forward to LLVM's option processing
306
Richard Smith081ad4d2017-01-24 19:39:46 +0000307.. option:: -module-dependency-dir <arg>
308
309Directory to dump module dependencies to
310
Richard Smith78e23fd2017-04-13 22:39:49 +0000311.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
312
Richard Smith081ad4d2017-01-24 19:39:46 +0000313.. option:: -multi\_module
314
Richard Smith081ad4d2017-01-24 19:39:46 +0000315.. option:: -multiply\_defined <arg>
316
Richard Smithb2c82a62017-01-27 01:54:42 +0000317.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000318.. option:: -multiply\_defined\_unused <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000319.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000320
Richard Smith78e23fd2017-04-13 22:39:49 +0000321.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
322
Richard Smith081ad4d2017-01-24 19:39:46 +0000323.. option:: --no-cuda-version-check
324
325Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
326
Richard Smith081ad4d2017-01-24 19:39:46 +0000327.. option:: -no-integrated-cpp, --no-integrated-cpp
328
Richard Smith081ad4d2017-01-24 19:39:46 +0000329.. option:: -no\_dead\_strip\_inits\_and\_terms
330
Richard Smith081ad4d2017-01-24 19:39:46 +0000331.. option:: -nobuiltininc
332
333Disable builtin #include directories
334
Richard Smith081ad4d2017-01-24 19:39:46 +0000335.. option:: -nocudainc
336
Richard Smith081ad4d2017-01-24 19:39:46 +0000337.. option:: -nocudalib
338
Richard Smith081ad4d2017-01-24 19:39:46 +0000339.. option:: -nodefaultlibs
340
Richard Smith081ad4d2017-01-24 19:39:46 +0000341.. option:: -nofixprebinding
342
Richard Smith081ad4d2017-01-24 19:39:46 +0000343.. option:: -nolibc
344
Richard Smith081ad4d2017-01-24 19:39:46 +0000345.. option:: -nomultidefs
346
Craig Topperd23254a2017-07-20 17:52:48 +0000347.. option:: -nopie, -no-pie
Richard Smith081ad4d2017-01-24 19:39:46 +0000348
Richard Smith081ad4d2017-01-24 19:39:46 +0000349.. option:: -noprebind
350
Petr Hosek08cb3422019-07-11 19:06:38 +0000351.. option:: -noprofilelib
352
Richard Smith081ad4d2017-01-24 19:39:46 +0000353.. option:: -noseglinkedit
354
Richard Smith081ad4d2017-01-24 19:39:46 +0000355.. option:: -nostartfiles
356
Richard Smith081ad4d2017-01-24 19:39:46 +0000357.. option:: -nostdinc, --no-standard-includes
358
Richard Smithb2c82a62017-01-27 01:54:42 +0000359.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000360.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000361.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000362
363Disable standard #include directories for the C++ standard library
364
Richard Smith081ad4d2017-01-24 19:39:46 +0000365.. option:: -nostdlib, --no-standard-libraries
366
Boris Kolpackovb150d242017-08-30 09:15:53 +0000367.. program:: clang1
368.. option:: -nostdlib++
369.. program:: clang
370
Richard Smith081ad4d2017-01-24 19:39:46 +0000371.. option:: -nostdlibinc
372
Richard Smith081ad4d2017-01-24 19:39:46 +0000373.. option:: -o<file>, --output <arg>, --output=<arg>
374
375Write output to <file>
376
Richard Smith081ad4d2017-01-24 19:39:46 +0000377.. option:: -objcmt-atomic-property
378
379Make migration to 'atomic' properties
380
Richard Smith081ad4d2017-01-24 19:39:46 +0000381.. option:: -objcmt-migrate-all
382
383Enable migration to modern ObjC
384
Richard Smith081ad4d2017-01-24 19:39:46 +0000385.. option:: -objcmt-migrate-annotation
386
387Enable migration to property and method annotations
388
Richard Smith081ad4d2017-01-24 19:39:46 +0000389.. option:: -objcmt-migrate-designated-init
390
391Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
392
Richard Smith081ad4d2017-01-24 19:39:46 +0000393.. option:: -objcmt-migrate-instancetype
394
395Enable migration to infer instancetype for method result type
396
Richard Smith081ad4d2017-01-24 19:39:46 +0000397.. option:: -objcmt-migrate-literals
398
399Enable migration to modern ObjC literals
400
Richard Smith081ad4d2017-01-24 19:39:46 +0000401.. option:: -objcmt-migrate-ns-macros
402
403Enable migration to NS\_ENUM/NS\_OPTIONS macros
404
Richard Smith081ad4d2017-01-24 19:39:46 +0000405.. option:: -objcmt-migrate-property
406
407Enable migration to modern ObjC property
408
Richard Smith081ad4d2017-01-24 19:39:46 +0000409.. option:: -objcmt-migrate-property-dot-syntax
410
411Enable migration of setter/getter messages to property-dot syntax
412
Richard Smith081ad4d2017-01-24 19:39:46 +0000413.. option:: -objcmt-migrate-protocol-conformance
414
415Enable migration to add protocol conformance on classes
416
Richard Smith081ad4d2017-01-24 19:39:46 +0000417.. option:: -objcmt-migrate-readonly-property
418
419Enable migration to modern ObjC readonly property
420
Richard Smith081ad4d2017-01-24 19:39:46 +0000421.. option:: -objcmt-migrate-readwrite-property
422
423Enable migration to modern ObjC readwrite property
424
Richard Smith081ad4d2017-01-24 19:39:46 +0000425.. option:: -objcmt-migrate-subscripting
426
427Enable migration to modern ObjC subscripting
428
Richard Smith081ad4d2017-01-24 19:39:46 +0000429.. option:: -objcmt-ns-nonatomic-iosonly
430
431Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
432
Richard Smith081ad4d2017-01-24 19:39:46 +0000433.. option:: -objcmt-returns-innerpointer-property
434
435Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
436
Richard Smith081ad4d2017-01-24 19:39:46 +0000437.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
438
439Only modify files with a filename contained in the provided directory path
440
Richard Smith081ad4d2017-01-24 19:39:46 +0000441.. option:: -object
442
Richard Smith081ad4d2017-01-24 19:39:46 +0000443.. option:: -p, --profile
444
Richard Smith081ad4d2017-01-24 19:39:46 +0000445.. option:: -pagezero\_size<arg>
446
Richard Smith081ad4d2017-01-24 19:39:46 +0000447.. option:: -pg
448
449Enable mcount instrumentation
450
Richard Smith081ad4d2017-01-24 19:39:46 +0000451.. option:: -pie
452
Richard Smith081ad4d2017-01-24 19:39:46 +0000453.. option:: -pipe, --pipe
454
455Use pipes between commands, when possible
456
Richard Smith081ad4d2017-01-24 19:39:46 +0000457.. option:: -prebind
458
Richard Smithb2c82a62017-01-27 01:54:42 +0000459.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000460.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000461.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000462
Richard Smith081ad4d2017-01-24 19:39:46 +0000463.. option:: -preload
464
Richard Smith081ad4d2017-01-24 19:39:46 +0000465.. option:: --print-diagnostic-categories
466
Vedant Kumar368540f2018-08-23 17:55:03 +0000467.. option:: -print-effective-triple, --print-effective-triple
468
469Print the effective target triple
470
Richard Smith081ad4d2017-01-24 19:39:46 +0000471.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
472
473Print the full library path of <file>
474
Richard Smith081ad4d2017-01-24 19:39:46 +0000475.. option:: -print-ivar-layout
476
477Enable Objective-C Ivar layout bitmap print trace
478
Richard Smith081ad4d2017-01-24 19:39:46 +0000479.. option:: -print-libgcc-file-name, --print-libgcc-file-name
480
481Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
482
Richard Smith081ad4d2017-01-24 19:39:46 +0000483.. option:: -print-multi-directory, --print-multi-directory
484
Richard Smith081ad4d2017-01-24 19:39:46 +0000485.. option:: -print-multi-lib, --print-multi-lib
486
Richard Smith081ad4d2017-01-24 19:39:46 +0000487.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
488
489Print the full program path of <name>
490
Richard Smith78e23fd2017-04-13 22:39:49 +0000491.. option:: -print-resource-dir, --print-resource-dir
492
493Print the resource directory pathname
494
Richard Smith081ad4d2017-01-24 19:39:46 +0000495.. option:: -print-search-dirs, --print-search-dirs
496
497Print the paths used for finding libraries and programs
498
Vedant Kumar368540f2018-08-23 17:55:03 +0000499.. option:: -print-target-triple, --print-target-triple
500
501Print the normalized target triple
502
Richard Smith081ad4d2017-01-24 19:39:46 +0000503.. option:: -private\_bundle
504
Richard Smith081ad4d2017-01-24 19:39:46 +0000505.. option:: -pthread, -no-pthread
506
507Support POSIX threads in generated code
508
Richard Smith081ad4d2017-01-24 19:39:46 +0000509.. option:: -pthreads
510
Richard Smith081ad4d2017-01-24 19:39:46 +0000511.. option:: -rdynamic
512
Richard Smith081ad4d2017-01-24 19:39:46 +0000513.. option:: -read\_only\_relocs <arg>
514
Richard Smith081ad4d2017-01-24 19:39:46 +0000515.. option:: -relocatable-pch, --relocatable-pch
516
517Whether to build a relocatable precompiled header
518
Richard Smith081ad4d2017-01-24 19:39:46 +0000519.. option:: -remap
520
Richard Smith081ad4d2017-01-24 19:39:46 +0000521.. option:: -rewrite-legacy-objc
522
523Rewrite Legacy Objective-C source to C++
524
Richard Smith081ad4d2017-01-24 19:39:46 +0000525.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
526
527Compiler runtime library to use
528
Richard Smith081ad4d2017-01-24 19:39:46 +0000529.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
530
531Save llvm statistics.
532
Richard Smith081ad4d2017-01-24 19:39:46 +0000533.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
534
535Save intermediate compilation results.
536
Richard Smith081ad4d2017-01-24 19:39:46 +0000537.. option:: -sectalign <arg1> <arg2> <arg3>
538
Richard Smith081ad4d2017-01-24 19:39:46 +0000539.. option:: -sectcreate <arg1> <arg2> <arg3>
540
Richard Smith081ad4d2017-01-24 19:39:46 +0000541.. option:: -sectobjectsymbols <arg1> <arg2>
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -sectorder <arg1> <arg2> <arg3>
544
Richard Smith081ad4d2017-01-24 19:39:46 +0000545.. option:: -seg1addr<arg>
546
Richard Smith081ad4d2017-01-24 19:39:46 +0000547.. option:: -seg\_addr\_table <arg>
548
Richard Smithb2c82a62017-01-27 01:54:42 +0000549.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000550.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000551.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000552
Richard Smith081ad4d2017-01-24 19:39:46 +0000553.. option:: -segaddr <arg1> <arg2>
554
Richard Smith081ad4d2017-01-24 19:39:46 +0000555.. option:: -segcreate <arg1> <arg2> <arg3>
556
Richard Smith081ad4d2017-01-24 19:39:46 +0000557.. option:: -seglinkedit
558
Richard Smith081ad4d2017-01-24 19:39:46 +0000559.. option:: -segprot <arg1> <arg2> <arg3>
560
Richard Smith081ad4d2017-01-24 19:39:46 +0000561.. option:: -segs\_read\_<arg>
562
Richard Smithb2c82a62017-01-27 01:54:42 +0000563.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000564.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000565.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000566
Richard Smithb2c82a62017-01-27 01:54:42 +0000567.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000568.. option:: -segs\_read\_write\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000569.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000570
Richard Smith081ad4d2017-01-24 19:39:46 +0000571.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
572
573Serialize compiler diagnostics to a file
574
Richard Smith081ad4d2017-01-24 19:39:46 +0000575.. option:: -shared, --shared
576
Richard Smith081ad4d2017-01-24 19:39:46 +0000577.. option:: -shared-libgcc
578
Craig Topper16418662017-11-20 18:07:43 +0000579.. option:: -shared-libsan, -shared-libasan
580
Vedant Kumar368540f2018-08-23 17:55:03 +0000581Dynamically link the sanitizer runtime
582
Richard Smith081ad4d2017-01-24 19:39:46 +0000583.. option:: -single\_module
584
Richard Smith081ad4d2017-01-24 19:39:46 +0000585.. option:: -specs=<arg>, --specs=<arg>
586
Richard Smith081ad4d2017-01-24 19:39:46 +0000587.. option:: -static, --static
588
Richard Smith081ad4d2017-01-24 19:39:46 +0000589.. option:: -static-libgcc
590
Craig Topper16418662017-11-20 18:07:43 +0000591.. option:: -static-libsan
592
Vedant Kumar368540f2018-08-23 17:55:03 +0000593Statically link the sanitizer runtime
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -static-libstdc++
596
Richard Smith081ad4d2017-01-24 19:39:46 +0000597.. option:: -std-default=<arg>
598
Richard Smith081ad4d2017-01-24 19:39:46 +0000599.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
600
601C++ standard library to use
602
Richard Smith081ad4d2017-01-24 19:39:46 +0000603.. option:: -sub\_library<arg>
604
Richard Smithb2c82a62017-01-27 01:54:42 +0000605.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000606.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000607.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000608
Richard Smith081ad4d2017-01-24 19:39:46 +0000609.. option:: --sysroot=<arg>, --sysroot <arg>
610
Richard Smith081ad4d2017-01-24 19:39:46 +0000611.. option:: --target-help
612
Richard Smith081ad4d2017-01-24 19:39:46 +0000613.. option:: --target=<arg>, -target <arg>
614
615Generate code for the given target
616
Ziang Wanaf857b92019-06-14 21:42:21 +0000617.. option:: --print-supported-cpus
618
619Print supported cpu models for the given target
620
Richard Smith081ad4d2017-01-24 19:39:46 +0000621.. option:: -time
622
623Time individual commands
624
Richard Smith081ad4d2017-01-24 19:39:46 +0000625.. option:: -traditional, --traditional
626
Richard Smith081ad4d2017-01-24 19:39:46 +0000627.. option:: -traditional-cpp, --traditional-cpp
628
629Enable some traditional CPP emulation
630
Richard Smith081ad4d2017-01-24 19:39:46 +0000631.. option:: -twolevel\_namespace
632
Richard Smithb2c82a62017-01-27 01:54:42 +0000633.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000634.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000635.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000636
Richard Smith081ad4d2017-01-24 19:39:46 +0000637.. option:: -umbrella <arg>
638
Richard Smith081ad4d2017-01-24 19:39:46 +0000639.. option:: -unexported\_symbols\_list <arg>
640
Richard Smith081ad4d2017-01-24 19:39:46 +0000641.. option:: -v, --verbose
642
643Show commands to run and use verbose output
644
Richard Smith081ad4d2017-01-24 19:39:46 +0000645.. option:: --verify-debug-info
646
647Verify the binary representation of debug output
648
Richard Smith081ad4d2017-01-24 19:39:46 +0000649.. option:: --version
650
Craig Topper16418662017-11-20 18:07:43 +0000651Print version information
652
Richard Smith081ad4d2017-01-24 19:39:46 +0000653.. option:: -w, --no-warnings
654
655Suppress all warnings
656
Richard Smith081ad4d2017-01-24 19:39:46 +0000657.. option:: -weak-l<arg>
658
Richard Smith081ad4d2017-01-24 19:39:46 +0000659.. option:: -weak\_framework <arg>
660
Richard Smithb2c82a62017-01-27 01:54:42 +0000661.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000662.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000663.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000664
Richard Smithb2c82a62017-01-27 01:54:42 +0000665.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000666.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000667.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000668
Richard Smith081ad4d2017-01-24 19:39:46 +0000669.. option:: -whatsloaded
670
Richard Smith081ad4d2017-01-24 19:39:46 +0000671.. option:: -whyload
672
Richard Smith081ad4d2017-01-24 19:39:46 +0000673.. option:: -working-directory<arg>, -working-directory=<arg>
674
675Resolve file paths relative to the specified directory
676
Richard Smith081ad4d2017-01-24 19:39:46 +0000677.. option:: -x<language>, --language <arg>, --language=<arg>
678
679Treat subsequent input files as having type <language>
680
Richard Smith081ad4d2017-01-24 19:39:46 +0000681.. option:: -y<arg>
682
683Actions
684=======
685The action to perform on the input.
686
Richard Smith081ad4d2017-01-24 19:39:46 +0000687.. option:: -E, --preprocess
688
689Only run the preprocessor
690
Richard Smith081ad4d2017-01-24 19:39:46 +0000691.. option:: -S, --assemble
692
693Only run preprocess and compilation steps
694
Richard Smithc5b2e002017-01-27 02:08:37 +0000695.. option:: -c, --compile
696
697Only run preprocess, compile, and assemble steps
698
Richard Smith081ad4d2017-01-24 19:39:46 +0000699.. option:: -emit-llvm
700
701Use the LLVM representation for assembler and object files
702
Richard Smith081ad4d2017-01-24 19:39:46 +0000703.. option:: -fsyntax-only
704
Richard Smith081ad4d2017-01-24 19:39:46 +0000705.. option:: -module-file-info
706
707Provide information about a particular module file
708
Richard Smith081ad4d2017-01-24 19:39:46 +0000709.. option:: --precompile
710
711Only precompile the input
712
Richard Smith081ad4d2017-01-24 19:39:46 +0000713.. option:: -rewrite-objc
714
715Rewrite Objective-C source to C++
716
Richard Smith081ad4d2017-01-24 19:39:46 +0000717.. option:: -verify-pch
718
719Load and verify that a pre-compiled header file is not stale
720
721Compilation flags
722=================
723
724Flags controlling the behavior of Clang during compilation. These flags have
725no effect during actions that do not perform compilation.
726
Richard Smithc5b2e002017-01-27 02:08:37 +0000727.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000728
Richard Smithc5b2e002017-01-27 02:08:37 +0000729Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000730
Richard Smith081ad4d2017-01-24 19:39:46 +0000731.. option:: -Xclang <arg>
732
733Pass <arg> to the clang compiler
734
Boris Kolpackovb150d242017-08-30 09:15:53 +0000735.. option:: -fclang-abi-compat=<version>
736
737Attempt to match the ABI of Clang <version>
738
Richard Smith081ad4d2017-01-24 19:39:46 +0000739.. option:: -fcomment-block-commands=<arg>,<arg2>...
740
741Treat each comma separated argument in <arg> as a documentation comment block command
742
Vedant Kumar368540f2018-08-23 17:55:03 +0000743.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
744
745Require member pointer base types to be complete if they would be significant under the Microsoft ABI
746
747.. option:: -fcrash-diagnostics-dir=<arg>
748
Richard Smith081ad4d2017-01-24 19:39:46 +0000749.. option:: -fdeclspec, -fno-declspec
750
751Allow \_\_declspec as a keyword
752
Richard Smith081ad4d2017-01-24 19:39:46 +0000753.. option:: -fdepfile-entry=<arg>
754
Richard Smith081ad4d2017-01-24 19:39:46 +0000755.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
756
Richard Smith081ad4d2017-01-24 19:39:46 +0000757.. option:: -fdiagnostics-format=<arg>
758
Richard Smith081ad4d2017-01-24 19:39:46 +0000759.. option:: -fdiagnostics-parseable-fixits
760
761Print fix-its in machine parseable form
762
Richard Smith081ad4d2017-01-24 19:39:46 +0000763.. option:: -fdiagnostics-print-source-range-info
764
765Print source range spans in numeric form
766
Richard Smith081ad4d2017-01-24 19:39:46 +0000767.. option:: -fdiagnostics-show-category=<arg>
768
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000769.. option:: -fdiscard-value-names, -fno-discard-value-names
770
771Discard value names in LLVM IR
772
773.. option:: -fexperimental-isel, -fno-experimental-isel
774
775Enables the experimental global instruction selector
776
Richard Smith081ad4d2017-01-24 19:39:46 +0000777.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
778
779Enables an experimental new pass manager in LLVM.
780
Craig Topper16418662017-11-20 18:07:43 +0000781.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
782
Vedant Kumar368540f2018-08-23 17:55:03 +0000783Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Craig Topper16418662017-11-20 18:07:43 +0000784
Richard Smith081ad4d2017-01-24 19:39:46 +0000785.. option:: -finline-functions, -fno-inline-functions
786
787Inline suitable functions
788
Richard Smith081ad4d2017-01-24 19:39:46 +0000789.. option:: -finline-hint-functions
790
791Inline functions which are (explicitly or implicitly) marked inline
792
Richard Smith081ad4d2017-01-24 19:39:46 +0000793.. option:: -fno-crash-diagnostics
794
Richard Smith78e23fd2017-04-13 22:39:49 +0000795Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
796
Richard Smith081ad4d2017-01-24 19:39:46 +0000797.. option:: -fno-sanitize-blacklist
798
799Don't use blacklist file for sanitizers
800
Richard Smith081ad4d2017-01-24 19:39:46 +0000801.. option:: -fparse-all-comments
802
Scott Linderde6beb02018-12-14 15:38:15 +0000803.. option:: -frecord-command-line, -frecord-gcc-switches, -fno-record-command-line, -fno-record-gcc-switches
804
805Generate a section named ".GCC.command.line" containing the clang driver
806command-line. After linking, the section may contain multiple command lines,
807which will be individually terminated by null bytes. Separate arguments within
808a command line are combined with spaces; spaces and backslashes within an
809argument are escaped with backslashes. This format differs from the format of
810the equivalent section produced by GCC with the -frecord-gcc-switches flag.
811This option is currently only supported on ELF targets.
812
Richard Smith081ad4d2017-01-24 19:39:46 +0000813.. option:: -fsanitize-address-field-padding=<arg>
814
815Level of field padding for AddressSanitizer
816
Craig Topperd23254a2017-07-20 17:52:48 +0000817.. option:: -fsanitize-address-globals-dead-stripping
818
819Enable linker dead stripping of globals in AddressSanitizer
820
Vitaly Buka8076c572018-12-05 01:44:31 +0000821.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
822
823Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
824
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000825.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000826
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000827Enable "poisoning" array cookies when allocating arrays with a custom operator new\[\] in Address Sanitizer, preventing accesses to the cookies from user code. An array cookie is a small implementation-defined header added to certain array allocations to record metadata such as the length of the array. Accesses to array cookies from user code are technically allowed by the standard but are more likely to be the result of an out-of-bounds array access.
828
829An operator new\[\] is "custom" if it is not one of the allocation functions provided by the C++ standard library. Array cookies from non-custom allocation functions are always poisoned.
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000830
Richard Smith081ad4d2017-01-24 19:39:46 +0000831.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
832
833Enable use-after-scope detection in AddressSanitizer
834
Richard Smith081ad4d2017-01-24 19:39:46 +0000835.. option:: -fsanitize-blacklist=<arg>
836
837Path to blacklist file for sanitizers
838
Richard Smith081ad4d2017-01-24 19:39:46 +0000839.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
840
841Enable control flow integrity (CFI) checks for cross-DSO calls.
842
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000843.. option:: -fsanitize-cfi-icall-generalize-pointers
844
Craig Topper16418662017-11-20 18:07:43 +0000845Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000846
Richard Smith081ad4d2017-01-24 19:39:46 +0000847.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
848
849Specify the type of coverage instrumentation for Sanitizers
850
Richard Smith081ad4d2017-01-24 19:39:46 +0000851.. option:: -fsanitize-link-c++-runtime
852
Richard Smith081ad4d2017-01-24 19:39:46 +0000853.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
854
855Enable origins tracking in MemorySanitizer
856
Richard Smithb2c82a62017-01-27 01:54:42 +0000857.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000858.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000859.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000860
861Enable origins tracking in MemorySanitizer
862
Craig Topper16418662017-11-20 18:07:43 +0000863.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000864
865Enable use-after-destroy detection in MemorySanitizer
866
Boris Kolpackovb150d242017-08-30 09:15:53 +0000867.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
868
Richard Smith081ad4d2017-01-24 19:39:46 +0000869.. option:: -fsanitize-recover, -fno-sanitize-recover
870
Richard Smithb2c82a62017-01-27 01:54:42 +0000871.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000872.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +0000873.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000874
875Enable recovery for specified sanitizers
876
Richard Smith081ad4d2017-01-24 19:39:46 +0000877.. option:: -fsanitize-stats, -fno-sanitize-stats
878
879Enable sanitizer statistics gathering.
880
Richard Smith081ad4d2017-01-24 19:39:46 +0000881.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
882
883Enable atomic operations instrumentation in ThreadSanitizer (default)
884
Richard Smith081ad4d2017-01-24 19:39:46 +0000885.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
886
887Enable function entry/exit instrumentation in ThreadSanitizer (default)
888
Richard Smith081ad4d2017-01-24 19:39:46 +0000889.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
890
891Enable memory access instrumentation in ThreadSanitizer (default)
892
Richard Smith081ad4d2017-01-24 19:39:46 +0000893.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
894
895Enable trapping for specified sanitizers
896
Richard Smith081ad4d2017-01-24 19:39:46 +0000897.. option:: -fsanitize-undefined-strip-path-components=<number>
898
899Strip (or keep only, if negative) a given number of path components when emitting check metadata.
900
Richard Smith081ad4d2017-01-24 19:39:46 +0000901.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
902
Richard Smith081ad4d2017-01-24 19:39:46 +0000903.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
904
905Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
906
Vedant Kumar368540f2018-08-23 17:55:03 +0000907.. option:: -moutline, -mno-outline
908
909Enable function outlining (AArch64 only)
910
Richard Smith081ad4d2017-01-24 19:39:46 +0000911.. option:: --param <arg>, --param=<arg>
912
Richard Smith081ad4d2017-01-24 19:39:46 +0000913.. option:: -std=<arg>, --std=<arg>, --std <arg>
914
915Language standard to compile for
916
Richard Smithc5b2e002017-01-27 02:08:37 +0000917Preprocessor flags
918~~~~~~~~~~~~~~~~~~
919
920Flags controlling the behavior of the Clang preprocessor.
921
922.. option:: -C, --comments
923
924Include comments in preprocessed output
925
926.. option:: -CC, --comments-in-macros
927
928Include comments from within macros in preprocessed output
929
930.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
931
932Define <macro> to <value> (or 1 if <value> omitted)
933
934.. option:: -H, --trace-includes
935
936Show header includes and nesting depth
937
938.. option:: -P, --no-line-commands
939
940Disable linemarker output in -E mode
941
942.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
943
944Undefine macro <macro>
945
946.. option:: -Wp,<arg>,<arg2>...
947
948Pass the comma separated arguments in <arg> to the preprocessor
949
950.. option:: -Xpreprocessor <arg>
951
952Pass <arg> to the preprocessor
953
Richard Smith081ad4d2017-01-24 19:39:46 +0000954Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +0000955-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +0000956
957Flags controlling how ``#include``\s are resolved to files.
958
Richard Smithc5b2e002017-01-27 02:08:37 +0000959.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000960
961Add directory to include search path
962
Richard Smith081ad4d2017-01-24 19:39:46 +0000963.. option:: -I-, --include-barrier
964
Richard Smithc5b2e002017-01-27 02:08:37 +0000965Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
966
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000967.. option:: --cuda-path-ignore-env
968
969Ignore environment variables to detect CUDA installation
970
Richard Smith081ad4d2017-01-24 19:39:46 +0000971.. option:: --cuda-path=<arg>
972
973CUDA installation path
974
Richard Smith081ad4d2017-01-24 19:39:46 +0000975.. option:: -cxx-isystem<directory>
976
977Add directory to the C++ SYSTEM include search path
978
Richard Smith081ad4d2017-01-24 19:39:46 +0000979.. option:: -fbuild-session-file=<file>
980
981Use the last modification time of <file> as the build session timestamp
982
Richard Smith081ad4d2017-01-24 19:39:46 +0000983.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
984
985Time when the current build session started
986
Boris Kolpackovb150d242017-08-30 09:15:53 +0000987.. option:: -fmodule-file=\[<name>=\]<file>
988
989Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
990
Richard Smith081ad4d2017-01-24 19:39:46 +0000991.. option:: -fmodules-cache-path=<directory>
992
993Specify the module cache path
994
Richard Smith081ad4d2017-01-24 19:39:46 +0000995.. option:: -fmodules-disable-diagnostic-validation
996
997Disable validation of the diagnostic options when loading the module
998
Richard Smith081ad4d2017-01-24 19:39:46 +0000999.. option:: -fmodules-prune-after=<seconds>
1000
1001Specify the interval (in seconds) after which a module file will be considered unused
1002
Richard Smith081ad4d2017-01-24 19:39:46 +00001003.. option:: -fmodules-prune-interval=<seconds>
1004
1005Specify the interval (in seconds) between attempts to prune the module cache
1006
Richard Smith081ad4d2017-01-24 19:39:46 +00001007.. option:: -fmodules-user-build-path <directory>
1008
1009Specify the module user build path
1010
Richard Smith081ad4d2017-01-24 19:39:46 +00001011.. option:: -fmodules-validate-once-per-build-session
1012
1013Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1014
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001015.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
Richard Smith081ad4d2017-01-24 19:39:46 +00001016
1017Validate the system headers that a module depends on when loading the module
1018
Richard Smith081ad4d2017-01-24 19:39:46 +00001019.. option:: -fprebuilt-module-path=<directory>
1020
1021Specify the prebuilt module path
1022
Richard Smith081ad4d2017-01-24 19:39:46 +00001023.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1024
1025Add directory to AFTER include search path
1026
Richard Smith081ad4d2017-01-24 19:39:46 +00001027.. option:: -iframework<arg>
1028
1029Add directory to SYSTEM framework search path
1030
Richard Smith78e23fd2017-04-13 22:39:49 +00001031.. option:: -iframeworkwithsysroot<directory>
1032
1033Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1034
Richard Smith081ad4d2017-01-24 19:39:46 +00001035.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1036
1037Include macros from file before parsing
1038
Richard Smith081ad4d2017-01-24 19:39:46 +00001039.. option:: -include<file>, --include<file>, --include=<arg>
1040
1041Include file before parsing
1042
Richard Smith081ad4d2017-01-24 19:39:46 +00001043.. option:: -include-pch <file>
1044
1045Include precompiled header file
1046
Richard Smith081ad4d2017-01-24 19:39:46 +00001047.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1048
1049Set the -iwithprefix/-iwithprefixbefore prefix
1050
Richard Smith081ad4d2017-01-24 19:39:46 +00001051.. option:: -iquote<directory>
1052
1053Add directory to QUOTE include search path
1054
Richard Smith081ad4d2017-01-24 19:39:46 +00001055.. option:: -isysroot<dir>
1056
1057Set the system root directory (usually /)
1058
Richard Smith081ad4d2017-01-24 19:39:46 +00001059.. option:: -isystem<directory>
1060
1061Add directory to SYSTEM include search path
1062
Richard Smith081ad4d2017-01-24 19:39:46 +00001063.. option:: -isystem-after<directory>
1064
1065Add directory to end of the SYSTEM include search path
1066
Richard Smith081ad4d2017-01-24 19:39:46 +00001067.. option:: -ivfsoverlay<arg>
1068
1069Overlay the virtual filesystem described by file over the real file system
1070
Richard Smith081ad4d2017-01-24 19:39:46 +00001071.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1072
1073Set directory to SYSTEM include search path with prefix
1074
Richard Smith081ad4d2017-01-24 19:39:46 +00001075.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1076
1077Set directory to include search path with prefix
1078
Richard Smith081ad4d2017-01-24 19:39:46 +00001079.. option:: -iwithsysroot<directory>
1080
1081Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1082
Richard Smith081ad4d2017-01-24 19:39:46 +00001083.. option:: --ptxas-path=<arg>
1084
1085Path to ptxas (used for compiling CUDA code)
1086
Richard Smith081ad4d2017-01-24 19:39:46 +00001087.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1088
1089Treat all #include paths starting with <prefix> as including a system header.
1090
1091Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +00001092--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001093
1094Flags controlling generation of a dependency file for ``make``-like build
1095systems.
1096
Richard Smith081ad4d2017-01-24 19:39:46 +00001097.. option:: -M, --dependencies
1098
1099Like -MD, but also implies -E and writes to stdout by default
1100
Richard Smith081ad4d2017-01-24 19:39:46 +00001101.. option:: -MD, --write-dependencies
1102
1103Write a depfile containing user and system headers
1104
Richard Smith081ad4d2017-01-24 19:39:46 +00001105.. option:: -MF<file>
1106
1107Write depfile output from -MMD, -MD, -MM, or -M to <file>
1108
Richard Smith081ad4d2017-01-24 19:39:46 +00001109.. option:: -MG, --print-missing-file-dependencies
1110
1111Add missing headers to depfile
1112
Richard Smith081ad4d2017-01-24 19:39:46 +00001113.. option:: -MJ<arg>
1114
1115Write a compilation database entry per input
1116
Richard Smith081ad4d2017-01-24 19:39:46 +00001117.. option:: -MM, --user-dependencies
1118
1119Like -MMD, but also implies -E and writes to stdout by default
1120
Richard Smith081ad4d2017-01-24 19:39:46 +00001121.. option:: -MMD, --write-user-dependencies
1122
1123Write a depfile containing user headers
1124
Richard Smith081ad4d2017-01-24 19:39:46 +00001125.. option:: -MP
1126
1127Create phony target for each dependency (other than main file)
1128
Richard Smith081ad4d2017-01-24 19:39:46 +00001129.. option:: -MQ<arg>
1130
1131Specify name of main file output to quote in depfile
1132
Richard Smith081ad4d2017-01-24 19:39:46 +00001133.. option:: -MT<arg>
1134
1135Specify name of main file output in depfile
1136
Richard Smith081ad4d2017-01-24 19:39:46 +00001137.. option:: -MV
1138
1139Use NMake/Jom format for the depfile
1140
1141Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001142--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001143
1144Flags allowing the state of the preprocessor to be dumped in various ways.
1145
Richard Smith081ad4d2017-01-24 19:39:46 +00001146.. option:: -d
1147
Richard Smithb2c82a62017-01-27 01:54:42 +00001148.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001149.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001150.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001151
Richard Smith081ad4d2017-01-24 19:39:46 +00001152.. option:: -dD
1153
1154Print macro definitions in -E mode in addition to normal output
1155
Richard Smith081ad4d2017-01-24 19:39:46 +00001156.. option:: -dI
1157
1158Print include directives in -E mode in addition to normal output
1159
Richard Smith081ad4d2017-01-24 19:39:46 +00001160.. option:: -dM
1161
1162Print macro definitions in -E mode instead of normal output
1163
1164Diagnostic flags
1165~~~~~~~~~~~~~~~~
1166
1167Flags controlling which warnings, errors, and remarks Clang will generate.
1168See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1169
Richard Smith081ad4d2017-01-24 19:39:46 +00001170.. option:: -R<remark>
1171
1172Enable the specified remark
1173
Richard Smith081ad4d2017-01-24 19:39:46 +00001174.. option:: -Rpass-analysis=<arg>
1175
1176Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1177
Richard Smith081ad4d2017-01-24 19:39:46 +00001178.. option:: -Rpass-missed=<arg>
1179
1180Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1181
Richard Smith081ad4d2017-01-24 19:39:46 +00001182.. option:: -Rpass=<arg>
1183
1184Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1185
Richard Smith081ad4d2017-01-24 19:39:46 +00001186.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1187
1188Enable the specified warning
1189
Richard Smith081ad4d2017-01-24 19:39:46 +00001190.. option:: -Wdeprecated, -Wno-deprecated
1191
Richard Smithc5b2e002017-01-27 02:08:37 +00001192Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001193
Richard Smith081ad4d2017-01-24 19:39:46 +00001194.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1195
Richard Smith081ad4d2017-01-24 19:39:46 +00001196Target-independent compilation options
1197~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001198.. option:: -Wframe-larger-than=<arg>
1199
Richard Smith081ad4d2017-01-24 19:39:46 +00001200.. option:: -fPIC, -fno-PIC
1201
Richard Smith081ad4d2017-01-24 19:39:46 +00001202.. option:: -fPIE, -fno-PIE
1203
Richard Smith081ad4d2017-01-24 19:39:46 +00001204.. option:: -faccess-control, -fno-access-control
1205
Vedant Kumar368540f2018-08-23 17:55:03 +00001206.. option:: -faddrsig, -fno-addrsig
1207
1208Emit an address-significance table
1209
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001210.. option:: -falign-functions, -fno-align-functions
1211
1212.. program:: clang1
1213.. option:: -falign-functions=<arg>
1214.. program:: clang
1215
Richard Smithb2c82a62017-01-27 01:54:42 +00001216.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001217.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001218.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001219
1220Enable C++17 aligned allocation functions
1221
Craig Topperd23254a2017-07-20 17:52:48 +00001222.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1223
1224Treat editor placeholders as valid source code
1225
Richard Smith081ad4d2017-01-24 19:39:46 +00001226.. option:: -fallow-unsupported
1227
Richard Smith78e23fd2017-04-13 22:39:49 +00001228.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001229
Richard Smith081ad4d2017-01-24 19:39:46 +00001230.. option:: -fansi-escape-codes
1231
1232Use ANSI escape codes for diagnostics
1233
Richard Smith081ad4d2017-01-24 19:39:46 +00001234.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1235
1236Use Apple's kernel extensions ABI
1237
Richard Smith081ad4d2017-01-24 19:39:46 +00001238.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1239
1240Enable Apple gcc-compatible #pragma pack handling
1241
Richard Smith081ad4d2017-01-24 19:39:46 +00001242.. option:: -fapplication-extension, -fno-application-extension
1243
1244Restrict code to those available for App Extensions
1245
Richard Smith081ad4d2017-01-24 19:39:46 +00001246.. option:: -fasm, -fno-asm
1247
Richard Smith081ad4d2017-01-24 19:39:46 +00001248.. option:: -fasm-blocks, -fno-asm-blocks
1249
Richard Smith081ad4d2017-01-24 19:39:46 +00001250.. option:: -fassociative-math, -fno-associative-math
1251
Richard Smith081ad4d2017-01-24 19:39:46 +00001252.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1253
Richard Smith081ad4d2017-01-24 19:39:46 +00001254.. option:: -fast
1255
Richard Smith081ad4d2017-01-24 19:39:46 +00001256.. option:: -fastcp
1257
Richard Smith081ad4d2017-01-24 19:39:46 +00001258.. option:: -fastf
1259
Richard Smith081ad4d2017-01-24 19:39:46 +00001260.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262.. option:: -fautolink, -fno-autolink
1263
Richard Smith081ad4d2017-01-24 19:39:46 +00001264.. option:: -fblocks, -fno-blocks
1265
1266Enable the 'blocks' language feature
1267
Richard Smith081ad4d2017-01-24 19:39:46 +00001268.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1269
Richard Smith081ad4d2017-01-24 19:39:46 +00001270.. option:: -fborland-extensions, -fno-borland-extensions
1271
1272Accept non-standard constructs supported by the Borland compiler
1273
Richard Smith081ad4d2017-01-24 19:39:46 +00001274.. option:: -fbracket-depth=<arg>
1275
Richard Smith081ad4d2017-01-24 19:39:46 +00001276.. option:: -fbuiltin, -fno-builtin
1277
Richard Smith081ad4d2017-01-24 19:39:46 +00001278.. option:: -fbuiltin-module-map
1279
1280Load the clang builtins module map file.
1281
Vedant Kumar368540f2018-08-23 17:55:03 +00001282.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1283
1284Enable C++ static destructor registration (the default)
1285
Richard Smith081ad4d2017-01-24 19:39:46 +00001286.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1287
Craig Topper596527b2018-01-23 18:40:15 +00001288.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1289
1290Instrument control-flow architecture protection. Options: return, branch, full, none.
1291
Vedant Kumar368540f2018-08-23 17:55:03 +00001292.. option:: -fchar8\_t, -fno-char8\_t
1293
1294Enable C++ builtin type char8\_t
1295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1297
Richard Smith081ad4d2017-01-24 19:39:46 +00001298.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1299
1300Use colors in diagnostics
1301
Richard Smith081ad4d2017-01-24 19:39:46 +00001302.. option:: -fcommon, -fno-common
1303
Richard Smith081ad4d2017-01-24 19:39:46 +00001304.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1305
Richard Smith081ad4d2017-01-24 19:39:46 +00001306.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1307
Richard Smith081ad4d2017-01-24 19:39:46 +00001308.. option:: -fconstant-string-class=<arg>
1309
Richard Smith081ad4d2017-01-24 19:39:46 +00001310.. option:: -fconstexpr-backtrace-limit=<arg>
1311
Richard Smith081ad4d2017-01-24 19:39:46 +00001312.. option:: -fconstexpr-depth=<arg>
1313
Richard Smith081ad4d2017-01-24 19:39:46 +00001314.. option:: -fconstexpr-steps=<arg>
1315
Richard Smith081ad4d2017-01-24 19:39:46 +00001316.. option:: -fcoroutines-ts, -fno-coroutines-ts
1317
1318Enable support for the C++ Coroutines TS
1319
Richard Smith081ad4d2017-01-24 19:39:46 +00001320.. option:: -fcoverage-mapping, -fno-coverage-mapping
1321
1322Generate coverage mapping to enable code coverage analysis
1323
Richard Smith081ad4d2017-01-24 19:39:46 +00001324.. option:: -fcreate-profile
1325
Richard Smith081ad4d2017-01-24 19:39:46 +00001326.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1327
1328Enable C++ exceptions
1329
Richard Smith081ad4d2017-01-24 19:39:46 +00001330.. option:: -fcxx-modules, -fno-cxx-modules
1331
Richard Smith081ad4d2017-01-24 19:39:46 +00001332.. option:: -fdata-sections, -fno-data-sections
1333
1334Place each data in its own section (ELF Only)
1335
Richard Smith081ad4d2017-01-24 19:39:46 +00001336.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1337
1338Emit extra debug info to make sample profile more accurate.
1339
Richard Smith78e23fd2017-04-13 22:39:49 +00001340.. option:: -fdebug-macro, -fno-debug-macro
1341
1342Emit macro debug information
1343
Richard Smith081ad4d2017-01-24 19:39:46 +00001344.. option:: -fdebug-pass-arguments
1345
Richard Smith081ad4d2017-01-24 19:39:46 +00001346.. option:: -fdebug-pass-structure
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fdebug-prefix-map=<arg>
1349
1350remap file source paths in debug info
1351
Richard Smith081ad4d2017-01-24 19:39:46 +00001352.. option:: -fdebug-types-section, -fno-debug-types-section
1353
1354Place debug types in their own section (ELF Only)
1355
Richard Smith081ad4d2017-01-24 19:39:46 +00001356.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1357
1358Parse templated function definitions at the end of the translation unit
1359
Vedant Kumar368540f2018-08-23 17:55:03 +00001360.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1361
1362Treat usage of null pointers as undefined behavior.
1363
Richard Smith081ad4d2017-01-24 19:39:46 +00001364.. option:: -fdenormal-fp-math=<arg>
1365
Richard Smith081ad4d2017-01-24 19:39:46 +00001366.. option:: -fdiagnostics-absolute-paths
1367
1368Print absolute paths in diagnostics
1369
Richard Smith081ad4d2017-01-24 19:39:46 +00001370.. option:: -fdiagnostics-color, -fno-diagnostics-color
1371
Richard Smithb2c82a62017-01-27 01:54:42 +00001372.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001373.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001374.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001375
Craig Topperd23254a2017-07-20 17:52:48 +00001376.. option:: -fdiagnostics-hotness-threshold=<number>
1377
1378Prevent optimization remarks from being output if they do not have at least this profile count
1379
Richard Smith081ad4d2017-01-24 19:39:46 +00001380.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1381
1382Enable profile hotness information in diagnostic line
1383
Richard Smith081ad4d2017-01-24 19:39:46 +00001384.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1385
1386Display include stacks for diagnostic notes
1387
Richard Smith081ad4d2017-01-24 19:39:46 +00001388.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1389
1390Print option name with mappable diagnostics
1391
Richard Smith081ad4d2017-01-24 19:39:46 +00001392.. option:: -fdiagnostics-show-template-tree
1393
1394Print a template comparison tree for differing templates
1395
Vedant Kumar368540f2018-08-23 17:55:03 +00001396.. option:: -fdigraphs, -fno-digraphs
1397
1398Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1399
Richard Smith081ad4d2017-01-24 19:39:46 +00001400.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1401
1402Allow '$' in identifiers
1403
Craig Topper16418662017-11-20 18:07:43 +00001404.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1405
1406Enable '\[\[\]\]' attributes in all C and C++ language modes
1407
Richard Smith081ad4d2017-01-24 19:39:46 +00001408.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1409
Craig Topper188252d2017-12-11 21:09:16 +00001410.. option:: -fdwarf-exceptions
1411
1412Use DWARF style exceptions
1413
Richard Smith081ad4d2017-01-24 19:39:46 +00001414.. option:: -felide-constructors, -fno-elide-constructors
1415
Richard Smith081ad4d2017-01-24 19:39:46 +00001416.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1417
Richard Smith081ad4d2017-01-24 19:39:46 +00001418.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1419
1420Embed LLVM bitcode (option: off, all, bitcode, marker)
1421
Richard Smith081ad4d2017-01-24 19:39:46 +00001422.. option:: -femit-all-decls
1423
1424Emit all declarations, even if unused
1425
Richard Smith081ad4d2017-01-24 19:39:46 +00001426.. option:: -femulated-tls, -fno-emulated-tls
1427
1428Use emutls functions to access thread\_local variables
1429
Richard Smith081ad4d2017-01-24 19:39:46 +00001430.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1431
Richard Smith081ad4d2017-01-24 19:39:46 +00001432.. option:: -ferror-limit=<arg>
1433
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001434.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1435
Richard Smith081ad4d2017-01-24 19:39:46 +00001436.. option:: -fexceptions, -fno-exceptions
1437
1438Enable support for exception handling
1439
Richard Smith081ad4d2017-01-24 19:39:46 +00001440.. option:: -fexec-charset=<arg>
1441
Richard Smith081ad4d2017-01-24 19:39:46 +00001442.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1443
Richard Smith081ad4d2017-01-24 19:39:46 +00001444.. option:: -ffast-math, -fno-fast-math
1445
1446Allow aggressive, lossy floating-point optimizations
1447
Richard Smith081ad4d2017-01-24 19:39:46 +00001448.. option:: -ffinite-math-only, -fno-finite-math-only
1449
Vedant Kumar368540f2018-08-23 17:55:03 +00001450.. option:: -ffixed-point, -fno-fixed-point
1451
1452Enable fixed point types
1453
Richard Smith081ad4d2017-01-24 19:39:46 +00001454.. option:: -ffor-scope, -fno-for-scope
1455
Vedant Kumar368540f2018-08-23 17:55:03 +00001456.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1457
1458Emits more virtual tables to improve devirtualization
1459
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001460.. option:: -fforce-enable-int128, -fno-force-enable-int128
1461
1462Enable support for int128\_t type
1463
Richard Smith081ad4d2017-01-24 19:39:46 +00001464.. option:: -ffp-contract=<arg>
1465
1466Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1467
Richard Smith081ad4d2017-01-24 19:39:46 +00001468.. option:: -ffreestanding
1469
1470Assert that the compilation takes place in a freestanding environment
1471
Richard Smith081ad4d2017-01-24 19:39:46 +00001472.. option:: -ffunction-sections, -fno-function-sections
1473
1474Place each function in its own section (ELF Only)
1475
Richard Smith081ad4d2017-01-24 19:39:46 +00001476.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1477
Richard Smith081ad4d2017-01-24 19:39:46 +00001478.. option:: -fgnu-keywords, -fno-gnu-keywords
1479
1480Allow GNU-extension keywords regardless of language standard
1481
Richard Smith081ad4d2017-01-24 19:39:46 +00001482.. option:: -fgnu-runtime
1483
1484Generate output compatible with the standard GNU Objective-C runtime
1485
Richard Smith081ad4d2017-01-24 19:39:46 +00001486.. option:: -fgnu89-inline, -fno-gnu89-inline
1487
1488Use the gnu89 inline semantics
1489
Richard Smith081ad4d2017-01-24 19:39:46 +00001490.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1491
Richard Smith081ad4d2017-01-24 19:39:46 +00001492.. option:: -fhonor-nans, -fno-honor-nans
1493
Richard Smith081ad4d2017-01-24 19:39:46 +00001494.. option:: -fhosted
1495
Richard Smith081ad4d2017-01-24 19:39:46 +00001496.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1497
1498Implicitly search the file system for module map files.
1499
Richard Smith081ad4d2017-01-24 19:39:46 +00001500.. option:: -fimplicit-modules, -fno-implicit-modules
1501
Richard Smith081ad4d2017-01-24 19:39:46 +00001502.. option:: -finput-charset=<arg>
1503
Craig Topper188252d2017-12-11 21:09:16 +00001504.. option:: -finstrument-function-entry-bare
1505
1506Instrument function entry only, after inlining, without arguments to the instrumentation call
1507
Richard Smith081ad4d2017-01-24 19:39:46 +00001508.. option:: -finstrument-functions
1509
1510Generate calls to instrument function entry and exit
1511
Craig Topper16418662017-11-20 18:07:43 +00001512.. option:: -finstrument-functions-after-inlining
1513
1514Like -finstrument-functions, but insert the calls after inlining
1515
Richard Smith081ad4d2017-01-24 19:39:46 +00001516.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1517
1518Enable the integrated assembler
1519
Richard Smith081ad4d2017-01-24 19:39:46 +00001520.. option:: -fjump-tables, -fno-jump-tables
1521
Vedant Kumar368540f2018-08-23 17:55:03 +00001522.. option:: -fkeep-static-consts
1523
1524Keep static const variables even if unused
1525
Richard Smith081ad4d2017-01-24 19:39:46 +00001526.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1527
Richard Smith081ad4d2017-01-24 19:39:46 +00001528.. option:: -flimited-precision=<arg>
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -flto, -fno-lto
1531
1532Enable LTO in 'full' mode
1533
Richard Smith081ad4d2017-01-24 19:39:46 +00001534.. option:: -flto-jobs=<arg>
1535
1536Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1537
Richard Smithb2c82a62017-01-27 01:54:42 +00001538.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001539.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001540.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001541
1542Set LTO mode to either 'full' or 'thin'
1543
Richard Smith081ad4d2017-01-24 19:39:46 +00001544.. option:: -fmacro-backtrace-limit=<arg>
1545
Richard Smith081ad4d2017-01-24 19:39:46 +00001546.. option:: -fmath-errno, -fno-math-errno
1547
1548Require math functions to indicate errors by setting errno
1549
Richard Smith081ad4d2017-01-24 19:39:46 +00001550.. option:: -fmax-type-align=<arg>
1551
1552Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1553
Richard Smith081ad4d2017-01-24 19:39:46 +00001554.. option:: -fmerge-all-constants, -fno-merge-all-constants
1555
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001556Allow merging of constants
1557
Richard Smith081ad4d2017-01-24 19:39:46 +00001558.. option:: -fmessage-length=<arg>
1559
Richard Smith081ad4d2017-01-24 19:39:46 +00001560.. option:: -fmodule-file-deps, -fno-module-file-deps
1561
Richard Smith081ad4d2017-01-24 19:39:46 +00001562.. option:: -fmodule-map-file=<file>
1563
1564Load this module map file
1565
Richard Smith081ad4d2017-01-24 19:39:46 +00001566.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1567
1568Specify the name of the module to build
1569
Richard Smith081ad4d2017-01-24 19:39:46 +00001570.. option:: -fmodules, -fno-modules
1571
1572Enable the 'modules' language feature
1573
Richard Smith081ad4d2017-01-24 19:39:46 +00001574.. option:: -fmodules-decluse, -fno-modules-decluse
1575
1576Require declaration of modules used within a module
1577
Richard Smith081ad4d2017-01-24 19:39:46 +00001578.. option:: -fmodules-ignore-macro=<arg>
1579
1580Ignore the definition of the given macro when building and loading modules
1581
Richard Smith081ad4d2017-01-24 19:39:46 +00001582.. option:: -fmodules-search-all, -fno-modules-search-all
1583
1584Search even non-imported modules to resolve references
1585
Richard Smith081ad4d2017-01-24 19:39:46 +00001586.. option:: -fmodules-strict-decluse
1587
1588Like -fmodules-decluse but requires all headers to be in modules
1589
Richard Smith081ad4d2017-01-24 19:39:46 +00001590.. option:: -fmodules-ts
1591
1592Enable support for the C++ Modules TS
1593
Richard Smith081ad4d2017-01-24 19:39:46 +00001594.. option:: -fms-compatibility, -fno-ms-compatibility
1595
1596Enable full Microsoft Visual C++ compatibility
1597
Richard Smith081ad4d2017-01-24 19:39:46 +00001598.. option:: -fms-compatibility-version=<arg>
1599
1600Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1601
Richard Smith081ad4d2017-01-24 19:39:46 +00001602.. option:: -fms-extensions, -fno-ms-extensions
1603
1604Accept some non-standard constructs supported by the Microsoft compiler
1605
Richard Smith081ad4d2017-01-24 19:39:46 +00001606.. option:: -fms-memptr-rep=<arg>
1607
Richard Smith081ad4d2017-01-24 19:39:46 +00001608.. option:: -fms-volatile<arg>
1609
Richard Smith081ad4d2017-01-24 19:39:46 +00001610.. option:: -fmsc-version=<arg>
1611
1612Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -fmudflap
1615
Richard Smith081ad4d2017-01-24 19:39:46 +00001616.. option:: -fmudflapth
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -fnested-functions
1619
Richard Smith081ad4d2017-01-24 19:39:46 +00001620.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1621
1622Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1623
Richard Smith081ad4d2017-01-24 19:39:46 +00001624.. option:: -fnext-runtime
1625
Richard Smith081ad4d2017-01-24 19:39:46 +00001626.. option:: -fno-builtin-<arg>
1627
1628Disable implicit builtin knowledge of a specific function
1629
Richard Smith081ad4d2017-01-24 19:39:46 +00001630.. option:: -fno-elide-type
1631
1632Do not elide types when printing diagnostics
1633
Richard Smith081ad4d2017-01-24 19:39:46 +00001634.. option:: -fno-max-type-align
1635
Richard Smith081ad4d2017-01-24 19:39:46 +00001636.. option:: -fno-operator-names
1637
1638Do not treat C++ operator name keywords as synonyms for operators
1639
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001640.. option:: -fno-rtti-data
1641
1642Control emission of RTTI data
1643
Richard Smith081ad4d2017-01-24 19:39:46 +00001644.. option:: -fno-strict-modules-decluse
1645
Richard Smith081ad4d2017-01-24 19:39:46 +00001646.. option:: -fno-working-directory
1647
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001648.. option:: -fnoxray-link-deps
1649
Richard Smith081ad4d2017-01-24 19:39:46 +00001650.. option:: -fobjc-abi-version=<arg>
1651
Richard Smith081ad4d2017-01-24 19:39:46 +00001652.. option:: -fobjc-arc, -fno-objc-arc
1653
1654Synthesize retain and release calls for Objective-C pointers
1655
Richard Smith081ad4d2017-01-24 19:39:46 +00001656.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1657
1658Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1659
Richard Smith081ad4d2017-01-24 19:39:46 +00001660.. option:: -fobjc-exceptions, -fno-objc-exceptions
1661
1662Enable Objective-C exceptions
1663
Richard Smith081ad4d2017-01-24 19:39:46 +00001664.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1665
Richard Smith081ad4d2017-01-24 19:39:46 +00001666.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1667
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -fobjc-link-runtime
1669
Richard Smith081ad4d2017-01-24 19:39:46 +00001670.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1671
Richard Smith081ad4d2017-01-24 19:39:46 +00001672.. option:: -fobjc-nonfragile-abi-version=<arg>
1673
Richard Smith081ad4d2017-01-24 19:39:46 +00001674.. option:: -fobjc-runtime=<arg>
1675
1676Specify the target Objective-C runtime kind and version
1677
Richard Smith081ad4d2017-01-24 19:39:46 +00001678.. option:: -fobjc-sender-dependent-dispatch
1679
Richard Smith081ad4d2017-01-24 19:39:46 +00001680.. option:: -fobjc-weak, -fno-objc-weak
1681
1682Enable ARC-style weak references in Objective-C
1683
Richard Smith081ad4d2017-01-24 19:39:46 +00001684.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1685
Richard Smith081ad4d2017-01-24 19:39:46 +00001686.. option:: -fopenmp, -fno-openmp
1687
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001688Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001689
Craig Topper287c8012018-01-03 18:29:12 +00001690.. option:: -fopenmp-simd, -fno-openmp-simd
1691
1692Emit OpenMP code only for SIMD-based constructs.
1693
Richard Smith081ad4d2017-01-24 19:39:46 +00001694.. option:: -fopenmp-version=<arg>
1695
Richard Smithb2c82a62017-01-27 01:54:42 +00001696.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001697.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001698.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001699
Richard Smith081ad4d2017-01-24 19:39:46 +00001700.. option:: -foperator-arrow-depth=<arg>
1701
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001702.. option:: -foptimization-record-file=<file>
Richard Smith081ad4d2017-01-24 19:39:46 +00001703
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001704Implies -fsave-optimization-record. On Darwin platforms, this
1705 cannot be used with multiple -arch <arch> options.
1706
1707.. option:: -foptimization-record-passes=<regex>
1708
1709Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)
Richard Smith081ad4d2017-01-24 19:39:46 +00001710
Richard Smith081ad4d2017-01-24 19:39:46 +00001711.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1712
Richard Smith081ad4d2017-01-24 19:39:46 +00001713.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1714
Richard Smith081ad4d2017-01-24 19:39:46 +00001715.. option:: -fpack-struct, -fno-pack-struct
1716
Richard Smithb2c82a62017-01-27 01:54:42 +00001717.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001718.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001719.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001720
1721Specify the default maximum struct packing alignment
1722
Richard Smith081ad4d2017-01-24 19:39:46 +00001723.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1724
1725Recognize and construct Pascal-style string literals
1726
Richard Smith081ad4d2017-01-24 19:39:46 +00001727.. option:: -fpcc-struct-return
1728
1729Override the default ABI to return all structs on the stack
1730
Richard Smith081ad4d2017-01-24 19:39:46 +00001731.. option:: -fpch-preprocess
1732
Richard Smith081ad4d2017-01-24 19:39:46 +00001733.. option:: -fpic, -fno-pic
1734
Richard Smith081ad4d2017-01-24 19:39:46 +00001735.. option:: -fpie, -fno-pie
1736
Craig Topper16418662017-11-20 18:07:43 +00001737.. option:: -fplt, -fno-plt
1738
1739Use the PLT to make function calls
1740
Richard Smith081ad4d2017-01-24 19:39:46 +00001741.. option:: -fplugin=<dsopath>
1742
1743Load the named plugin (dynamic shared object)
1744
Richard Smith081ad4d2017-01-24 19:39:46 +00001745.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1746
Richard Smith081ad4d2017-01-24 19:39:46 +00001747.. option:: -fprofile-arcs, -fno-profile-arcs
1748
Richard Smith081ad4d2017-01-24 19:39:46 +00001749.. option:: -fprofile-dir=<arg>
1750
Richard Smith081ad4d2017-01-24 19:39:46 +00001751.. option:: -fprofile-generate, -fno-profile-generate
1752
1753Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1754
Richard Smithb2c82a62017-01-27 01:54:42 +00001755.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001756.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001757.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001758
1759Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1760
Richard Smith081ad4d2017-01-24 19:39:46 +00001761.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1762
1763Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1764
Richard Smithb2c82a62017-01-27 01:54:42 +00001765.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001766.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001767.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001768
1769Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1770
Richard Smith081ad4d2017-01-24 19:39:46 +00001771.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1772
Richard Smithb2c82a62017-01-27 01:54:42 +00001773.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001774.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001775.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001776
1777Use instrumentation data for profile-guided optimization
1778
Boris Kolpackovb150d242017-08-30 09:15:53 +00001779.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1780
1781Specifies that the sample profile is accurate. If the sample
1782 profile is accurate, callsites without profile samples are marked
1783 as cold. Otherwise, treat callsites without profile samples as if
1784 we have no profile
1785
Richard Smith78e23fd2017-04-13 22:39:49 +00001786.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1787
1788.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001789.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001790.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001791
1792Enable sample-based profile guided optimizations
1793
Richard Smithb2c82a62017-01-27 01:54:42 +00001794.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001795.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001796.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001797
1798Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1799
Richard Smith081ad4d2017-01-24 19:39:46 +00001800.. option:: -freciprocal-math, -fno-reciprocal-math
1801
1802Allow division operations to be reassociated
1803
Richard Smith081ad4d2017-01-24 19:39:46 +00001804.. option:: -freg-struct-return
1805
1806Override the default ABI to return small structs in registers
1807
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001808.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1809
1810Use atexit or \_\_cxa\_atexit to register global destructors
1811
Richard Smith081ad4d2017-01-24 19:39:46 +00001812.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1813
1814Enable C++17 relaxed template template argument matching
1815
Richard Smith081ad4d2017-01-24 19:39:46 +00001816.. option:: -freroll-loops, -fno-reroll-loops
1817
1818Turn on loop reroller
1819
Richard Smith081ad4d2017-01-24 19:39:46 +00001820.. option:: -fretain-comments-from-system-headers
1821
Craig Topperd23254a2017-07-20 17:52:48 +00001822.. option:: -frewrite-imports, -fno-rewrite-imports
1823
Richard Smith081ad4d2017-01-24 19:39:46 +00001824.. option:: -frewrite-includes, -fno-rewrite-includes
1825
Richard Smith081ad4d2017-01-24 19:39:46 +00001826.. option:: -frewrite-map-file <arg>
1827
Richard Smithb2c82a62017-01-27 01:54:42 +00001828.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001829.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001830.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001831
Richard Smith081ad4d2017-01-24 19:39:46 +00001832.. option:: -fropi, -fno-ropi
1833
Richard Smith081ad4d2017-01-24 19:39:46 +00001834.. option:: -frtti, -fno-rtti
1835
Richard Smith081ad4d2017-01-24 19:39:46 +00001836.. option:: -frwpi, -fno-rwpi
1837
Richard Smith081ad4d2017-01-24 19:39:46 +00001838.. option:: -fsave-optimization-record, -fno-save-optimization-record
1839
1840Generate a YAML optimization record file
1841
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001842.. program:: clang1
1843.. option:: -fsave-optimization-record=<format>
1844.. program:: clang
1845
1846Generate an optimization record file in a specific format.
1847
Craig Topper188252d2017-12-11 21:09:16 +00001848.. option:: -fseh-exceptions
1849
1850Use SEH style exceptions
1851
Richard Smith081ad4d2017-01-24 19:39:46 +00001852.. option:: -fshort-enums, -fno-short-enums
1853
1854Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1855
Richard Smith081ad4d2017-01-24 19:39:46 +00001856.. option:: -fshort-wchar, -fno-short-wchar
1857
1858Force wchar\_t to be a short unsigned int
1859
Richard Smith081ad4d2017-01-24 19:39:46 +00001860.. option:: -fshow-column, -fno-show-column
1861
Richard Smith081ad4d2017-01-24 19:39:46 +00001862.. option:: -fshow-overloads=<arg>
1863
1864Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1865
Richard Smith081ad4d2017-01-24 19:39:46 +00001866.. option:: -fshow-source-location, -fno-show-source-location
1867
Richard Smith081ad4d2017-01-24 19:39:46 +00001868.. option:: -fsignaling-math, -fno-signaling-math
1869
Richard Smith081ad4d2017-01-24 19:39:46 +00001870.. option:: -fsigned-bitfields
1871
Richard Smith081ad4d2017-01-24 19:39:46 +00001872.. option:: -fsigned-char, -fno-signed-char, --signed-char
1873
Richard Smith081ad4d2017-01-24 19:39:46 +00001874.. option:: -fsigned-zeros, -fno-signed-zeros
1875
Richard Smith081ad4d2017-01-24 19:39:46 +00001876.. option:: -fsized-deallocation, -fno-sized-deallocation
1877
1878Enable C++14 sized global deallocation functions
1879
Richard Smith081ad4d2017-01-24 19:39:46 +00001880.. option:: -fsjlj-exceptions
1881
1882Use SjLj style exceptions
1883
Richard Smith081ad4d2017-01-24 19:39:46 +00001884.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1885
1886Enable the superword-level parallelism vectorization passes
1887
Richard Smith081ad4d2017-01-24 19:39:46 +00001888.. option:: -fspell-checking, -fno-spell-checking
1889
Richard Smith081ad4d2017-01-24 19:39:46 +00001890.. option:: -fspell-checking-limit=<arg>
1891
Richard Smith081ad4d2017-01-24 19:39:46 +00001892.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1893
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001894Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
Richard Smith081ad4d2017-01-24 19:39:46 +00001895
Richard Smith081ad4d2017-01-24 19:39:46 +00001896.. option:: -fsplit-stack
1897
Richard Smith081ad4d2017-01-24 19:39:46 +00001898.. option:: -fstack-protector, -fno-stack-protector
1899
1900Enable stack protectors for functions potentially vulnerable to stack smashing
1901
Richard Smith081ad4d2017-01-24 19:39:46 +00001902.. option:: -fstack-protector-all
1903
1904Force the usage of stack protectors for all functions
1905
Richard Smith081ad4d2017-01-24 19:39:46 +00001906.. option:: -fstack-protector-strong
1907
1908Use a strong heuristic to apply stack protectors to functions
1909
Craig Topper596527b2018-01-23 18:40:15 +00001910.. option:: -fstack-size-section, -fno-stack-size-section
1911
1912Emit section containing metadata on function stack sizes
1913
Richard Smith081ad4d2017-01-24 19:39:46 +00001914.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1915
1916Emit full debug info for all types used by the program
1917
Richard Smith081ad4d2017-01-24 19:39:46 +00001918.. option:: -fstrict-aliasing, -fno-strict-aliasing
1919
Richard Smith081ad4d2017-01-24 19:39:46 +00001920.. option:: -fstrict-enums, -fno-strict-enums
1921
1922Enable optimizations based on the strict definition of an enum's value range
1923
Vedant Kumar368540f2018-08-23 17:55:03 +00001924.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
1925
1926Assume that overflowing float-to-int casts are undefined (default)
1927
Richard Smith081ad4d2017-01-24 19:39:46 +00001928.. option:: -fstrict-overflow, -fno-strict-overflow
1929
Richard Smith081ad4d2017-01-24 19:39:46 +00001930.. option:: -fstrict-return, -fno-strict-return
1931
Richard Smith78e23fd2017-04-13 22:39:49 +00001932Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00001933
Richard Smith081ad4d2017-01-24 19:39:46 +00001934.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1935
1936Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1937
Richard Smith081ad4d2017-01-24 19:39:46 +00001938.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1939
Richard Smith081ad4d2017-01-24 19:39:46 +00001940.. option:: -ftabstop=<arg>
1941
Richard Smith081ad4d2017-01-24 19:39:46 +00001942.. option:: -ftemplate-backtrace-limit=<arg>
1943
Richard Smith081ad4d2017-01-24 19:39:46 +00001944.. option:: -ftemplate-depth-<arg>
1945
Richard Smith081ad4d2017-01-24 19:39:46 +00001946.. option:: -ftemplate-depth=<arg>
1947
Richard Smith081ad4d2017-01-24 19:39:46 +00001948.. option:: -ftest-coverage
1949
Richard Smith081ad4d2017-01-24 19:39:46 +00001950.. option:: -fthinlto-index=<arg>
1951
1952Perform ThinLTO importing using provided function summary index
1953
Richard Smith081ad4d2017-01-24 19:39:46 +00001954.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1955
Richard Smith081ad4d2017-01-24 19:39:46 +00001956.. option:: -ftime-report
1957
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00001958.. option:: -ftime-trace
1959
Sylvestre Ledru70092042019-10-01 07:52:42 +00001960Turn on time profiler. Results can be analyzed with chrome://tracing or
1961`Speedscope App <https://www.speedscope.app>`_ for flamegraph visualization
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00001962
1963.. option:: -ftime-trace-granularity=<arg>
1964
1965Minimum time granularity (in microseconds) traced by time profiler
1966
Richard Smith081ad4d2017-01-24 19:39:46 +00001967.. option:: -ftls-model=<arg>
1968
Richard Smith081ad4d2017-01-24 19:39:46 +00001969.. option:: -ftrap-function=<arg>
1970
1971Issue call to specified function rather than a trap instruction
1972
Richard Smith081ad4d2017-01-24 19:39:46 +00001973.. option:: -ftrapping-math, -fno-trapping-math
1974
Richard Smith081ad4d2017-01-24 19:39:46 +00001975.. option:: -ftrapv
1976
1977Trap on integer overflow
1978
Richard Smith081ad4d2017-01-24 19:39:46 +00001979.. option:: -ftrapv-handler <arg>
1980
Richard Smithb2c82a62017-01-27 01:54:42 +00001981.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001982.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00001983.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001984
1985Specify the function to be called on overflow
1986
Richard Smith081ad4d2017-01-24 19:39:46 +00001987.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1988
1989Process trigraph sequences
1990
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -funique-section-names, -fno-unique-section-names
1992
1993Use unique names for text and data sections (ELF Only)
1994
Richard Smith081ad4d2017-01-24 19:39:46 +00001995.. option:: -funit-at-a-time, -fno-unit-at-a-time
1996
Richard Smith081ad4d2017-01-24 19:39:46 +00001997.. option:: -funroll-loops, -fno-unroll-loops
1998
1999Turn on loop unroller
2000
Richard Smith081ad4d2017-01-24 19:39:46 +00002001.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
2002
Richard Smith081ad4d2017-01-24 19:39:46 +00002003.. option:: -funsigned-bitfields
2004
Richard Smith081ad4d2017-01-24 19:39:46 +00002005.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
2006
Richard Smith081ad4d2017-01-24 19:39:46 +00002007.. option:: -funwind-tables, -fno-unwind-tables
2008
Richard Smith081ad4d2017-01-24 19:39:46 +00002009.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
2010
Richard Smith081ad4d2017-01-24 19:39:46 +00002011.. option:: -fuse-init-array, -fno-use-init-array
2012
2013Use .init\_array instead of .ctors
2014
Richard Smith081ad4d2017-01-24 19:39:46 +00002015.. option:: -fuse-ld=<arg>
2016
Richard Smith081ad4d2017-01-24 19:39:46 +00002017.. option:: -fuse-line-directives, -fno-use-line-directives
2018
Richard Smith081ad4d2017-01-24 19:39:46 +00002019.. option:: -fveclib=<arg>
2020
2021Use the given vector functions library
2022
Richard Smith081ad4d2017-01-24 19:39:46 +00002023.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2024
2025Enable the loop vectorization passes
2026
Erich Keanee30b71f2019-08-26 17:00:13 +00002027.. option:: -fverbose-asm, -fno-verbose-asm, -dA
Richard Smith081ad4d2017-01-24 19:39:46 +00002028
Richard Smith081ad4d2017-01-24 19:39:46 +00002029.. option:: -fvisibility-inlines-hidden
2030
Fangrui Songdf81b972018-07-19 22:45:41 +00002031Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00002032
Richard Smith081ad4d2017-01-24 19:39:46 +00002033.. option:: -fvisibility-ms-compat
2034
2035Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2036
Richard Smith081ad4d2017-01-24 19:39:46 +00002037.. option:: -fvisibility=<arg>
2038
2039Set the default symbol visibility for all global declarations
2040
Richard Smith081ad4d2017-01-24 19:39:46 +00002041.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2042
2043Enables whole-program vtable optimization. Requires -flto
2044
Richard Smith081ad4d2017-01-24 19:39:46 +00002045.. option:: -fwrapv, -fno-wrapv
2046
2047Treat signed integer overflow as two's complement
2048
Richard Smith081ad4d2017-01-24 19:39:46 +00002049.. option:: -fwritable-strings
2050
2051Store string literals as writable data
2052
Craig Topper188252d2017-12-11 21:09:16 +00002053.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2054
2055Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2056
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002057.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2058
2059Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2060
Richard Smith78e23fd2017-04-13 22:39:49 +00002061.. option:: -fxray-always-instrument=<arg>
2062
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002063DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2064
2065.. option:: -fxray-attr-list=<arg>
2066
2067Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002068
Richard Smith081ad4d2017-01-24 19:39:46 +00002069.. option:: -fxray-instruction-threshold<arg>
2070
Richard Smithb2c82a62017-01-27 01:54:42 +00002071.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002072.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002073.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002074
2075Sets the minimum function size to instrument with XRay
2076
Richard Smith081ad4d2017-01-24 19:39:46 +00002077.. option:: -fxray-instrument, -fno-xray-instrument
2078
2079Generate XRay instrumentation sleds on function entry and exit
2080
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002081.. option:: -fxray-instrumentation-bundle=<arg>
2082
2083Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'.
2084
2085.. option:: -fxray-link-deps
2086
2087Tells clang to add the link dependencies for XRay.
2088
2089.. option:: -fxray-modes=<arg>
2090
2091List of modes to link in by default into XRay instrumented binaries.
2092
Richard Smith78e23fd2017-04-13 22:39:49 +00002093.. option:: -fxray-never-instrument=<arg>
2094
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002095DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002096
Richard Smith081ad4d2017-01-24 19:39:46 +00002097.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2098
Richard Smith081ad4d2017-01-24 19:39:46 +00002099.. option:: -fzvector, -fno-zvector, -mzvector
2100
2101Enable System z vector language extension
2102
Richard Smith081ad4d2017-01-24 19:39:46 +00002103.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2104
Richard Smith081ad4d2017-01-24 19:39:46 +00002105.. option:: -pedantic-errors, --pedantic-errors
2106
2107OpenCL flags
2108------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002109.. option:: -cl-denorms-are-zero
2110
2111OpenCL only. Allow denormals to be flushed to zero.
2112
Richard Smith081ad4d2017-01-24 19:39:46 +00002113.. option:: -cl-fast-relaxed-math
2114
2115OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2116
Richard Smith081ad4d2017-01-24 19:39:46 +00002117.. option:: -cl-finite-math-only
2118
2119OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2120
Richard Smith081ad4d2017-01-24 19:39:46 +00002121.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2122
2123OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2124
Richard Smith081ad4d2017-01-24 19:39:46 +00002125.. option:: -cl-kernel-arg-info
2126
2127OpenCL only. Generate kernel argument metadata.
2128
Richard Smith081ad4d2017-01-24 19:39:46 +00002129.. option:: -cl-mad-enable
2130
2131OpenCL only. Allow use of less precise MAD computations in the generated binary.
2132
Richard Smith081ad4d2017-01-24 19:39:46 +00002133.. option:: -cl-no-signed-zeros
2134
2135OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2136
Richard Smith081ad4d2017-01-24 19:39:46 +00002137.. option:: -cl-opt-disable
2138
2139OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2140
Richard Smith081ad4d2017-01-24 19:39:46 +00002141.. option:: -cl-single-precision-constant
2142
2143OpenCL only. Treat double precision floating-point constant as single precision constant.
2144
Richard Smith081ad4d2017-01-24 19:39:46 +00002145.. option:: -cl-std=<arg>
2146
2147OpenCL language standard to compile for.
2148
Richard Smith081ad4d2017-01-24 19:39:46 +00002149.. option:: -cl-strict-aliasing
2150
2151OpenCL only. This option is added for compatibility with OpenCL 1.0.
2152
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002153.. option:: -cl-uniform-work-group-size
2154
2155OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2156
Richard Smith081ad4d2017-01-24 19:39:46 +00002157.. option:: -cl-unsafe-math-optimizations
2158
2159OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2160
2161Target-dependent compilation options
2162~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00002163.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2164
2165Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2166
Richard Smith081ad4d2017-01-24 19:39:46 +00002167.. option:: -m16
2168
Richard Smith081ad4d2017-01-24 19:39:46 +00002169.. option:: -m32
2170
Richard Smith081ad4d2017-01-24 19:39:46 +00002171.. option:: -m64
2172
Richard Smith081ad4d2017-01-24 19:39:46 +00002173.. option:: -mabi=<arg>
2174
Richard Smith081ad4d2017-01-24 19:39:46 +00002175.. option:: -malign-double
2176
2177Align doubles to two words in structs (x86 only)
2178
Richard Smith081ad4d2017-01-24 19:39:46 +00002179.. option:: -march=<arg>
2180
Richard Smith081ad4d2017-01-24 19:39:46 +00002181.. option:: -masm=<arg>
2182
Richard Smith081ad4d2017-01-24 19:39:46 +00002183.. option:: -mbackchain, -mno-backchain
2184
2185Link stack frames through backchain on System Z
2186
Richard Smith081ad4d2017-01-24 19:39:46 +00002187.. option:: -mcmodel=<arg>
2188
Richard Smith081ad4d2017-01-24 19:39:46 +00002189.. option:: -mconsole<arg>
2190
Krzysztof Parzyszek57e67062018-10-19 15:36:45 +00002191.. option:: -mcpu=<arg>, -mv5 (equivalent to -mcpu=hexagonv5), -mv55 (equivalent to -mcpu=hexagonv55), -mv60 (equivalent to -mcpu=hexagonv60), -mv62 (equivalent to -mcpu=hexagonv62), -mv65 (equivalent to -mcpu=hexagonv65)
Richard Smith081ad4d2017-01-24 19:39:46 +00002192
Ziang Wande94ac92019-06-25 23:57:14 +00002193Use -mcpu=? to see a list of supported cpu models.
2194
Vedant Kumar368540f2018-08-23 17:55:03 +00002195.. option:: -mcrc, -mno-crc
2196
2197Allow use of CRC instructions (ARM/Mips only)
2198
Craig Topperd23254a2017-07-20 17:52:48 +00002199.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2200
Richard Smith081ad4d2017-01-24 19:39:46 +00002201.. option:: -mdll<arg>
2202
Richard Smith081ad4d2017-01-24 19:39:46 +00002203.. option:: -mdynamic-no-pic<arg>
2204
Richard Smith081ad4d2017-01-24 19:39:46 +00002205.. option:: -meabi <arg>
2206
2207Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2208
Richard Smith78e23fd2017-04-13 22:39:49 +00002209.. option:: -mfentry
2210
Jonas Paulsson81aa62a2019-09-20 13:13:50 +00002211Insert calls to fentry at function entry (x86/SystemZ only)
Richard Smith78e23fd2017-04-13 22:39:49 +00002212
Richard Smith081ad4d2017-01-24 19:39:46 +00002213.. option:: -mfloat-abi=<arg>
2214
Richard Smith081ad4d2017-01-24 19:39:46 +00002215.. option:: -mfpmath=<arg>
2216
Richard Smith081ad4d2017-01-24 19:39:46 +00002217.. option:: -mfpu=<arg>
2218
Richard Smith081ad4d2017-01-24 19:39:46 +00002219.. option:: -mglobal-merge, -mno-global-merge
2220
2221Enable merging of globals
2222
Richard Smith081ad4d2017-01-24 19:39:46 +00002223.. option:: -mhard-float
2224
Richard Smith081ad4d2017-01-24 19:39:46 +00002225.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2226
Richard Smith081ad4d2017-01-24 19:39:46 +00002227.. option:: -miamcu, -mno-iamcu
2228
2229Use Intel MCU ABI
2230
Richard Smith081ad4d2017-01-24 19:39:46 +00002231.. option:: -mimplicit-float, -mno-implicit-float
2232
Richard Smith081ad4d2017-01-24 19:39:46 +00002233.. option:: -mimplicit-it=<arg>
2234
Richard Smith081ad4d2017-01-24 19:39:46 +00002235.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2236
2237(integrated-as) Emit an object file which can be used with an incremental linker
2238
Richard Smith78e23fd2017-04-13 22:39:49 +00002239.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002240
Richard Smith081ad4d2017-01-24 19:39:46 +00002241.. option:: -mkernel
2242
Richard Smith081ad4d2017-01-24 19:39:46 +00002243.. option:: -mlong-calls, -mno-long-calls
2244
2245Generate branches with extended addressability, usually via indirect jumps.
2246
Craig Topperd23254a2017-07-20 17:52:48 +00002247.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002248
J. Ryan Stinnettd45eaf92019-05-30 16:46:22 +00002249Set macOS deployment target
Richard Smith081ad4d2017-01-24 19:39:46 +00002250
Craig Topperd23254a2017-07-20 17:52:48 +00002251.. option:: -mmcu=<arg>
2252
Richard Smith081ad4d2017-01-24 19:39:46 +00002253.. option:: -mms-bitfields, -mno-ms-bitfields
2254
2255Set the default structure layout to be compatible with the Microsoft compiler standard
2256
Richard Smith081ad4d2017-01-24 19:39:46 +00002257.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2258
2259Omit frame pointer setup for leaf functions
2260
Richard Smith081ad4d2017-01-24 19:39:46 +00002261.. option:: -moslib=<arg>
2262
Richard Smith081ad4d2017-01-24 19:39:46 +00002263.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2264
2265Use copy relocations support for PIE builds
2266
Craig Topper9a724aa2017-12-11 21:09:19 +00002267.. option:: -mprefer-vector-width=<arg>
2268
2269Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2270
Richard Smith081ad4d2017-01-24 19:39:46 +00002271.. option:: -mqdsp6-compat
2272
2273Enable hexagon-qdsp6 backward compatibility
2274
Richard Smith081ad4d2017-01-24 19:39:46 +00002275.. option:: -mrecip
2276
Richard Smithb2c82a62017-01-27 01:54:42 +00002277.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002278.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002279.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002280
Richard Smith081ad4d2017-01-24 19:39:46 +00002281.. option:: -mred-zone, -mno-red-zone
2282
Richard Smith081ad4d2017-01-24 19:39:46 +00002283.. option:: -mregparm=<arg>
2284
Richard Smith081ad4d2017-01-24 19:39:46 +00002285.. option:: -mrelax-all, -mno-relax-all
2286
2287(integrated-as) Relax all machine instructions
2288
Vedant Kumar368540f2018-08-23 17:55:03 +00002289.. option:: -mretpoline, -mno-retpoline
2290
Richard Smith081ad4d2017-01-24 19:39:46 +00002291.. option:: -mrtd, -mno-rtd
2292
2293Make StdCall calling convention the default
2294
Vedant Kumar368540f2018-08-23 17:55:03 +00002295.. option:: -msign-return-address=<arg>
2296
2297Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002298
Richard Smith081ad4d2017-01-24 19:39:46 +00002299.. option:: -msoft-float, -mno-soft-float
2300
2301Use software floating point
2302
Richard Smith081ad4d2017-01-24 19:39:46 +00002303.. option:: -mstack-alignment=<arg>
2304
2305Set the stack alignment
2306
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002307.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2308
2309Enable stack probes
2310
Richard Smith081ad4d2017-01-24 19:39:46 +00002311.. option:: -mstack-probe-size=<arg>
2312
2313Set the stack probe size
2314
Richard Smith081ad4d2017-01-24 19:39:46 +00002315.. option:: -mstackrealign, -mno-stackrealign
2316
2317Force realign the stack at entry to every function
2318
Richard Smith081ad4d2017-01-24 19:39:46 +00002319.. option:: -mthread-model <arg>
2320
2321The thread model to use, e.g. posix, single (posix by default)
2322
Richard Smith081ad4d2017-01-24 19:39:46 +00002323.. option:: -mthreads<arg>
2324
Richard Smith081ad4d2017-01-24 19:39:46 +00002325.. option:: -mthumb, -mno-thumb
2326
Richard Smith081ad4d2017-01-24 19:39:46 +00002327.. option:: -mtune=<arg>
2328
Ziang Wande94ac92019-06-25 23:57:14 +00002329Use -mtune=? to see a list of supported cpu models.
2330
Richard Smith78e23fd2017-04-13 22:39:49 +00002331.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002332
Richard Smith081ad4d2017-01-24 19:39:46 +00002333.. option:: -municode<arg>
2334
Richard Smith081ad4d2017-01-24 19:39:46 +00002335.. option:: -mvx, -mno-vx
2336
Richard Smith081ad4d2017-01-24 19:39:46 +00002337.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2338
Richard Smith78e23fd2017-04-13 22:39:49 +00002339.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002340
Richard Smith081ad4d2017-01-24 19:39:46 +00002341.. option:: -mwindows<arg>
2342
Richard Smith081ad4d2017-01-24 19:39:46 +00002343.. option:: -mx32
2344
Richard Smith081ad4d2017-01-24 19:39:46 +00002345AARCH64
2346-------
Tri Vo6e8abbc2018-09-12 23:45:04 +00002347.. option:: -ffixed-x1
2348
2349Reserve the x1 register (AArch64 only)
2350
2351.. option:: -ffixed-x2
2352
2353Reserve the x2 register (AArch64 only)
2354
2355.. option:: -ffixed-x3
2356
2357Reserve the x3 register (AArch64 only)
2358
2359.. option:: -ffixed-x4
2360
2361Reserve the x4 register (AArch64 only)
2362
2363.. option:: -ffixed-x5
2364
2365Reserve the x5 register (AArch64 only)
2366
2367.. option:: -ffixed-x6
2368
2369Reserve the x6 register (AArch64 only)
2370
2371.. option:: -ffixed-x7
2372
2373Reserve the x7 register (AArch64 only)
2374
Richard Smith081ad4d2017-01-24 19:39:46 +00002375.. option:: -ffixed-x18
2376
2377Reserve the x18 register (AArch64 only)
2378
Petr Hosek72509082018-06-12 20:00:50 +00002379.. option:: -ffixed-x20
2380
2381Reserve the x20 register (AArch64 only)
2382
Tri Vo28e7e602018-09-25 16:48:40 +00002383.. option:: -fcall-saved-x8
2384
2385Make the x8 register call-saved (AArch64 only)
2386
2387.. option:: -fcall-saved-x9
2388
2389Make the x9 register call-saved (AArch64 only)
2390
2391.. option:: -fcall-saved-x10
2392
2393Make the x10 register call-saved (AArch64 only)
2394
2395.. option:: -fcall-saved-x11
2396
2397Make the x11 register call-saved (AArch64 only)
2398
2399.. option:: -fcall-saved-x12
2400
2401Make the x12 register call-saved (AArch64 only)
2402
2403.. option:: -fcall-saved-x13
2404
2405Make the x13 register call-saved (AArch64 only)
2406
2407.. option:: -fcall-saved-x14
2408
2409Make the x14 register call-saved (AArch64 only)
2410
2411.. option:: -fcall-saved-x15
2412
2413Make the x15 register call-saved (AArch64 only)
2414
2415.. option:: -fcall-saved-x18
2416
2417Make the x18 register call-saved (AArch64 only)
2418
Richard Smith081ad4d2017-01-24 19:39:46 +00002419.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2420
2421Workaround Cortex-A53 erratum 835769 (AArch64 only)
2422
Richard Smith081ad4d2017-01-24 19:39:46 +00002423.. option:: -mgeneral-regs-only
2424
2425Generate code which only uses the general purpose registers (AArch64 only)
2426
2427AMDGPU
2428------
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002429.. option:: -mcumode, -mno-cumode
2430
2431CU wavefront execution mode is used if enabled and WGP wavefront execution mode
2432is used if disabled (AMDGPU only)
2433
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002434.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2435
2436Wavefront size 64 is used if enabled and wavefront size 32 if disabled (AMDGPU only)
2437
Craig Topper16418662017-11-20 18:07:43 +00002438.. option:: -mxnack, -mno-xnack
2439
2440Enable XNACK (AMDGPU only)
2441
Richard Smith081ad4d2017-01-24 19:39:46 +00002442ARM
2443---
Richard Smith081ad4d2017-01-24 19:39:46 +00002444.. option:: -ffixed-r9
2445
2446Reserve the r9 register (ARM only)
2447
Momchil Velikovac215352020-01-29 10:38:10 +00002448.. option:: -march=<name>[+<extension>...]
2449
2450Specify the target Arm ISA.
2451
2452The list of accepted architecture names is as follows:
2453``armv2``, ``armv2a``,
2454``armv3``, ``armv3m``,
2455``armv4``, ``armv4t``,
2456``armv5t``, ``armv5te``,
2457``armv6``, ``armv6k``, ``armv6t2``, ``armv6kz``, ``armv6-m``,
2458``armv7-a``, ``armv7ve``, ``armv7-r``, ``armv7-m``, ``armv7e-m``,
2459``armv8-a``, ``armv8.1-a``, ``armv8.2-a``, ``armv8.3-a``, ``armv8.5-a``, ``armv8-r``,
2460``armv8-m.base``, ``armv8-m.main``, ``armv8.1-m.main``,
2461``iwmmxt``,
2462``iwmmxt2``,
2463``xscale``,
2464``armv7s``,
2465``armv7k``
2466
2467Extension modifiers can be used to enable optional architecture features. The
2468syntax ``+no``<extension> can be used to disable previously enabled features.
2469
2470Some of the extension names are generic, but have an architecture specific
2471effect. For example, the extension syntax ``+fp`` might enable FPv4-SP-D16 for
2472the Armv7-M architecture, but VFPv3-D16 for the Armv7-A arrchitecture.
2473
2474The following extension names are recognised:
2475
2476``+crc``
2477 Enable Cyclic Redundancy Check instructions
2478``+crypto``
2479 Enable cryptographic instructions
2480``+sha2``
2481 Enable SHA1 and SHA256 support instructions
2482``+aes``
2483 Enable AES support instructions
2484``+dotprod``
2485 Enable dot product instructions
2486``+dsp``
2487 Enable digital signal processing (DSP) instructions in ARM and Thumb2
2488``+fp``
2489 Enable floating-point instructions for the baseline FPU implementation
2490 available for the given architecture
2491``+fp.dp``
2492 Enable optional double-precision floating-point instructions
2493``+mve``
2494 Enable integer-only MVE instructions. This extension also implicitly enables
2495 the DSP extension.
2496``+mve.fp``
2497 Enable floating-point MVE instructions. This extension also implicitly
2498 enables the MVE, DSP, FP16, and FPv5-sp-d16 extensions.
2499``+idiv``
2500 Enables the interget divide instructions in ARM and Thumb2
2501``+mp``
2502 Enabled the Multiprocessing extension
2503``+simd``
2504 Enables the baseline SIMD instructions for the given architecture
2505``+sec``
2506 Enable TrustZone security extension
2507``+virt``
2508 Enable Viritualization extensions
2509``+fp16``
2510 Enable half-precision floating-point instructions
2511``+ras``
2512 Enable Reliability, Availability, and Serviceability extensions
2513``+fp16fml``
2514 Enable half-precision floating-point fused multiply-add/sub instructions
2515``+sb``
2516 Enable v8.5a Speculation Barrier
2517``+lob``
2518 Enable Low Overhead Branch extensions
2519
Richard Smith081ad4d2017-01-24 19:39:46 +00002520.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2521
2522Disallow generation of data access to code sections (ARM only)
2523
Momchil Velikovac215352020-01-29 10:38:10 +00002524.. option:: -mfpu=<name>
2525
2526Specify floating-point unit (or lack thereof) that is available on the target.
2527
2528The accepted values for <name> are:
2529
2530``none``
2531 Prevent the compiler from using floating-point instructions.
2532``vfp``
2533
2534``vfpv2``
2535 Enable VFPv2 instructions. Disable the Advanced SIMD extension.
2536``vfpv3``
2537 Enable VFPv3 instructions. Disable the Advanced SIMD extension.
2538``vfpv3-fp16``
2539 Enable VFPv3 instructions, including optional half-precision instructions.
2540 Disable the Advanced SIMD extension.
2541``vfpv3-d16``
2542 Enable VFPv3 instructions, with access to only 16 double-precision
2543 registers. Disable the Advanced SIMD extension.
2544``vfpv3-d16-fp16``
2545 Enable VFPv3 instructions, including optional half-precision instructions,
2546 with access to only 16 double-precision registers. Disable the Advanced
2547 SIMD extension.
2548``vfpv3xd``
2549 Enable VFPv3 insructions, with single-precision floating-point operations
2550 only and just 16 double-precision registers. Disable the Advanced SIMD
2551 extension.
2552``vfpv3xd-fp16``
2553 Enable VFPv3 instructions, with single-precision and half-precision,
2554 floating-point operations only. Disable the Advanced SIMD extension.
2555``vfpv4``
2556 Enable VFPv4 instructions. Disable the Advanced SIMD extension.
2557``vfpv4-d16``
2558 Enable VFPv4 instructions, with access to only 16 double-precision
2559 registers. Disable the Advanced SIMD extension.
2560``fpv4-sp-d16``
2561 Enable the Armv7-M FPv4-SP-D16 floating-point extension, with
2562 single-precision floating-point operations only, and only 16
2563 double-precision registers.
2564``fpv5-d16``
2565 Enable the Armv7-M FPv5-D16 floating-point extension, with only 16
2566 double-precision registers.
2567``fpv5-sp-d16``
2568 Enable the Armv7-M FPv5-SP-D16 floating-point extension, with
2569 single-precision floating-point operations only, and only 16
2570 double-precision registers.
2571``fp-armv8``
2572 Enable Armv8 floaing-point extension. Disable the cryptographic extension
2573 and the Advanced SIMD extension.
2574``fp-armv8-fullfp16-d16``
2575 Enable Armv8 floaing-point extension, with half-precision operations and
2576 only 16 double-precision registers.
2577``fp-armv8-fullfp16-sp-d16``
2578 Enable Armv8 floaing-point extension with only single- and half-precision
2579 operations and only 16 double-precision registers.
2580``neon``
2581 Enable VFPv3 and Advanced SIMD extensions.
2582``neon-fp16``
2583 Enable VFPv3, Advanced SIMD extensions, and half-precision instructions.
2584``neon-vfpv4``
2585 Enable VFPv4 and Advanced SIMD extensions.
2586``neon-fp-armv8``
2587 Enable Armv8 floaing-point and Advanced SIMD extensions.
2588``crypto-neon-fp-armv8``
2589 Enable the Armv8 floaing-point extension, the cryptographic extension, and
2590 the Advanced SIMD extension.
2591
Richard Smith081ad4d2017-01-24 19:39:46 +00002592.. option:: -mno-movt
2593
2594Disallow use of movt/movw pairs (ARM only)
2595
Richard Smith78e23fd2017-04-13 22:39:49 +00002596.. option:: -mno-neg-immediates
2597
2598Disallow converting instructions with negative immediates to their negation or inversion.
2599
Richard Smith081ad4d2017-01-24 19:39:46 +00002600.. option:: -mnocrc
2601
2602Disallow use of CRC instructions (ARM only)
2603
Richard Smith081ad4d2017-01-24 19:39:46 +00002604.. option:: -mrestrict-it, -mno-restrict-it
2605
2606Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2607
Craig Topper16418662017-11-20 18:07:43 +00002608.. option:: -mtp=<arg>
2609
2610Read thread pointer from coprocessor register (ARM only)
2611
Richard Smith081ad4d2017-01-24 19:39:46 +00002612.. option:: -munaligned-access, -mno-unaligned-access
2613
2614Allow memory accesses to be unaligned (AArch32/AArch64 only)
2615
2616Hexagon
2617-------
Craig Topper16418662017-11-20 18:07:43 +00002618.. option:: -mieee-rnd-near
2619
Vedant Kumar368540f2018-08-23 17:55:03 +00002620.. option:: -mmemops, -mno-memops
2621
2622Enable generation of memop instructions
2623
2624.. option:: -mnvj, -mno-nvj
2625
2626Enable generation of new-value jumps
2627
2628.. option:: -mnvs, -mno-nvs
2629
2630Enable generation of new-value stores
2631
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002632.. option:: -mpackets, -mno-packets
2633
2634Enable generation of instruction packets
2635
Craig Topper16418662017-11-20 18:07:43 +00002636Hexagon
2637-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002638.. option:: -mhvx, -mno-hvx
2639
2640Enable Hexagon Vector eXtensions
2641
Craig Topper16418662017-11-20 18:07:43 +00002642.. option:: -mhvx-length=<arg>
2643
2644Set Hexagon Vector Length
2645
2646.. program:: clang1
2647.. option:: -mhvx=<arg>
2648.. program:: clang
2649
2650Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002651
Vedant Kumar368540f2018-08-23 17:55:03 +00002652MIPS
2653----
2654.. option:: -mabicalls, -mno-abicalls
2655
2656Enable SVR4-style position-independent code (Mips only)
2657
2658.. option:: -mabs=<arg>
2659
2660.. option:: -mcheck-zero-division, -mno-check-zero-division
2661
2662.. option:: -mcompact-branches=<arg>
2663
2664.. option:: -mdouble-float
2665
2666.. option:: -mdsp, -mno-dsp
2667
2668.. option:: -mdspr2, -mno-dspr2
2669
2670.. option:: -membedded-data, -mno-embedded-data
2671
2672Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2673
2674.. option:: -mextern-sdata, -mno-extern-sdata
2675
2676Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2677
2678.. option:: -mfp32
2679
2680Use 32-bit floating point registers (MIPS only)
2681
2682.. option:: -mfp64
2683
2684Use 64-bit floating point registers (MIPS only)
2685
2686.. option:: -mginv, -mno-ginv
2687
2688.. option:: -mgpopt, -mno-gpopt
2689
2690Use GP relative accesses for symbols known to be in a small data section (MIPS)
2691
2692.. option:: -mindirect-jump=<arg>
2693
2694Change indirect jump instructions to inhibit speculation
2695
2696.. option:: -mips16
2697
2698.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2699
2700.. option:: -mlocal-sdata, -mno-local-sdata
2701
2702Extend the -G behaviour to object local data (MIPS)
2703
2704.. option:: -mmadd4, -mno-madd4
2705
2706Enable the generation of 4-operand madd.s, madd.d and related instructions.
2707
2708.. option:: -mmicromips, -mno-micromips
2709
2710.. option:: -mmsa, -mno-msa
2711
2712Enable MSA ASE (MIPS only)
2713
2714.. option:: -mmt, -mno-mt
2715
2716Enable MT ASE (MIPS only)
2717
2718.. option:: -mnan=<arg>
2719
2720.. option:: -mno-mips16
2721
2722.. option:: -msingle-float
2723
2724.. option:: -mvirt, -mno-virt
2725
2726.. option:: -mxgot, -mno-xgot
2727
Richard Smith081ad4d2017-01-24 19:39:46 +00002728PowerPC
2729-------
Richard Smith78e23fd2017-04-13 22:39:49 +00002730.. option:: -maltivec, -mno-altivec
2731
Richard Smith081ad4d2017-01-24 19:39:46 +00002732.. option:: -mcmpb, -mno-cmpb
2733
Richard Smith081ad4d2017-01-24 19:39:46 +00002734.. option:: -mcrbits, -mno-crbits
2735
Richard Smith081ad4d2017-01-24 19:39:46 +00002736.. option:: -mcrypto, -mno-crypto
2737
Richard Smith081ad4d2017-01-24 19:39:46 +00002738.. option:: -mdirect-move, -mno-direct-move
2739
Richard Smith081ad4d2017-01-24 19:39:46 +00002740.. option:: -mfloat128, -mno-float128
2741
Richard Smith081ad4d2017-01-24 19:39:46 +00002742.. option:: -mfprnd, -mno-fprnd
2743
Richard Smith081ad4d2017-01-24 19:39:46 +00002744.. option:: -mhtm, -mno-htm
2745
Richard Smith081ad4d2017-01-24 19:39:46 +00002746.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2747
Richard Smith081ad4d2017-01-24 19:39:46 +00002748.. option:: -misel, -mno-isel
2749
Richard Smith081ad4d2017-01-24 19:39:46 +00002750.. option:: -mlongcall, -mno-longcall
2751
Richard Smith081ad4d2017-01-24 19:39:46 +00002752.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2753
Richard Smith081ad4d2017-01-24 19:39:46 +00002754.. option:: -mpopcntd, -mno-popcntd
2755
Richard Smith081ad4d2017-01-24 19:39:46 +00002756.. option:: -mpower8-vector, -mno-power8-vector
2757
Richard Smith081ad4d2017-01-24 19:39:46 +00002758.. option:: -mpower9-vector, -mno-power9-vector
2759
Richard Smith081ad4d2017-01-24 19:39:46 +00002760.. option:: -mqpx, -mno-qpx
2761
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002762.. option:: -msecure-plt
2763
Richard Smith081ad4d2017-01-24 19:39:46 +00002764.. option:: -mvsx, -mno-vsx
2765
2766WebAssembly
2767-----------
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002768.. option:: -mexception-handling, -mno-exception-handling
2769
Craig Topper188252d2017-12-11 21:09:16 +00002770.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
2771
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00002772.. option:: -msign-ext, -mno-sign-ext
2773
Richard Smith081ad4d2017-01-24 19:39:46 +00002774.. option:: -msimd128, -mno-simd128
2775
2776X86
2777---
Richard Smith081ad4d2017-01-24 19:39:46 +00002778.. option:: -m3dnow, -mno-3dnow
2779
Richard Smith081ad4d2017-01-24 19:39:46 +00002780.. option:: -m3dnowa, -mno-3dnowa
2781
Richard Smith081ad4d2017-01-24 19:39:46 +00002782.. option:: -madx, -mno-adx
2783
Richard Smith081ad4d2017-01-24 19:39:46 +00002784.. option:: -maes, -mno-aes
2785
Richard Smith081ad4d2017-01-24 19:39:46 +00002786.. option:: -mavx, -mno-avx
2787
Richard Smith081ad4d2017-01-24 19:39:46 +00002788.. option:: -mavx2, -mno-avx2
2789
Craig Topper287c8012018-01-03 18:29:12 +00002790.. option:: -mavx512bitalg, -mno-avx512bitalg
2791
Luo, Yuanke844f6622019-05-06 08:25:11 +00002792.. option:: -mavx512bf16, -mno-avx512bf16
2793
Richard Smith081ad4d2017-01-24 19:39:46 +00002794.. option:: -mavx512bw, -mno-avx512bw
2795
Richard Smith081ad4d2017-01-24 19:39:46 +00002796.. option:: -mavx512cd, -mno-avx512cd
2797
Richard Smith081ad4d2017-01-24 19:39:46 +00002798.. option:: -mavx512dq, -mno-avx512dq
2799
Richard Smith081ad4d2017-01-24 19:39:46 +00002800.. option:: -mavx512er, -mno-avx512er
2801
Richard Smith081ad4d2017-01-24 19:39:46 +00002802.. option:: -mavx512f, -mno-avx512f
2803
Richard Smith081ad4d2017-01-24 19:39:46 +00002804.. option:: -mavx512ifma, -mno-avx512ifma
2805
Richard Smith081ad4d2017-01-24 19:39:46 +00002806.. option:: -mavx512pf, -mno-avx512pf
2807
Richard Smith081ad4d2017-01-24 19:39:46 +00002808.. option:: -mavx512vbmi, -mno-avx512vbmi
2809
Craig Topper287c8012018-01-03 18:29:12 +00002810.. option:: -mavx512vbmi2, -mno-avx512vbmi2
2811
Richard Smith081ad4d2017-01-24 19:39:46 +00002812.. option:: -mavx512vl, -mno-avx512vl
2813
Craig Topper287c8012018-01-03 18:29:12 +00002814.. option:: -mavx512vnni, -mno-avx512vnni
2815
Pengfei Wangcc3629d2019-05-31 06:09:35 +00002816.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
2817
Craig Topperd23254a2017-07-20 17:52:48 +00002818.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2819
Richard Smith081ad4d2017-01-24 19:39:46 +00002820.. option:: -mbmi, -mno-bmi
2821
Richard Smith081ad4d2017-01-24 19:39:46 +00002822.. option:: -mbmi2, -mno-bmi2
2823
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002824.. option:: -mcldemote, -mno-cldemote
2825
Craig Topper78b47872017-02-08 06:48:58 +00002826.. option:: -mclflushopt, -mno-clflushopt
2827
Craig Topper177a57c2017-02-08 07:57:01 +00002828.. option:: -mclwb, -mno-clwb
2829
Richard Smith78e23fd2017-04-13 22:39:49 +00002830.. option:: -mclzero, -mno-clzero
2831
Richard Smith081ad4d2017-01-24 19:39:46 +00002832.. option:: -mcx16, -mno-cx16
2833
Pengfei Wang3a29f7c2019-06-06 08:28:42 +00002834.. option:: -menqcmd, -mno-enqcmd
2835
Richard Smith081ad4d2017-01-24 19:39:46 +00002836.. option:: -mf16c, -mno-f16c
2837
Richard Smith081ad4d2017-01-24 19:39:46 +00002838.. option:: -mfma, -mno-fma
2839
Richard Smith081ad4d2017-01-24 19:39:46 +00002840.. option:: -mfma4, -mno-fma4
2841
Richard Smith081ad4d2017-01-24 19:39:46 +00002842.. option:: -mfsgsbase, -mno-fsgsbase
2843
Richard Smith081ad4d2017-01-24 19:39:46 +00002844.. option:: -mfxsr, -mno-fxsr
2845
Craig Topper287c8012018-01-03 18:29:12 +00002846.. option:: -mgfni, -mno-gfni
2847
Vedant Kumar368540f2018-08-23 17:55:03 +00002848.. option:: -minvpcid, -mno-invpcid
2849
Craig Topperd23254a2017-07-20 17:52:48 +00002850.. option:: -mlwp, -mno-lwp
2851
Richard Smith081ad4d2017-01-24 19:39:46 +00002852.. option:: -mlzcnt, -mno-lzcnt
2853
Richard Smith081ad4d2017-01-24 19:39:46 +00002854.. option:: -mmmx, -mno-mmx
2855
Craig Topper177a57c2017-02-08 07:57:01 +00002856.. option:: -mmovbe, -mno-movbe
2857
Gabor Buellaa51e0c22018-05-01 10:05:42 +00002858.. option:: -mmovdir64b, -mno-movdir64b
2859
Vedant Kumar368540f2018-08-23 17:55:03 +00002860.. option:: -mmovdiri, -mno-movdiri
2861
Craig Topperb16cb822017-02-08 07:56:42 +00002862.. option:: -mmpx, -mno-mpx
2863
Richard Smith081ad4d2017-01-24 19:39:46 +00002864.. option:: -mmwaitx, -mno-mwaitx
2865
Richard Smith081ad4d2017-01-24 19:39:46 +00002866.. option:: -mpclmul, -mno-pclmul
2867
Vedant Kumar368540f2018-08-23 17:55:03 +00002868.. option:: -mpconfig, -mno-pconfig
2869
Richard Smith081ad4d2017-01-24 19:39:46 +00002870.. option:: -mpku, -mno-pku
2871
Richard Smith081ad4d2017-01-24 19:39:46 +00002872.. option:: -mpopcnt, -mno-popcnt
2873
Craig Topperd2bf7b02017-02-08 08:23:40 +00002874.. option:: -mprefetchwt1, -mno-prefetchwt1
2875
Richard Smith081ad4d2017-01-24 19:39:46 +00002876.. option:: -mprfchw, -mno-prfchw
2877
Vedant Kumar368540f2018-08-23 17:55:03 +00002878.. option:: -mptwrite, -mno-ptwrite
2879
Craig Topper596527b2018-01-23 18:40:15 +00002880.. option:: -mrdpid, -mno-rdpid
2881
Richard Smith081ad4d2017-01-24 19:39:46 +00002882.. option:: -mrdrnd, -mno-rdrnd
2883
Richard Smith081ad4d2017-01-24 19:39:46 +00002884.. option:: -mrdseed, -mno-rdseed
2885
Craig Topper596527b2018-01-23 18:40:15 +00002886.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
2887
Richard Smith081ad4d2017-01-24 19:39:46 +00002888.. option:: -mrtm, -mno-rtm
2889
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002890.. option:: -msahf, -mno-sahf
2891
Craig Topper204ecff2017-02-08 08:23:17 +00002892.. option:: -msgx, -mno-sgx
2893
Richard Smith081ad4d2017-01-24 19:39:46 +00002894.. option:: -msha, -mno-sha
2895
Craig Topper188252d2017-12-11 21:09:16 +00002896.. option:: -mshstk, -mno-shstk
2897
Richard Smith081ad4d2017-01-24 19:39:46 +00002898.. option:: -msse, -mno-sse
2899
Richard Smith081ad4d2017-01-24 19:39:46 +00002900.. option:: -msse2, -mno-sse2
2901
Richard Smith081ad4d2017-01-24 19:39:46 +00002902.. option:: -msse3, -mno-sse3
2903
Richard Smith081ad4d2017-01-24 19:39:46 +00002904.. option:: -msse4.1, -mno-sse4.1
2905
Richard Smithb2c82a62017-01-27 01:54:42 +00002906.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002907.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00002908.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002909
Richard Smith081ad4d2017-01-24 19:39:46 +00002910.. option:: -msse4a, -mno-sse4a
2911
Richard Smith081ad4d2017-01-24 19:39:46 +00002912.. option:: -mssse3, -mno-ssse3
2913
Richard Smith081ad4d2017-01-24 19:39:46 +00002914.. option:: -mtbm, -mno-tbm
2915
Craig Topper287c8012018-01-03 18:29:12 +00002916.. option:: -mvaes, -mno-vaes
2917
2918.. option:: -mvpclmulqdq, -mno-vpclmulqdq
2919
Craig Topper42da9cb2018-04-23 21:41:06 +00002920.. option:: -mwaitpkg, -mno-waitpkg
2921
Gabor Buellaa0520162018-04-11 20:09:09 +00002922.. option:: -mwbnoinvd, -mno-wbnoinvd
2923
Richard Smith081ad4d2017-01-24 19:39:46 +00002924.. option:: -mx87, -m80387, -mno-x87
2925
Richard Smith081ad4d2017-01-24 19:39:46 +00002926.. option:: -mxop, -mno-xop
2927
Richard Smith081ad4d2017-01-24 19:39:46 +00002928.. option:: -mxsave, -mno-xsave
2929
Richard Smith081ad4d2017-01-24 19:39:46 +00002930.. option:: -mxsavec, -mno-xsavec
2931
Richard Smith081ad4d2017-01-24 19:39:46 +00002932.. option:: -mxsaveopt, -mno-xsaveopt
2933
Richard Smith081ad4d2017-01-24 19:39:46 +00002934.. option:: -mxsaves, -mno-xsaves
2935
Vedant Kumar368540f2018-08-23 17:55:03 +00002936RISCV
2937-----
2938.. option:: -mrelax, -mno-relax
2939
2940Enable linker relaxation
2941
Richard Smith081ad4d2017-01-24 19:39:46 +00002942Optimization level
2943~~~~~~~~~~~~~~~~~~
2944
2945Flags controlling how much optimization should be performed.
2946
Richard Smith081ad4d2017-01-24 19:39:46 +00002947.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2948
Richard Smith081ad4d2017-01-24 19:39:46 +00002949.. option:: -Ofast<arg>
2950
2951Debug information generation
2952~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2953
2954Flags controlling how much and what kind of debug information should be
2955generated.
2956
2957Kind and level of debug information
2958-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002959.. option:: -g, --debug, --debug=<arg>
2960
2961Generate source-level debug information
2962
Richard Smith081ad4d2017-01-24 19:39:46 +00002963.. option:: -gdwarf-2
2964
2965Generate source-level debug information with dwarf version 2
2966
Richard Smith081ad4d2017-01-24 19:39:46 +00002967.. option:: -gdwarf-3
2968
2969Generate source-level debug information with dwarf version 3
2970
Richard Smith081ad4d2017-01-24 19:39:46 +00002971.. option:: -gdwarf-4, -gdwarf
2972
2973Generate source-level debug information with dwarf version 4
2974
Richard Smith081ad4d2017-01-24 19:39:46 +00002975.. option:: -gdwarf-5
2976
2977Generate source-level debug information with dwarf version 5
2978
Richard Smith081ad4d2017-01-24 19:39:46 +00002979.. option:: -gfull
2980
Richard Smith081ad4d2017-01-24 19:39:46 +00002981.. option:: -gused
2982
2983Debug level
2984___________
Richard Smith081ad4d2017-01-24 19:39:46 +00002985.. option:: -g0
2986
Richard Smith081ad4d2017-01-24 19:39:46 +00002987.. option:: -g2
2988
Richard Smith081ad4d2017-01-24 19:39:46 +00002989.. option:: -g3
2990
Richard Smith081ad4d2017-01-24 19:39:46 +00002991.. option:: -ggdb0
2992
Richard Smith081ad4d2017-01-24 19:39:46 +00002993.. option:: -ggdb1
2994
Richard Smith081ad4d2017-01-24 19:39:46 +00002995.. option:: -ggdb2
2996
Richard Smith081ad4d2017-01-24 19:39:46 +00002997.. option:: -ggdb3
2998
Richard Smith081ad4d2017-01-24 19:39:46 +00002999.. option:: -gline-tables-only, -g1, -gmlt
3000
3001Emit debug line number tables only
3002
Richard Smith081ad4d2017-01-24 19:39:46 +00003003.. option:: -gmodules
3004
3005Generate debug info with external references to clang modules or precompiled headers
3006
3007Debugger to tune debug information for
3008______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00003009.. option:: -ggdb
3010
Richard Smith081ad4d2017-01-24 19:39:46 +00003011.. option:: -glldb
3012
Richard Smith081ad4d2017-01-24 19:39:46 +00003013.. option:: -gsce
3014
3015Debug information flags
3016-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003017.. option:: -gcolumn-info, -gno-column-info
3018
Richard Smith081ad4d2017-01-24 19:39:46 +00003019.. option:: -gdwarf-aranges
3020
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003021.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00003022
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003023Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00003024
Vedant Kumar368540f2018-08-23 17:55:03 +00003025.. option:: -ggnu-pubnames, -gno-gnu-pubnames
3026
3027.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00003028
Scott Linderde6beb02018-12-14 15:38:15 +00003029.. option:: -grecord-command-line, -grecord-gcc-switches, -gno-record-command-line, -gno-record-gcc-switches
Richard Smith081ad4d2017-01-24 19:39:46 +00003030
Richard Smith081ad4d2017-01-24 19:39:46 +00003031.. option:: -gsplit-dwarf
3032
Richard Smith081ad4d2017-01-24 19:39:46 +00003033.. option:: -gstrict-dwarf, -gno-strict-dwarf
3034
Craig Topperd23254a2017-07-20 17:52:48 +00003035.. option:: -gz
3036
3037DWARF debug sections compression type
3038
3039.. program:: clang1
3040.. option:: -gz=<arg>
3041.. program:: clang
3042
3043DWARF debug sections compression type
3044
Richard Smithc5b2e002017-01-27 02:08:37 +00003045Static analyzer flags
3046=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00003047
Richard Smithc5b2e002017-01-27 02:08:37 +00003048Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00003049
Richard Smithc5b2e002017-01-27 02:08:37 +00003050.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00003051
Richard Smithc5b2e002017-01-27 02:08:37 +00003052Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00003053
3054Fortran compilation flags
3055=========================
3056
3057Flags that will be passed onto the ``gfortran`` compiler when Clang is given
3058a Fortran input.
3059
Richard Smithc5b2e002017-01-27 02:08:37 +00003060.. option:: -A<arg>, --assert <arg>, --assert=<arg>
3061
Richard Smith081ad4d2017-01-24 19:39:46 +00003062.. option:: -A-<arg>
3063
Richard Smith081ad4d2017-01-24 19:39:46 +00003064.. option:: -J<arg>
3065
Richard Smith081ad4d2017-01-24 19:39:46 +00003066.. option:: -cpp
3067
Richard Smith081ad4d2017-01-24 19:39:46 +00003068.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
3069
Richard Smith081ad4d2017-01-24 19:39:46 +00003070.. option:: -falign-commons, -fno-align-commons
3071
Richard Smith081ad4d2017-01-24 19:39:46 +00003072.. option:: -fall-intrinsics, -fno-all-intrinsics
3073
Richard Smith081ad4d2017-01-24 19:39:46 +00003074.. option:: -fautomatic, -fno-automatic
3075
Richard Smith081ad4d2017-01-24 19:39:46 +00003076.. option:: -fbackslash, -fno-backslash
3077
Richard Smith081ad4d2017-01-24 19:39:46 +00003078.. option:: -fbacktrace, -fno-backtrace
3079
Richard Smith081ad4d2017-01-24 19:39:46 +00003080.. option:: -fblas-matmul-limit=<arg>
3081
Richard Smith081ad4d2017-01-24 19:39:46 +00003082.. option:: -fbounds-check, -fno-bounds-check
3083
Richard Smith081ad4d2017-01-24 19:39:46 +00003084.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
3085
Richard Smith081ad4d2017-01-24 19:39:46 +00003086.. option:: -fcheck=<arg>
3087
Richard Smith081ad4d2017-01-24 19:39:46 +00003088.. option:: -fcoarray=<arg>
3089
Richard Smith081ad4d2017-01-24 19:39:46 +00003090.. option:: -fconvert=<arg>
3091
Richard Smith081ad4d2017-01-24 19:39:46 +00003092.. option:: -fcray-pointer, -fno-cray-pointer
3093
Richard Smith081ad4d2017-01-24 19:39:46 +00003094.. option:: -fd-lines-as-code, -fno-d-lines-as-code
3095
Richard Smith081ad4d2017-01-24 19:39:46 +00003096.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
3097
Richard Smith081ad4d2017-01-24 19:39:46 +00003098.. option:: -fdefault-double-8, -fno-default-double-8
3099
Richard Smith081ad4d2017-01-24 19:39:46 +00003100.. option:: -fdefault-integer-8, -fno-default-integer-8
3101
Richard Smith081ad4d2017-01-24 19:39:46 +00003102.. option:: -fdefault-real-8, -fno-default-real-8
3103
Richard Smith081ad4d2017-01-24 19:39:46 +00003104.. option:: -fdollar-ok, -fno-dollar-ok
3105
Richard Smith081ad4d2017-01-24 19:39:46 +00003106.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
3107
Richard Smith081ad4d2017-01-24 19:39:46 +00003108.. option:: -fdump-fortran-original, -fno-dump-fortran-original
3109
Richard Smith081ad4d2017-01-24 19:39:46 +00003110.. option:: -fdump-parse-tree, -fno-dump-parse-tree
3111
Richard Smith081ad4d2017-01-24 19:39:46 +00003112.. option:: -fexternal-blas, -fno-external-blas
3113
Richard Smith081ad4d2017-01-24 19:39:46 +00003114.. option:: -ff2c, -fno-f2c
3115
Richard Smith081ad4d2017-01-24 19:39:46 +00003116.. option:: -ffixed-form, -fno-fixed-form
3117
Richard Smith081ad4d2017-01-24 19:39:46 +00003118.. option:: -ffixed-line-length-<arg>
3119
Richard Smith081ad4d2017-01-24 19:39:46 +00003120.. option:: -ffpe-trap=<arg>
3121
Richard Smith081ad4d2017-01-24 19:39:46 +00003122.. option:: -ffree-form, -fno-free-form
3123
Richard Smith081ad4d2017-01-24 19:39:46 +00003124.. option:: -ffree-line-length-<arg>
3125
Richard Smith081ad4d2017-01-24 19:39:46 +00003126.. option:: -ffrontend-optimize, -fno-frontend-optimize
3127
Richard Smith081ad4d2017-01-24 19:39:46 +00003128.. option:: -fimplicit-none, -fno-implicit-none
3129
Richard Smith081ad4d2017-01-24 19:39:46 +00003130.. option:: -finit-character=<arg>
3131
Richard Smith081ad4d2017-01-24 19:39:46 +00003132.. option:: -finit-integer=<arg>
3133
Richard Smith081ad4d2017-01-24 19:39:46 +00003134.. option:: -finit-local-zero, -fno-init-local-zero
3135
Richard Smith081ad4d2017-01-24 19:39:46 +00003136.. option:: -finit-logical=<arg>
3137
Richard Smith081ad4d2017-01-24 19:39:46 +00003138.. option:: -finit-real=<arg>
3139
Richard Smith081ad4d2017-01-24 19:39:46 +00003140.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
3141
Richard Smith081ad4d2017-01-24 19:39:46 +00003142.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
3143
Richard Smith081ad4d2017-01-24 19:39:46 +00003144.. option:: -fmax-array-constructor=<arg>
3145
Richard Smith081ad4d2017-01-24 19:39:46 +00003146.. option:: -fmax-errors=<arg>
3147
Richard Smith081ad4d2017-01-24 19:39:46 +00003148.. option:: -fmax-identifier-length, -fno-max-identifier-length
3149
Richard Smith081ad4d2017-01-24 19:39:46 +00003150.. option:: -fmax-stack-var-size=<arg>
3151
Richard Smith081ad4d2017-01-24 19:39:46 +00003152.. option:: -fmax-subrecord-length=<arg>
3153
Richard Smith081ad4d2017-01-24 19:39:46 +00003154.. option:: -fmodule-private, -fno-module-private
3155
Richard Smith081ad4d2017-01-24 19:39:46 +00003156.. option:: -fpack-derived, -fno-pack-derived
3157
Richard Smith081ad4d2017-01-24 19:39:46 +00003158.. option:: -fprotect-parens, -fno-protect-parens
3159
Richard Smith081ad4d2017-01-24 19:39:46 +00003160.. option:: -frange-check, -fno-range-check
3161
Richard Smith081ad4d2017-01-24 19:39:46 +00003162.. option:: -freal-4-real-10, -fno-real-4-real-10
3163
Richard Smith081ad4d2017-01-24 19:39:46 +00003164.. option:: -freal-4-real-16, -fno-real-4-real-16
3165
Richard Smith081ad4d2017-01-24 19:39:46 +00003166.. option:: -freal-4-real-8, -fno-real-4-real-8
3167
Richard Smith081ad4d2017-01-24 19:39:46 +00003168.. option:: -freal-8-real-10, -fno-real-8-real-10
3169
Richard Smith081ad4d2017-01-24 19:39:46 +00003170.. option:: -freal-8-real-16, -fno-real-8-real-16
3171
Richard Smith081ad4d2017-01-24 19:39:46 +00003172.. option:: -freal-8-real-4, -fno-real-8-real-4
3173
Richard Smith081ad4d2017-01-24 19:39:46 +00003174.. option:: -frealloc-lhs, -fno-realloc-lhs
3175
Richard Smith081ad4d2017-01-24 19:39:46 +00003176.. option:: -frecord-marker=<arg>
3177
Richard Smith081ad4d2017-01-24 19:39:46 +00003178.. option:: -frecursive, -fno-recursive
3179
Richard Smith081ad4d2017-01-24 19:39:46 +00003180.. option:: -frepack-arrays, -fno-repack-arrays
3181
Richard Smith081ad4d2017-01-24 19:39:46 +00003182.. option:: -fsecond-underscore, -fno-second-underscore
3183
Richard Smith081ad4d2017-01-24 19:39:46 +00003184.. option:: -fsign-zero, -fno-sign-zero
3185
Richard Smith081ad4d2017-01-24 19:39:46 +00003186.. option:: -fstack-arrays, -fno-stack-arrays
3187
Richard Smith081ad4d2017-01-24 19:39:46 +00003188.. option:: -funderscoring, -fno-underscoring
3189
Richard Smith081ad4d2017-01-24 19:39:46 +00003190.. option:: -fwhole-file, -fno-whole-file
3191
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003192.. option:: -imultilib <arg>
3193
Richard Smith081ad4d2017-01-24 19:39:46 +00003194.. option:: -nocpp
3195
Richard Smith081ad4d2017-01-24 19:39:46 +00003196.. option:: -static-libgfortran
3197
Richard Smithc5b2e002017-01-27 02:08:37 +00003198Linker flags
3199============
3200Flags that are passed on to the linker
3201
3202.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3203
3204Add directory to library search path
3205
3206.. option:: -Mach
3207
3208.. option:: -T<script>
3209
3210Specify <script> as linker script
3211
Richard Smith78e23fd2017-04-13 22:39:49 +00003212.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003213
3214Set starting address of BSS to <addr>
3215
Richard Smith78e23fd2017-04-13 22:39:49 +00003216.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003217
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003218Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003219
Richard Smith78e23fd2017-04-13 22:39:49 +00003220.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003221
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003222Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003223
3224.. option:: -Wl,<arg>,<arg2>...
3225
3226Pass the comma separated arguments in <arg> to the linker
3227
3228.. option:: -X
3229
3230.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3231
3232Pass <arg> to the linker
3233
3234.. program:: clang1
3235.. option:: -Z
3236.. program:: clang
3237
3238.. option:: -e<arg>, --entry
3239
3240.. option:: -filelist <arg>
3241
Vedant Kumar368540f2018-08-23 17:55:03 +00003242.. option:: --hip-device-lib-path=<arg>
3243
3244HIP device library path
3245
3246.. option:: --hip-device-lib=<arg>
3247
3248HIP device library
3249
Richard Smithc5b2e002017-01-27 02:08:37 +00003250.. option:: -l<arg>
3251
3252.. option:: -r
3253
3254.. option:: -rpath <arg>
3255
3256.. option:: -s
3257
3258.. option:: -t
3259
3260.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3261
3262.. option:: -undef
3263
3264undef all system defines
3265
3266.. option:: -undefined<arg>, --no-undefined
3267
3268.. option:: -z <arg>
3269
3270Pass -z <arg> to the linker
3271