blob: b7f94e98d494607dbfb7241baa07d2b5a4aa259d [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:: --analyze-auto
90
Richard Smith081ad4d2017-01-24 19:39:46 +000091.. option:: --analyzer-no-default-checks
92
Richard Smith081ad4d2017-01-24 19:39:46 +000093.. option:: --analyzer-output<arg>
94
95Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text).
96
Richard Smith081ad4d2017-01-24 19:39:46 +000097.. option:: -ansi, --ansi
98
Richard Smith081ad4d2017-01-24 19:39:46 +000099.. option:: -arch <arg>
100
Richard Smithb2c82a62017-01-27 01:54:42 +0000101.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000102.. option:: -arch\_errors\_fatal
Richard Smithb2c82a62017-01-27 01:54:42 +0000103.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000104
Richard Smithb2c82a62017-01-27 01:54:42 +0000105.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000106.. option:: -arch\_only <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000107.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000108
Richard Smith081ad4d2017-01-24 19:39:46 +0000109.. option:: -arcmt-migrate-emit-errors
110
111Emit ARC errors even if the migrator can fix them
112
Richard Smith081ad4d2017-01-24 19:39:46 +0000113.. option:: -arcmt-migrate-report-output <arg>
114
115Output path for the plist report
116
Craig Topperd23254a2017-07-20 17:52:48 +0000117.. option:: --autocomplete=<arg>
118
Richard Smith081ad4d2017-01-24 19:39:46 +0000119.. option:: -bind\_at\_load
120
Richard Smith081ad4d2017-01-24 19:39:46 +0000121.. option:: -bundle
122
Richard Smithb2c82a62017-01-27 01:54:42 +0000123.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000124.. option:: -bundle\_loader <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000125.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000126
Craig Topper596527b2018-01-23 18:40:15 +0000127.. option:: -cfguard
128
129Emit tables required for Windows Control Flow Guard.
130
Richard Smith081ad4d2017-01-24 19:39:46 +0000131.. option:: -client\_name<arg>
132
Richard Smith081ad4d2017-01-24 19:39:46 +0000133.. option:: -compatibility\_version<arg>
134
Craig Topper287c8012018-01-03 18:29:12 +0000135.. option:: --config <arg>
136
137Specifies configuration file
138
Richard Smith081ad4d2017-01-24 19:39:46 +0000139.. option:: --constant-cfstrings
140
Richard Smith081ad4d2017-01-24 19:39:46 +0000141.. option:: -coverage, --coverage
142
Richard Smith081ad4d2017-01-24 19:39:46 +0000143.. option:: --cuda-compile-host-device
144
145Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations.
146
Richard Smith081ad4d2017-01-24 19:39:46 +0000147.. option:: --cuda-device-only
148
149Compile CUDA code for device only
150
Richard Smith081ad4d2017-01-24 19:39:46 +0000151.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
152
153CUDA GPU architecture (e.g. sm\_35). May be specified more than once.
154
Richard Smith081ad4d2017-01-24 19:39:46 +0000155.. option:: --cuda-host-only
156
157Compile CUDA code for host only. Has no effect on non-CUDA compilations.
158
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000159.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg>
160
Sylvestre Ledru90f1dfb2019-01-01 12:51:14 +0000161Include 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 +0000162
Richard Smith081ad4d2017-01-24 19:39:46 +0000163.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
164
165Enable device-side debug info generation. Disables ptxas optimizations.
166
Richard Smith081ad4d2017-01-24 19:39:46 +0000167.. option:: -current\_version<arg>
168
Richard Smith081ad4d2017-01-24 19:39:46 +0000169.. option:: -dead\_strip
170
Richard Smith081ad4d2017-01-24 19:39:46 +0000171.. option:: -dependency-dot <arg>
172
173Filename to write DOT-formatted header dependencies to
174
Richard Smith081ad4d2017-01-24 19:39:46 +0000175.. option:: -dependency-file <arg>
176
177Filename (or -) to write dependency output to
178
Richard Smith081ad4d2017-01-24 19:39:46 +0000179.. option:: -dumpmachine
180
Richard Smith081ad4d2017-01-24 19:39:46 +0000181.. option:: -dumpversion
182
Richard Smith081ad4d2017-01-24 19:39:46 +0000183.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
184
Richard Smith081ad4d2017-01-24 19:39:46 +0000185.. option:: -dylib\_file <arg>
186
Richard Smith081ad4d2017-01-24 19:39:46 +0000187.. option:: -dylinker
188
Richard Smithb2c82a62017-01-27 01:54:42 +0000189.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000190.. option:: -dylinker\_install\_name<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000191.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000192
Richard Smith081ad4d2017-01-24 19:39:46 +0000193.. option:: -dynamic
194
Richard Smith081ad4d2017-01-24 19:39:46 +0000195.. option:: -dynamiclib
196
Richard Smith081ad4d2017-01-24 19:39:46 +0000197.. option:: -emit-ast
198
199Emit Clang AST files for source inputs
200
Richard Smith081ad4d2017-01-24 19:39:46 +0000201.. option:: -exported\_symbols\_list <arg>
202
Richard Smith081ad4d2017-01-24 19:39:46 +0000203.. option:: -faligned-new=<arg>
204
Richard Smith081ad4d2017-01-24 19:39:46 +0000205.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
206
207Use approximate transcendental functions
208
Richard Smith081ad4d2017-01-24 19:39:46 +0000209.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
210
211Flush denormal floating point values to zero in CUDA device mode.
212
Craig Topper42da9cb2018-04-23 21:41:06 +0000213.. option:: -fcuda-rdc, -fno-cuda-rdc
214
215Generate relocatable device code, also known as separate compilation mode.
216
Vedant Kumar368540f2018-08-23 17:55:03 +0000217.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
218
219Use 32-bit pointers for accessing const/local/shared address spaces.
220
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000221.. option:: -ffixed-r19
222
Vedant Kumar368540f2018-08-23 17:55:03 +0000223Reserve register r19 (Hexagon only)
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000224
Richard Smith081ad4d2017-01-24 19:39:46 +0000225.. option:: -fheinous-gnu-extensions
226
Richard Smith081ad4d2017-01-24 19:39:46 +0000227.. option:: -flat\_namespace
228
Richard Smith081ad4d2017-01-24 19:39:46 +0000229.. option:: -fopenmp-targets=<arg1>,<arg2>...
230
231Specify comma-separated list of triples OpenMP offloading targets to be supported
232
Richard Smith081ad4d2017-01-24 19:39:46 +0000233.. option:: -force\_cpusubtype\_ALL
234
Richard Smithb2c82a62017-01-27 01:54:42 +0000235.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000236.. option:: -force\_flat\_namespace
Richard Smithb2c82a62017-01-27 01:54:42 +0000237.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000238
Richard Smithb2c82a62017-01-27 01:54:42 +0000239.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000240.. option:: -force\_load <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000241.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000242
Richard Smith081ad4d2017-01-24 19:39:46 +0000243.. option:: -framework <arg>
244
Richard Smith78e23fd2017-04-13 22:39:49 +0000245.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
246
247Add -rpath with architecture-specific resource directory to the linker flags
248
Richard Smith081ad4d2017-01-24 19:39:46 +0000249.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
250
251Use the gcc toolchain at the given directory
252
Richard Smith081ad4d2017-01-24 19:39:46 +0000253.. option:: -gcodeview
254
255Generate CodeView debug information
256
Richard Smith081ad4d2017-01-24 19:39:46 +0000257.. option:: -headerpad\_max\_install\_names<arg>
258
Richard Smith081ad4d2017-01-24 19:39:46 +0000259.. option:: -help, --help
260
261Display available options
262
Richard Smith081ad4d2017-01-24 19:39:46 +0000263.. option:: --help-hidden
264
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000265Display help for hidden options
266
Vedant Kumar368540f2018-08-23 17:55:03 +0000267.. option:: --hip-link
268
269Link clang-offload-bundler bundles for HIP
270
Richard Smith081ad4d2017-01-24 19:39:46 +0000271.. option:: -image\_base <arg>
272
Richard Smith081ad4d2017-01-24 19:39:46 +0000273.. option:: -index-header-map
274
275Make the next included directory (-I or -F) an indexer header map
276
Richard Smith081ad4d2017-01-24 19:39:46 +0000277.. option:: -init <arg>
278
Richard Smith081ad4d2017-01-24 19:39:46 +0000279.. option:: -install\_name <arg>
280
Richard Smith081ad4d2017-01-24 19:39:46 +0000281.. option:: -keep\_private\_externs
282
Richard Smith081ad4d2017-01-24 19:39:46 +0000283.. option:: -lazy\_framework <arg>
284
Richard Smithb2c82a62017-01-27 01:54:42 +0000285.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000286.. option:: -lazy\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000287.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000288
Richard Smith081ad4d2017-01-24 19:39:46 +0000289.. option:: -mbig-endian, -EB
290
Richard Smith081ad4d2017-01-24 19:39:46 +0000291.. option:: --migrate
292
293Run the migrator
294
Richard Smith78e23fd2017-04-13 22:39:49 +0000295.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
296
Richard Smith081ad4d2017-01-24 19:39:46 +0000297.. option:: -mlinker-version=<arg>
298
Richard Smith081ad4d2017-01-24 19:39:46 +0000299.. option:: -mlittle-endian, -EL
300
Richard Smith081ad4d2017-01-24 19:39:46 +0000301.. option:: -mllvm <arg>
302
303Additional arguments to forward to LLVM's option processing
304
Richard Smith081ad4d2017-01-24 19:39:46 +0000305.. option:: -module-dependency-dir <arg>
306
307Directory to dump module dependencies to
308
Richard Smith78e23fd2017-04-13 22:39:49 +0000309.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
310
Richard Smith081ad4d2017-01-24 19:39:46 +0000311.. option:: -multi\_module
312
Richard Smith081ad4d2017-01-24 19:39:46 +0000313.. option:: -multiply\_defined <arg>
314
Richard Smithb2c82a62017-01-27 01:54:42 +0000315.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000316.. option:: -multiply\_defined\_unused <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000317.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000318
Richard Smith78e23fd2017-04-13 22:39:49 +0000319.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
320
Richard Smith081ad4d2017-01-24 19:39:46 +0000321.. option:: --no-cuda-version-check
322
323Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
324
Richard Smith081ad4d2017-01-24 19:39:46 +0000325.. option:: -no-integrated-cpp, --no-integrated-cpp
326
Richard Smith081ad4d2017-01-24 19:39:46 +0000327.. option:: -no\_dead\_strip\_inits\_and\_terms
328
Richard Smith081ad4d2017-01-24 19:39:46 +0000329.. option:: -nobuiltininc
330
331Disable builtin #include directories
332
Richard Smith081ad4d2017-01-24 19:39:46 +0000333.. option:: -nocudainc
334
Richard Smith081ad4d2017-01-24 19:39:46 +0000335.. option:: -nocudalib
336
Richard Smith081ad4d2017-01-24 19:39:46 +0000337.. option:: -nodefaultlibs
338
Richard Smith081ad4d2017-01-24 19:39:46 +0000339.. option:: -nofixprebinding
340
Richard Smith081ad4d2017-01-24 19:39:46 +0000341.. option:: -nolibc
342
Richard Smith081ad4d2017-01-24 19:39:46 +0000343.. option:: -nomultidefs
344
Craig Topperd23254a2017-07-20 17:52:48 +0000345.. option:: -nopie, -no-pie
Richard Smith081ad4d2017-01-24 19:39:46 +0000346
Richard Smith081ad4d2017-01-24 19:39:46 +0000347.. option:: -noprebind
348
Richard Smith081ad4d2017-01-24 19:39:46 +0000349.. option:: -noseglinkedit
350
Richard Smith081ad4d2017-01-24 19:39:46 +0000351.. option:: -nostartfiles
352
Richard Smith081ad4d2017-01-24 19:39:46 +0000353.. option:: -nostdinc, --no-standard-includes
354
Richard Smithb2c82a62017-01-27 01:54:42 +0000355.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000356.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000357.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000358
359Disable standard #include directories for the C++ standard library
360
Richard Smith081ad4d2017-01-24 19:39:46 +0000361.. option:: -nostdlib, --no-standard-libraries
362
Boris Kolpackovb150d242017-08-30 09:15:53 +0000363.. program:: clang1
364.. option:: -nostdlib++
365.. program:: clang
366
Richard Smith081ad4d2017-01-24 19:39:46 +0000367.. option:: -nostdlibinc
368
Richard Smith081ad4d2017-01-24 19:39:46 +0000369.. option:: -o<file>, --output <arg>, --output=<arg>
370
371Write output to <file>
372
Richard Smith081ad4d2017-01-24 19:39:46 +0000373.. option:: -objcmt-atomic-property
374
375Make migration to 'atomic' properties
376
Richard Smith081ad4d2017-01-24 19:39:46 +0000377.. option:: -objcmt-migrate-all
378
379Enable migration to modern ObjC
380
Richard Smith081ad4d2017-01-24 19:39:46 +0000381.. option:: -objcmt-migrate-annotation
382
383Enable migration to property and method annotations
384
Richard Smith081ad4d2017-01-24 19:39:46 +0000385.. option:: -objcmt-migrate-designated-init
386
387Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
388
Richard Smith081ad4d2017-01-24 19:39:46 +0000389.. option:: -objcmt-migrate-instancetype
390
391Enable migration to infer instancetype for method result type
392
Richard Smith081ad4d2017-01-24 19:39:46 +0000393.. option:: -objcmt-migrate-literals
394
395Enable migration to modern ObjC literals
396
Richard Smith081ad4d2017-01-24 19:39:46 +0000397.. option:: -objcmt-migrate-ns-macros
398
399Enable migration to NS\_ENUM/NS\_OPTIONS macros
400
Richard Smith081ad4d2017-01-24 19:39:46 +0000401.. option:: -objcmt-migrate-property
402
403Enable migration to modern ObjC property
404
Richard Smith081ad4d2017-01-24 19:39:46 +0000405.. option:: -objcmt-migrate-property-dot-syntax
406
407Enable migration of setter/getter messages to property-dot syntax
408
Richard Smith081ad4d2017-01-24 19:39:46 +0000409.. option:: -objcmt-migrate-protocol-conformance
410
411Enable migration to add protocol conformance on classes
412
Richard Smith081ad4d2017-01-24 19:39:46 +0000413.. option:: -objcmt-migrate-readonly-property
414
415Enable migration to modern ObjC readonly property
416
Richard Smith081ad4d2017-01-24 19:39:46 +0000417.. option:: -objcmt-migrate-readwrite-property
418
419Enable migration to modern ObjC readwrite property
420
Richard Smith081ad4d2017-01-24 19:39:46 +0000421.. option:: -objcmt-migrate-subscripting
422
423Enable migration to modern ObjC subscripting
424
Richard Smith081ad4d2017-01-24 19:39:46 +0000425.. option:: -objcmt-ns-nonatomic-iosonly
426
427Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
428
Richard Smith081ad4d2017-01-24 19:39:46 +0000429.. option:: -objcmt-returns-innerpointer-property
430
431Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
432
Richard Smith081ad4d2017-01-24 19:39:46 +0000433.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
434
435Only modify files with a filename contained in the provided directory path
436
Richard Smith081ad4d2017-01-24 19:39:46 +0000437.. option:: -object
438
Richard Smith081ad4d2017-01-24 19:39:46 +0000439.. option:: -p, --profile
440
Richard Smith081ad4d2017-01-24 19:39:46 +0000441.. option:: -pagezero\_size<arg>
442
Richard Smith081ad4d2017-01-24 19:39:46 +0000443.. option:: -pg
444
445Enable mcount instrumentation
446
Richard Smith081ad4d2017-01-24 19:39:46 +0000447.. option:: -pie
448
Richard Smith081ad4d2017-01-24 19:39:46 +0000449.. option:: -pipe, --pipe
450
451Use pipes between commands, when possible
452
Richard Smith081ad4d2017-01-24 19:39:46 +0000453.. option:: -prebind
454
Richard Smithb2c82a62017-01-27 01:54:42 +0000455.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000456.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000457.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000458
Richard Smith081ad4d2017-01-24 19:39:46 +0000459.. option:: -preload
460
Richard Smith081ad4d2017-01-24 19:39:46 +0000461.. option:: --print-diagnostic-categories
462
Vedant Kumar368540f2018-08-23 17:55:03 +0000463.. option:: -print-effective-triple, --print-effective-triple
464
465Print the effective target triple
466
Richard Smith081ad4d2017-01-24 19:39:46 +0000467.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
468
469Print the full library path of <file>
470
Richard Smith081ad4d2017-01-24 19:39:46 +0000471.. option:: -print-ivar-layout
472
473Enable Objective-C Ivar layout bitmap print trace
474
Richard Smith081ad4d2017-01-24 19:39:46 +0000475.. option:: -print-libgcc-file-name, --print-libgcc-file-name
476
477Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
478
Richard Smith081ad4d2017-01-24 19:39:46 +0000479.. option:: -print-multi-directory, --print-multi-directory
480
Richard Smith081ad4d2017-01-24 19:39:46 +0000481.. option:: -print-multi-lib, --print-multi-lib
482
Richard Smith081ad4d2017-01-24 19:39:46 +0000483.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
484
485Print the full program path of <name>
486
Richard Smith78e23fd2017-04-13 22:39:49 +0000487.. option:: -print-resource-dir, --print-resource-dir
488
489Print the resource directory pathname
490
Richard Smith081ad4d2017-01-24 19:39:46 +0000491.. option:: -print-search-dirs, --print-search-dirs
492
493Print the paths used for finding libraries and programs
494
Vedant Kumar368540f2018-08-23 17:55:03 +0000495.. option:: -print-target-triple, --print-target-triple
496
497Print the normalized target triple
498
Richard Smith081ad4d2017-01-24 19:39:46 +0000499.. option:: -private\_bundle
500
Richard Smith081ad4d2017-01-24 19:39:46 +0000501.. option:: -pthread, -no-pthread
502
503Support POSIX threads in generated code
504
Richard Smith081ad4d2017-01-24 19:39:46 +0000505.. option:: -pthreads
506
Richard Smith081ad4d2017-01-24 19:39:46 +0000507.. option:: -rdynamic
508
Richard Smith081ad4d2017-01-24 19:39:46 +0000509.. option:: -read\_only\_relocs <arg>
510
Richard Smith081ad4d2017-01-24 19:39:46 +0000511.. option:: -relocatable-pch, --relocatable-pch
512
513Whether to build a relocatable precompiled header
514
Richard Smith081ad4d2017-01-24 19:39:46 +0000515.. option:: -remap
516
Richard Smith081ad4d2017-01-24 19:39:46 +0000517.. option:: -rewrite-legacy-objc
518
519Rewrite Legacy Objective-C source to C++
520
Richard Smith081ad4d2017-01-24 19:39:46 +0000521.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
522
523Compiler runtime library to use
524
Richard Smith081ad4d2017-01-24 19:39:46 +0000525.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
526
527Save llvm statistics.
528
Richard Smith081ad4d2017-01-24 19:39:46 +0000529.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
530
531Save intermediate compilation results.
532
Richard Smith081ad4d2017-01-24 19:39:46 +0000533.. option:: -sectalign <arg1> <arg2> <arg3>
534
Richard Smith081ad4d2017-01-24 19:39:46 +0000535.. option:: -sectcreate <arg1> <arg2> <arg3>
536
Richard Smith081ad4d2017-01-24 19:39:46 +0000537.. option:: -sectobjectsymbols <arg1> <arg2>
538
Richard Smith081ad4d2017-01-24 19:39:46 +0000539.. option:: -sectorder <arg1> <arg2> <arg3>
540
Richard Smith081ad4d2017-01-24 19:39:46 +0000541.. option:: -seg1addr<arg>
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -seg\_addr\_table <arg>
544
Richard Smithb2c82a62017-01-27 01:54:42 +0000545.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000546.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000547.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000548
Richard Smith081ad4d2017-01-24 19:39:46 +0000549.. option:: -segaddr <arg1> <arg2>
550
Richard Smith081ad4d2017-01-24 19:39:46 +0000551.. option:: -segcreate <arg1> <arg2> <arg3>
552
Richard Smith081ad4d2017-01-24 19:39:46 +0000553.. option:: -seglinkedit
554
Richard Smith081ad4d2017-01-24 19:39:46 +0000555.. option:: -segprot <arg1> <arg2> <arg3>
556
Richard Smith081ad4d2017-01-24 19:39:46 +0000557.. option:: -segs\_read\_<arg>
558
Richard Smithb2c82a62017-01-27 01:54:42 +0000559.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000560.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000561.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000562
Richard Smithb2c82a62017-01-27 01:54:42 +0000563.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000564.. option:: -segs\_read\_write\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000565.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000566
Richard Smith081ad4d2017-01-24 19:39:46 +0000567.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
568
569Serialize compiler diagnostics to a file
570
Richard Smith081ad4d2017-01-24 19:39:46 +0000571.. option:: -shared, --shared
572
Richard Smith081ad4d2017-01-24 19:39:46 +0000573.. option:: -shared-libgcc
574
Craig Topper16418662017-11-20 18:07:43 +0000575.. option:: -shared-libsan, -shared-libasan
576
Vedant Kumar368540f2018-08-23 17:55:03 +0000577Dynamically link the sanitizer runtime
578
Richard Smith081ad4d2017-01-24 19:39:46 +0000579.. option:: -single\_module
580
Richard Smith081ad4d2017-01-24 19:39:46 +0000581.. option:: -specs=<arg>, --specs=<arg>
582
Richard Smith081ad4d2017-01-24 19:39:46 +0000583.. option:: -static, --static
584
Richard Smith081ad4d2017-01-24 19:39:46 +0000585.. option:: -static-libgcc
586
Craig Topper16418662017-11-20 18:07:43 +0000587.. option:: -static-libsan
588
Vedant Kumar368540f2018-08-23 17:55:03 +0000589Statically link the sanitizer runtime
590
Richard Smith081ad4d2017-01-24 19:39:46 +0000591.. option:: -static-libstdc++
592
Richard Smith081ad4d2017-01-24 19:39:46 +0000593.. option:: -std-default=<arg>
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
596
597C++ standard library to use
598
Richard Smith081ad4d2017-01-24 19:39:46 +0000599.. option:: -sub\_library<arg>
600
Richard Smithb2c82a62017-01-27 01:54:42 +0000601.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000602.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000603.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000604
Richard Smith081ad4d2017-01-24 19:39:46 +0000605.. option:: --sysroot=<arg>, --sysroot <arg>
606
Richard Smith081ad4d2017-01-24 19:39:46 +0000607.. option:: --target-help
608
Richard Smith081ad4d2017-01-24 19:39:46 +0000609.. option:: --target=<arg>, -target <arg>
610
611Generate code for the given target
612
Ziang Wanaf857b92019-06-14 21:42:21 +0000613.. option:: --print-supported-cpus
614
615Print supported cpu models for the given target
616
Richard Smith081ad4d2017-01-24 19:39:46 +0000617.. option:: -time
618
619Time individual commands
620
Richard Smith081ad4d2017-01-24 19:39:46 +0000621.. option:: -traditional, --traditional
622
Richard Smith081ad4d2017-01-24 19:39:46 +0000623.. option:: -traditional-cpp, --traditional-cpp
624
625Enable some traditional CPP emulation
626
Richard Smith081ad4d2017-01-24 19:39:46 +0000627.. option:: -twolevel\_namespace
628
Richard Smithb2c82a62017-01-27 01:54:42 +0000629.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000630.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000631.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000632
Richard Smith081ad4d2017-01-24 19:39:46 +0000633.. option:: -umbrella <arg>
634
Richard Smith081ad4d2017-01-24 19:39:46 +0000635.. option:: -unexported\_symbols\_list <arg>
636
Richard Smith081ad4d2017-01-24 19:39:46 +0000637.. option:: -v, --verbose
638
639Show commands to run and use verbose output
640
Richard Smith081ad4d2017-01-24 19:39:46 +0000641.. option:: --verify-debug-info
642
643Verify the binary representation of debug output
644
Richard Smith081ad4d2017-01-24 19:39:46 +0000645.. option:: --version
646
Craig Topper16418662017-11-20 18:07:43 +0000647Print version information
648
Richard Smith081ad4d2017-01-24 19:39:46 +0000649.. option:: -w, --no-warnings
650
651Suppress all warnings
652
Richard Smith081ad4d2017-01-24 19:39:46 +0000653.. option:: -weak-l<arg>
654
Richard Smith081ad4d2017-01-24 19:39:46 +0000655.. option:: -weak\_framework <arg>
656
Richard Smithb2c82a62017-01-27 01:54:42 +0000657.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000658.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000659.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000660
Richard Smithb2c82a62017-01-27 01:54:42 +0000661.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000662.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000663.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000664
Richard Smith081ad4d2017-01-24 19:39:46 +0000665.. option:: -whatsloaded
666
Richard Smith081ad4d2017-01-24 19:39:46 +0000667.. option:: -whyload
668
Richard Smith081ad4d2017-01-24 19:39:46 +0000669.. option:: -working-directory<arg>, -working-directory=<arg>
670
671Resolve file paths relative to the specified directory
672
Richard Smith081ad4d2017-01-24 19:39:46 +0000673.. option:: -x<language>, --language <arg>, --language=<arg>
674
675Treat subsequent input files as having type <language>
676
Richard Smith081ad4d2017-01-24 19:39:46 +0000677.. option:: -y<arg>
678
679Actions
680=======
681The action to perform on the input.
682
Richard Smith081ad4d2017-01-24 19:39:46 +0000683.. option:: -E, --preprocess
684
685Only run the preprocessor
686
Richard Smith081ad4d2017-01-24 19:39:46 +0000687.. option:: -S, --assemble
688
689Only run preprocess and compilation steps
690
Richard Smithc5b2e002017-01-27 02:08:37 +0000691.. option:: -c, --compile
692
693Only run preprocess, compile, and assemble steps
694
Richard Smith081ad4d2017-01-24 19:39:46 +0000695.. option:: -emit-llvm
696
697Use the LLVM representation for assembler and object files
698
Richard Smith081ad4d2017-01-24 19:39:46 +0000699.. option:: -fsyntax-only
700
Richard Smith081ad4d2017-01-24 19:39:46 +0000701.. option:: -module-file-info
702
703Provide information about a particular module file
704
Richard Smith081ad4d2017-01-24 19:39:46 +0000705.. option:: --precompile
706
707Only precompile the input
708
Richard Smith081ad4d2017-01-24 19:39:46 +0000709.. option:: -rewrite-objc
710
711Rewrite Objective-C source to C++
712
Richard Smith081ad4d2017-01-24 19:39:46 +0000713.. option:: -verify-pch
714
715Load and verify that a pre-compiled header file is not stale
716
717Compilation flags
718=================
719
720Flags controlling the behavior of Clang during compilation. These flags have
721no effect during actions that do not perform compilation.
722
Richard Smithc5b2e002017-01-27 02:08:37 +0000723.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000724
Richard Smithc5b2e002017-01-27 02:08:37 +0000725Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000726
Richard Smith081ad4d2017-01-24 19:39:46 +0000727.. option:: -Xclang <arg>
728
729Pass <arg> to the clang compiler
730
Boris Kolpackovb150d242017-08-30 09:15:53 +0000731.. option:: -fclang-abi-compat=<version>
732
733Attempt to match the ABI of Clang <version>
734
Richard Smith081ad4d2017-01-24 19:39:46 +0000735.. option:: -fcomment-block-commands=<arg>,<arg2>...
736
737Treat each comma separated argument in <arg> as a documentation comment block command
738
Vedant Kumar368540f2018-08-23 17:55:03 +0000739.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
740
741Require member pointer base types to be complete if they would be significant under the Microsoft ABI
742
743.. option:: -fcrash-diagnostics-dir=<arg>
744
Richard Smith081ad4d2017-01-24 19:39:46 +0000745.. option:: -fdeclspec, -fno-declspec
746
747Allow \_\_declspec as a keyword
748
Richard Smith081ad4d2017-01-24 19:39:46 +0000749.. option:: -fdepfile-entry=<arg>
750
Richard Smith081ad4d2017-01-24 19:39:46 +0000751.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
752
Richard Smith081ad4d2017-01-24 19:39:46 +0000753.. option:: -fdiagnostics-format=<arg>
754
Richard Smith081ad4d2017-01-24 19:39:46 +0000755.. option:: -fdiagnostics-parseable-fixits
756
757Print fix-its in machine parseable form
758
Richard Smith081ad4d2017-01-24 19:39:46 +0000759.. option:: -fdiagnostics-print-source-range-info
760
761Print source range spans in numeric form
762
Richard Smith081ad4d2017-01-24 19:39:46 +0000763.. option:: -fdiagnostics-show-category=<arg>
764
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000765.. option:: -fdiscard-value-names, -fno-discard-value-names
766
767Discard value names in LLVM IR
768
769.. option:: -fexperimental-isel, -fno-experimental-isel
770
771Enables the experimental global instruction selector
772
Richard Smith081ad4d2017-01-24 19:39:46 +0000773.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
774
775Enables an experimental new pass manager in LLVM.
776
Craig Topper16418662017-11-20 18:07:43 +0000777.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
778
Vedant Kumar368540f2018-08-23 17:55:03 +0000779Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Craig Topper16418662017-11-20 18:07:43 +0000780
Richard Smith081ad4d2017-01-24 19:39:46 +0000781.. option:: -finline-functions, -fno-inline-functions
782
783Inline suitable functions
784
Richard Smith081ad4d2017-01-24 19:39:46 +0000785.. option:: -finline-hint-functions
786
787Inline functions which are (explicitly or implicitly) marked inline
788
Richard Smith081ad4d2017-01-24 19:39:46 +0000789.. option:: -fno-crash-diagnostics
790
Richard Smith78e23fd2017-04-13 22:39:49 +0000791Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
792
Richard Smith081ad4d2017-01-24 19:39:46 +0000793.. option:: -fno-sanitize-blacklist
794
795Don't use blacklist file for sanitizers
796
Richard Smith081ad4d2017-01-24 19:39:46 +0000797.. option:: -fparse-all-comments
798
Scott Linderde6beb02018-12-14 15:38:15 +0000799.. option:: -frecord-command-line, -frecord-gcc-switches, -fno-record-command-line, -fno-record-gcc-switches
800
801Generate a section named ".GCC.command.line" containing the clang driver
802command-line. After linking, the section may contain multiple command lines,
803which will be individually terminated by null bytes. Separate arguments within
804a command line are combined with spaces; spaces and backslashes within an
805argument are escaped with backslashes. This format differs from the format of
806the equivalent section produced by GCC with the -frecord-gcc-switches flag.
807This option is currently only supported on ELF targets.
808
Richard Smith081ad4d2017-01-24 19:39:46 +0000809.. option:: -fsanitize-address-field-padding=<arg>
810
811Level of field padding for AddressSanitizer
812
Craig Topperd23254a2017-07-20 17:52:48 +0000813.. option:: -fsanitize-address-globals-dead-stripping
814
815Enable linker dead stripping of globals in AddressSanitizer
816
Vitaly Buka8076c572018-12-05 01:44:31 +0000817.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
818
819Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
820
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000821.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000822
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000823Enable "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.
824
825An 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 +0000826
Richard Smith081ad4d2017-01-24 19:39:46 +0000827.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
828
829Enable use-after-scope detection in AddressSanitizer
830
Richard Smith081ad4d2017-01-24 19:39:46 +0000831.. option:: -fsanitize-blacklist=<arg>
832
833Path to blacklist file for sanitizers
834
Richard Smith081ad4d2017-01-24 19:39:46 +0000835.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
836
837Enable control flow integrity (CFI) checks for cross-DSO calls.
838
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000839.. option:: -fsanitize-cfi-icall-generalize-pointers
840
Craig Topper16418662017-11-20 18:07:43 +0000841Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000842
Richard Smith081ad4d2017-01-24 19:39:46 +0000843.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
844
845Specify the type of coverage instrumentation for Sanitizers
846
Richard Smith081ad4d2017-01-24 19:39:46 +0000847.. option:: -fsanitize-link-c++-runtime
848
Richard Smith081ad4d2017-01-24 19:39:46 +0000849.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
850
851Enable origins tracking in MemorySanitizer
852
Richard Smithb2c82a62017-01-27 01:54:42 +0000853.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000854.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000855.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000856
857Enable origins tracking in MemorySanitizer
858
Craig Topper16418662017-11-20 18:07:43 +0000859.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000860
861Enable use-after-destroy detection in MemorySanitizer
862
Boris Kolpackovb150d242017-08-30 09:15:53 +0000863.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
864
Richard Smith081ad4d2017-01-24 19:39:46 +0000865.. option:: -fsanitize-recover, -fno-sanitize-recover
866
Richard Smithb2c82a62017-01-27 01:54:42 +0000867.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000868.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +0000869.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000870
871Enable recovery for specified sanitizers
872
Richard Smith081ad4d2017-01-24 19:39:46 +0000873.. option:: -fsanitize-stats, -fno-sanitize-stats
874
875Enable sanitizer statistics gathering.
876
Richard Smith081ad4d2017-01-24 19:39:46 +0000877.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
878
879Enable atomic operations instrumentation in ThreadSanitizer (default)
880
Richard Smith081ad4d2017-01-24 19:39:46 +0000881.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
882
883Enable function entry/exit instrumentation in ThreadSanitizer (default)
884
Richard Smith081ad4d2017-01-24 19:39:46 +0000885.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
886
887Enable memory access instrumentation in ThreadSanitizer (default)
888
Richard Smith081ad4d2017-01-24 19:39:46 +0000889.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
890
891Enable trapping for specified sanitizers
892
Richard Smith081ad4d2017-01-24 19:39:46 +0000893.. option:: -fsanitize-undefined-strip-path-components=<number>
894
895Strip (or keep only, if negative) a given number of path components when emitting check metadata.
896
Richard Smith081ad4d2017-01-24 19:39:46 +0000897.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
898
Richard Smith081ad4d2017-01-24 19:39:46 +0000899.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
900
901Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
902
Vedant Kumar368540f2018-08-23 17:55:03 +0000903.. option:: -moutline, -mno-outline
904
905Enable function outlining (AArch64 only)
906
Richard Smith081ad4d2017-01-24 19:39:46 +0000907.. option:: --param <arg>, --param=<arg>
908
Richard Smith081ad4d2017-01-24 19:39:46 +0000909.. option:: -std=<arg>, --std=<arg>, --std <arg>
910
911Language standard to compile for
912
Richard Smithc5b2e002017-01-27 02:08:37 +0000913Preprocessor flags
914~~~~~~~~~~~~~~~~~~
915
916Flags controlling the behavior of the Clang preprocessor.
917
918.. option:: -C, --comments
919
920Include comments in preprocessed output
921
922.. option:: -CC, --comments-in-macros
923
924Include comments from within macros in preprocessed output
925
926.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
927
928Define <macro> to <value> (or 1 if <value> omitted)
929
930.. option:: -H, --trace-includes
931
932Show header includes and nesting depth
933
934.. option:: -P, --no-line-commands
935
936Disable linemarker output in -E mode
937
938.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
939
940Undefine macro <macro>
941
942.. option:: -Wp,<arg>,<arg2>...
943
944Pass the comma separated arguments in <arg> to the preprocessor
945
946.. option:: -Xpreprocessor <arg>
947
948Pass <arg> to the preprocessor
949
Richard Smith081ad4d2017-01-24 19:39:46 +0000950Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +0000951-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +0000952
953Flags controlling how ``#include``\s are resolved to files.
954
Richard Smithc5b2e002017-01-27 02:08:37 +0000955.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000956
957Add directory to include search path
958
Richard Smith081ad4d2017-01-24 19:39:46 +0000959.. option:: -I-, --include-barrier
960
Richard Smithc5b2e002017-01-27 02:08:37 +0000961Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
962
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000963.. option:: --cuda-path-ignore-env
964
965Ignore environment variables to detect CUDA installation
966
Richard Smith081ad4d2017-01-24 19:39:46 +0000967.. option:: --cuda-path=<arg>
968
969CUDA installation path
970
Richard Smith081ad4d2017-01-24 19:39:46 +0000971.. option:: -cxx-isystem<directory>
972
973Add directory to the C++ SYSTEM include search path
974
Richard Smith081ad4d2017-01-24 19:39:46 +0000975.. option:: -fbuild-session-file=<file>
976
977Use the last modification time of <file> as the build session timestamp
978
Richard Smith081ad4d2017-01-24 19:39:46 +0000979.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
980
981Time when the current build session started
982
Boris Kolpackovb150d242017-08-30 09:15:53 +0000983.. option:: -fmodule-file=\[<name>=\]<file>
984
985Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
986
Richard Smith081ad4d2017-01-24 19:39:46 +0000987.. option:: -fmodules-cache-path=<directory>
988
989Specify the module cache path
990
Richard Smith081ad4d2017-01-24 19:39:46 +0000991.. option:: -fmodules-disable-diagnostic-validation
992
993Disable validation of the diagnostic options when loading the module
994
Richard Smith081ad4d2017-01-24 19:39:46 +0000995.. option:: -fmodules-prune-after=<seconds>
996
997Specify the interval (in seconds) after which a module file will be considered unused
998
Richard Smith081ad4d2017-01-24 19:39:46 +0000999.. option:: -fmodules-prune-interval=<seconds>
1000
1001Specify the interval (in seconds) between attempts to prune the module cache
1002
Richard Smith081ad4d2017-01-24 19:39:46 +00001003.. option:: -fmodules-user-build-path <directory>
1004
1005Specify the module user build path
1006
Richard Smith081ad4d2017-01-24 19:39:46 +00001007.. option:: -fmodules-validate-once-per-build-session
1008
1009Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1010
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001011.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
Richard Smith081ad4d2017-01-24 19:39:46 +00001012
1013Validate the system headers that a module depends on when loading the module
1014
Richard Smith081ad4d2017-01-24 19:39:46 +00001015.. option:: -fprebuilt-module-path=<directory>
1016
1017Specify the prebuilt module path
1018
Richard Smith081ad4d2017-01-24 19:39:46 +00001019.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1020
1021Add directory to AFTER include search path
1022
Richard Smith081ad4d2017-01-24 19:39:46 +00001023.. option:: -iframework<arg>
1024
1025Add directory to SYSTEM framework search path
1026
Richard Smith78e23fd2017-04-13 22:39:49 +00001027.. option:: -iframeworkwithsysroot<directory>
1028
1029Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1030
Richard Smith081ad4d2017-01-24 19:39:46 +00001031.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1032
1033Include macros from file before parsing
1034
Richard Smith081ad4d2017-01-24 19:39:46 +00001035.. option:: -include<file>, --include<file>, --include=<arg>
1036
1037Include file before parsing
1038
Richard Smith081ad4d2017-01-24 19:39:46 +00001039.. option:: -include-pch <file>
1040
1041Include precompiled header file
1042
Richard Smith081ad4d2017-01-24 19:39:46 +00001043.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1044
1045Set the -iwithprefix/-iwithprefixbefore prefix
1046
Richard Smith081ad4d2017-01-24 19:39:46 +00001047.. option:: -iquote<directory>
1048
1049Add directory to QUOTE include search path
1050
Richard Smith081ad4d2017-01-24 19:39:46 +00001051.. option:: -isysroot<dir>
1052
1053Set the system root directory (usually /)
1054
Richard Smith081ad4d2017-01-24 19:39:46 +00001055.. option:: -isystem<directory>
1056
1057Add directory to SYSTEM include search path
1058
Richard Smith081ad4d2017-01-24 19:39:46 +00001059.. option:: -isystem-after<directory>
1060
1061Add directory to end of the SYSTEM include search path
1062
Richard Smith081ad4d2017-01-24 19:39:46 +00001063.. option:: -ivfsoverlay<arg>
1064
1065Overlay the virtual filesystem described by file over the real file system
1066
Richard Smith081ad4d2017-01-24 19:39:46 +00001067.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1068
1069Set directory to SYSTEM include search path with prefix
1070
Richard Smith081ad4d2017-01-24 19:39:46 +00001071.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1072
1073Set directory to include search path with prefix
1074
Richard Smith081ad4d2017-01-24 19:39:46 +00001075.. option:: -iwithsysroot<directory>
1076
1077Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1078
Richard Smith081ad4d2017-01-24 19:39:46 +00001079.. option:: --ptxas-path=<arg>
1080
1081Path to ptxas (used for compiling CUDA code)
1082
Richard Smith081ad4d2017-01-24 19:39:46 +00001083.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1084
1085Treat all #include paths starting with <prefix> as including a system header.
1086
1087Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +00001088--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001089
1090Flags controlling generation of a dependency file for ``make``-like build
1091systems.
1092
Richard Smith081ad4d2017-01-24 19:39:46 +00001093.. option:: -M, --dependencies
1094
1095Like -MD, but also implies -E and writes to stdout by default
1096
Richard Smith081ad4d2017-01-24 19:39:46 +00001097.. option:: -MD, --write-dependencies
1098
1099Write a depfile containing user and system headers
1100
Richard Smith081ad4d2017-01-24 19:39:46 +00001101.. option:: -MF<file>
1102
1103Write depfile output from -MMD, -MD, -MM, or -M to <file>
1104
Richard Smith081ad4d2017-01-24 19:39:46 +00001105.. option:: -MG, --print-missing-file-dependencies
1106
1107Add missing headers to depfile
1108
Richard Smith081ad4d2017-01-24 19:39:46 +00001109.. option:: -MJ<arg>
1110
1111Write a compilation database entry per input
1112
Richard Smith081ad4d2017-01-24 19:39:46 +00001113.. option:: -MM, --user-dependencies
1114
1115Like -MMD, but also implies -E and writes to stdout by default
1116
Richard Smith081ad4d2017-01-24 19:39:46 +00001117.. option:: -MMD, --write-user-dependencies
1118
1119Write a depfile containing user headers
1120
Richard Smith081ad4d2017-01-24 19:39:46 +00001121.. option:: -MP
1122
1123Create phony target for each dependency (other than main file)
1124
Richard Smith081ad4d2017-01-24 19:39:46 +00001125.. option:: -MQ<arg>
1126
1127Specify name of main file output to quote in depfile
1128
Richard Smith081ad4d2017-01-24 19:39:46 +00001129.. option:: -MT<arg>
1130
1131Specify name of main file output in depfile
1132
Richard Smith081ad4d2017-01-24 19:39:46 +00001133.. option:: -MV
1134
1135Use NMake/Jom format for the depfile
1136
1137Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001138--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001139
1140Flags allowing the state of the preprocessor to be dumped in various ways.
1141
Richard Smith081ad4d2017-01-24 19:39:46 +00001142.. option:: -d
1143
Richard Smithb2c82a62017-01-27 01:54:42 +00001144.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001145.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001146.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001147
Richard Smith081ad4d2017-01-24 19:39:46 +00001148.. option:: -dA
1149
Richard Smith081ad4d2017-01-24 19:39:46 +00001150.. option:: -dD
1151
1152Print macro definitions in -E mode in addition to normal output
1153
Richard Smith081ad4d2017-01-24 19:39:46 +00001154.. option:: -dI
1155
1156Print include directives in -E mode in addition to normal output
1157
Richard Smith081ad4d2017-01-24 19:39:46 +00001158.. option:: -dM
1159
1160Print macro definitions in -E mode instead of normal output
1161
1162Diagnostic flags
1163~~~~~~~~~~~~~~~~
1164
1165Flags controlling which warnings, errors, and remarks Clang will generate.
1166See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1167
Richard Smith081ad4d2017-01-24 19:39:46 +00001168.. option:: -R<remark>
1169
1170Enable the specified remark
1171
Richard Smith081ad4d2017-01-24 19:39:46 +00001172.. option:: -Rpass-analysis=<arg>
1173
1174Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1175
Richard Smith081ad4d2017-01-24 19:39:46 +00001176.. option:: -Rpass-missed=<arg>
1177
1178Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1179
Richard Smith081ad4d2017-01-24 19:39:46 +00001180.. option:: -Rpass=<arg>
1181
1182Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1183
Richard Smith081ad4d2017-01-24 19:39:46 +00001184.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1185
1186Enable the specified warning
1187
Richard Smith081ad4d2017-01-24 19:39:46 +00001188.. option:: -Wdeprecated, -Wno-deprecated
1189
Richard Smithc5b2e002017-01-27 02:08:37 +00001190Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001191
Richard Smith081ad4d2017-01-24 19:39:46 +00001192.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1193
Richard Smith081ad4d2017-01-24 19:39:46 +00001194Target-independent compilation options
1195~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001196.. option:: -Wframe-larger-than=<arg>
1197
Richard Smith081ad4d2017-01-24 19:39:46 +00001198.. option:: -fPIC, -fno-PIC
1199
Richard Smith081ad4d2017-01-24 19:39:46 +00001200.. option:: -fPIE, -fno-PIE
1201
Richard Smith081ad4d2017-01-24 19:39:46 +00001202.. option:: -faccess-control, -fno-access-control
1203
Vedant Kumar368540f2018-08-23 17:55:03 +00001204.. option:: -faddrsig, -fno-addrsig
1205
1206Emit an address-significance table
1207
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001208.. option:: -falign-functions, -fno-align-functions
1209
1210.. program:: clang1
1211.. option:: -falign-functions=<arg>
1212.. program:: clang
1213
Richard Smithb2c82a62017-01-27 01:54:42 +00001214.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001215.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001216.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001217
1218Enable C++17 aligned allocation functions
1219
Craig Topperd23254a2017-07-20 17:52:48 +00001220.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1221
1222Treat editor placeholders as valid source code
1223
Richard Smith081ad4d2017-01-24 19:39:46 +00001224.. option:: -fallow-unsupported
1225
Richard Smith78e23fd2017-04-13 22:39:49 +00001226.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001227
Richard Smith081ad4d2017-01-24 19:39:46 +00001228.. option:: -fansi-escape-codes
1229
1230Use ANSI escape codes for diagnostics
1231
Richard Smith081ad4d2017-01-24 19:39:46 +00001232.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1233
1234Use Apple's kernel extensions ABI
1235
Richard Smith081ad4d2017-01-24 19:39:46 +00001236.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1237
1238Enable Apple gcc-compatible #pragma pack handling
1239
Richard Smith081ad4d2017-01-24 19:39:46 +00001240.. option:: -fapplication-extension, -fno-application-extension
1241
1242Restrict code to those available for App Extensions
1243
Richard Smith081ad4d2017-01-24 19:39:46 +00001244.. option:: -fasm, -fno-asm
1245
Richard Smith081ad4d2017-01-24 19:39:46 +00001246.. option:: -fasm-blocks, -fno-asm-blocks
1247
Richard Smith081ad4d2017-01-24 19:39:46 +00001248.. option:: -fassociative-math, -fno-associative-math
1249
Richard Smith081ad4d2017-01-24 19:39:46 +00001250.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1251
Richard Smith081ad4d2017-01-24 19:39:46 +00001252.. option:: -fast
1253
Richard Smith081ad4d2017-01-24 19:39:46 +00001254.. option:: -fastcp
1255
Richard Smith081ad4d2017-01-24 19:39:46 +00001256.. option:: -fastf
1257
Richard Smith081ad4d2017-01-24 19:39:46 +00001258.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1259
Richard Smith081ad4d2017-01-24 19:39:46 +00001260.. option:: -fautolink, -fno-autolink
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262.. option:: -fblocks, -fno-blocks
1263
1264Enable the 'blocks' language feature
1265
Richard Smith081ad4d2017-01-24 19:39:46 +00001266.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1267
Richard Smith081ad4d2017-01-24 19:39:46 +00001268.. option:: -fborland-extensions, -fno-borland-extensions
1269
1270Accept non-standard constructs supported by the Borland compiler
1271
Richard Smith081ad4d2017-01-24 19:39:46 +00001272.. option:: -fbracket-depth=<arg>
1273
Richard Smith081ad4d2017-01-24 19:39:46 +00001274.. option:: -fbuiltin, -fno-builtin
1275
Richard Smith081ad4d2017-01-24 19:39:46 +00001276.. option:: -fbuiltin-module-map
1277
1278Load the clang builtins module map file.
1279
Vedant Kumar368540f2018-08-23 17:55:03 +00001280.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1281
1282Enable C++ static destructor registration (the default)
1283
Richard Smith081ad4d2017-01-24 19:39:46 +00001284.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1285
Craig Topper596527b2018-01-23 18:40:15 +00001286.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1287
1288Instrument control-flow architecture protection. Options: return, branch, full, none.
1289
Vedant Kumar368540f2018-08-23 17:55:03 +00001290.. option:: -fchar8\_t, -fno-char8\_t
1291
1292Enable C++ builtin type char8\_t
1293
Richard Smith081ad4d2017-01-24 19:39:46 +00001294.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1297
1298Use colors in diagnostics
1299
Richard Smith081ad4d2017-01-24 19:39:46 +00001300.. option:: -fcommon, -fno-common
1301
Richard Smith081ad4d2017-01-24 19:39:46 +00001302.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1303
Richard Smith081ad4d2017-01-24 19:39:46 +00001304.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1305
Richard Smith081ad4d2017-01-24 19:39:46 +00001306.. option:: -fconstant-string-class=<arg>
1307
Richard Smith081ad4d2017-01-24 19:39:46 +00001308.. option:: -fconstexpr-backtrace-limit=<arg>
1309
Richard Smith081ad4d2017-01-24 19:39:46 +00001310.. option:: -fconstexpr-depth=<arg>
1311
Richard Smith081ad4d2017-01-24 19:39:46 +00001312.. option:: -fconstexpr-steps=<arg>
1313
Richard Smith081ad4d2017-01-24 19:39:46 +00001314.. option:: -fcoroutines-ts, -fno-coroutines-ts
1315
1316Enable support for the C++ Coroutines TS
1317
Richard Smith081ad4d2017-01-24 19:39:46 +00001318.. option:: -fcoverage-mapping, -fno-coverage-mapping
1319
1320Generate coverage mapping to enable code coverage analysis
1321
Richard Smith081ad4d2017-01-24 19:39:46 +00001322.. option:: -fcreate-profile
1323
Richard Smith081ad4d2017-01-24 19:39:46 +00001324.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1325
1326Enable C++ exceptions
1327
Richard Smith081ad4d2017-01-24 19:39:46 +00001328.. option:: -fcxx-modules, -fno-cxx-modules
1329
Richard Smith081ad4d2017-01-24 19:39:46 +00001330.. option:: -fdata-sections, -fno-data-sections
1331
1332Place each data in its own section (ELF Only)
1333
Richard Smith081ad4d2017-01-24 19:39:46 +00001334.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1335
1336Emit extra debug info to make sample profile more accurate.
1337
Richard Smith78e23fd2017-04-13 22:39:49 +00001338.. option:: -fdebug-macro, -fno-debug-macro
1339
1340Emit macro debug information
1341
Richard Smith081ad4d2017-01-24 19:39:46 +00001342.. option:: -fdebug-pass-arguments
1343
Richard Smith081ad4d2017-01-24 19:39:46 +00001344.. option:: -fdebug-pass-structure
1345
Richard Smith081ad4d2017-01-24 19:39:46 +00001346.. option:: -fdebug-prefix-map=<arg>
1347
1348remap file source paths in debug info
1349
Richard Smith081ad4d2017-01-24 19:39:46 +00001350.. option:: -fdebug-types-section, -fno-debug-types-section
1351
1352Place debug types in their own section (ELF Only)
1353
Richard Smith081ad4d2017-01-24 19:39:46 +00001354.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1355
1356Parse templated function definitions at the end of the translation unit
1357
Vedant Kumar368540f2018-08-23 17:55:03 +00001358.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1359
1360Treat usage of null pointers as undefined behavior.
1361
Richard Smith081ad4d2017-01-24 19:39:46 +00001362.. option:: -fdenormal-fp-math=<arg>
1363
Richard Smith081ad4d2017-01-24 19:39:46 +00001364.. option:: -fdiagnostics-absolute-paths
1365
1366Print absolute paths in diagnostics
1367
Richard Smith081ad4d2017-01-24 19:39:46 +00001368.. option:: -fdiagnostics-color, -fno-diagnostics-color
1369
Richard Smithb2c82a62017-01-27 01:54:42 +00001370.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001371.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001372.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001373
Craig Topperd23254a2017-07-20 17:52:48 +00001374.. option:: -fdiagnostics-hotness-threshold=<number>
1375
1376Prevent optimization remarks from being output if they do not have at least this profile count
1377
Richard Smith081ad4d2017-01-24 19:39:46 +00001378.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1379
1380Enable profile hotness information in diagnostic line
1381
Richard Smith081ad4d2017-01-24 19:39:46 +00001382.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1383
1384Display include stacks for diagnostic notes
1385
Richard Smith081ad4d2017-01-24 19:39:46 +00001386.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1387
1388Print option name with mappable diagnostics
1389
Richard Smith081ad4d2017-01-24 19:39:46 +00001390.. option:: -fdiagnostics-show-template-tree
1391
1392Print a template comparison tree for differing templates
1393
Vedant Kumar368540f2018-08-23 17:55:03 +00001394.. option:: -fdigraphs, -fno-digraphs
1395
1396Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1397
Richard Smith081ad4d2017-01-24 19:39:46 +00001398.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1399
1400Allow '$' in identifiers
1401
Craig Topper16418662017-11-20 18:07:43 +00001402.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1403
1404Enable '\[\[\]\]' attributes in all C and C++ language modes
1405
Richard Smith081ad4d2017-01-24 19:39:46 +00001406.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1407
Craig Topper188252d2017-12-11 21:09:16 +00001408.. option:: -fdwarf-exceptions
1409
1410Use DWARF style exceptions
1411
Richard Smith081ad4d2017-01-24 19:39:46 +00001412.. option:: -felide-constructors, -fno-elide-constructors
1413
Richard Smith081ad4d2017-01-24 19:39:46 +00001414.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1415
Richard Smith081ad4d2017-01-24 19:39:46 +00001416.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1417
1418Embed LLVM bitcode (option: off, all, bitcode, marker)
1419
Richard Smith081ad4d2017-01-24 19:39:46 +00001420.. option:: -femit-all-decls
1421
1422Emit all declarations, even if unused
1423
Richard Smith081ad4d2017-01-24 19:39:46 +00001424.. option:: -femulated-tls, -fno-emulated-tls
1425
1426Use emutls functions to access thread\_local variables
1427
Richard Smith081ad4d2017-01-24 19:39:46 +00001428.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1429
Richard Smith081ad4d2017-01-24 19:39:46 +00001430.. option:: -ferror-limit=<arg>
1431
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001432.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1433
Richard Smith081ad4d2017-01-24 19:39:46 +00001434.. option:: -fexceptions, -fno-exceptions
1435
1436Enable support for exception handling
1437
Richard Smith081ad4d2017-01-24 19:39:46 +00001438.. option:: -fexec-charset=<arg>
1439
Richard Smith081ad4d2017-01-24 19:39:46 +00001440.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1441
Richard Smith081ad4d2017-01-24 19:39:46 +00001442.. option:: -ffast-math, -fno-fast-math
1443
1444Allow aggressive, lossy floating-point optimizations
1445
Richard Smith081ad4d2017-01-24 19:39:46 +00001446.. option:: -ffinite-math-only, -fno-finite-math-only
1447
Vedant Kumar368540f2018-08-23 17:55:03 +00001448.. option:: -ffixed-point, -fno-fixed-point
1449
1450Enable fixed point types
1451
Richard Smith081ad4d2017-01-24 19:39:46 +00001452.. option:: -ffor-scope, -fno-for-scope
1453
Vedant Kumar368540f2018-08-23 17:55:03 +00001454.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1455
1456Emits more virtual tables to improve devirtualization
1457
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001458.. option:: -fforce-enable-int128, -fno-force-enable-int128
1459
1460Enable support for int128\_t type
1461
Richard Smith081ad4d2017-01-24 19:39:46 +00001462.. option:: -ffp-contract=<arg>
1463
1464Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1465
Richard Smith081ad4d2017-01-24 19:39:46 +00001466.. option:: -ffreestanding
1467
1468Assert that the compilation takes place in a freestanding environment
1469
Richard Smith081ad4d2017-01-24 19:39:46 +00001470.. option:: -ffunction-sections, -fno-function-sections
1471
1472Place each function in its own section (ELF Only)
1473
Richard Smith081ad4d2017-01-24 19:39:46 +00001474.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1475
Richard Smith081ad4d2017-01-24 19:39:46 +00001476.. option:: -fgnu-keywords, -fno-gnu-keywords
1477
1478Allow GNU-extension keywords regardless of language standard
1479
Richard Smith081ad4d2017-01-24 19:39:46 +00001480.. option:: -fgnu-runtime
1481
1482Generate output compatible with the standard GNU Objective-C runtime
1483
Richard Smith081ad4d2017-01-24 19:39:46 +00001484.. option:: -fgnu89-inline, -fno-gnu89-inline
1485
1486Use the gnu89 inline semantics
1487
Richard Smith081ad4d2017-01-24 19:39:46 +00001488.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1489
Richard Smith081ad4d2017-01-24 19:39:46 +00001490.. option:: -fhonor-nans, -fno-honor-nans
1491
Richard Smith081ad4d2017-01-24 19:39:46 +00001492.. option:: -fhosted
1493
Richard Smith081ad4d2017-01-24 19:39:46 +00001494.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1495
1496Implicitly search the file system for module map files.
1497
Richard Smith081ad4d2017-01-24 19:39:46 +00001498.. option:: -fimplicit-modules, -fno-implicit-modules
1499
Richard Smith081ad4d2017-01-24 19:39:46 +00001500.. option:: -finput-charset=<arg>
1501
Craig Topper188252d2017-12-11 21:09:16 +00001502.. option:: -finstrument-function-entry-bare
1503
1504Instrument function entry only, after inlining, without arguments to the instrumentation call
1505
Richard Smith081ad4d2017-01-24 19:39:46 +00001506.. option:: -finstrument-functions
1507
1508Generate calls to instrument function entry and exit
1509
Craig Topper16418662017-11-20 18:07:43 +00001510.. option:: -finstrument-functions-after-inlining
1511
1512Like -finstrument-functions, but insert the calls after inlining
1513
Richard Smith081ad4d2017-01-24 19:39:46 +00001514.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1515
1516Enable the integrated assembler
1517
Richard Smith081ad4d2017-01-24 19:39:46 +00001518.. option:: -fjump-tables, -fno-jump-tables
1519
Vedant Kumar368540f2018-08-23 17:55:03 +00001520.. option:: -fkeep-static-consts
1521
1522Keep static const variables even if unused
1523
Richard Smith081ad4d2017-01-24 19:39:46 +00001524.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1525
Richard Smith081ad4d2017-01-24 19:39:46 +00001526.. option:: -flimited-precision=<arg>
1527
Richard Smith081ad4d2017-01-24 19:39:46 +00001528.. option:: -flto, -fno-lto
1529
1530Enable LTO in 'full' mode
1531
Richard Smith081ad4d2017-01-24 19:39:46 +00001532.. option:: -flto-jobs=<arg>
1533
1534Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1535
Richard Smithb2c82a62017-01-27 01:54:42 +00001536.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001537.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001538.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001539
1540Set LTO mode to either 'full' or 'thin'
1541
Richard Smith081ad4d2017-01-24 19:39:46 +00001542.. option:: -fmacro-backtrace-limit=<arg>
1543
Richard Smith081ad4d2017-01-24 19:39:46 +00001544.. option:: -fmath-errno, -fno-math-errno
1545
1546Require math functions to indicate errors by setting errno
1547
Richard Smith081ad4d2017-01-24 19:39:46 +00001548.. option:: -fmax-type-align=<arg>
1549
1550Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1551
Richard Smith081ad4d2017-01-24 19:39:46 +00001552.. option:: -fmerge-all-constants, -fno-merge-all-constants
1553
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001554Allow merging of constants
1555
Richard Smith081ad4d2017-01-24 19:39:46 +00001556.. option:: -fmessage-length=<arg>
1557
Richard Smith081ad4d2017-01-24 19:39:46 +00001558.. option:: -fmodule-file-deps, -fno-module-file-deps
1559
Richard Smith081ad4d2017-01-24 19:39:46 +00001560.. option:: -fmodule-map-file=<file>
1561
1562Load this module map file
1563
Richard Smith081ad4d2017-01-24 19:39:46 +00001564.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1565
1566Specify the name of the module to build
1567
Richard Smith081ad4d2017-01-24 19:39:46 +00001568.. option:: -fmodules, -fno-modules
1569
1570Enable the 'modules' language feature
1571
Richard Smith081ad4d2017-01-24 19:39:46 +00001572.. option:: -fmodules-decluse, -fno-modules-decluse
1573
1574Require declaration of modules used within a module
1575
Richard Smith081ad4d2017-01-24 19:39:46 +00001576.. option:: -fmodules-ignore-macro=<arg>
1577
1578Ignore the definition of the given macro when building and loading modules
1579
Richard Smith081ad4d2017-01-24 19:39:46 +00001580.. option:: -fmodules-search-all, -fno-modules-search-all
1581
1582Search even non-imported modules to resolve references
1583
Richard Smith081ad4d2017-01-24 19:39:46 +00001584.. option:: -fmodules-strict-decluse
1585
1586Like -fmodules-decluse but requires all headers to be in modules
1587
Richard Smith081ad4d2017-01-24 19:39:46 +00001588.. option:: -fmodules-ts
1589
1590Enable support for the C++ Modules TS
1591
Richard Smith081ad4d2017-01-24 19:39:46 +00001592.. option:: -fms-compatibility, -fno-ms-compatibility
1593
1594Enable full Microsoft Visual C++ compatibility
1595
Richard Smith081ad4d2017-01-24 19:39:46 +00001596.. option:: -fms-compatibility-version=<arg>
1597
1598Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1599
Richard Smith081ad4d2017-01-24 19:39:46 +00001600.. option:: -fms-extensions, -fno-ms-extensions
1601
1602Accept some non-standard constructs supported by the Microsoft compiler
1603
Richard Smith081ad4d2017-01-24 19:39:46 +00001604.. option:: -fms-memptr-rep=<arg>
1605
Richard Smith081ad4d2017-01-24 19:39:46 +00001606.. option:: -fms-volatile<arg>
1607
Richard Smith081ad4d2017-01-24 19:39:46 +00001608.. option:: -fmsc-version=<arg>
1609
1610Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1611
Richard Smith081ad4d2017-01-24 19:39:46 +00001612.. option:: -fmudflap
1613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -fmudflapth
1615
Richard Smith081ad4d2017-01-24 19:39:46 +00001616.. option:: -fnested-functions
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1619
1620Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1621
Richard Smith081ad4d2017-01-24 19:39:46 +00001622.. option:: -fnext-runtime
1623
Richard Smith081ad4d2017-01-24 19:39:46 +00001624.. option:: -fno-builtin-<arg>
1625
1626Disable implicit builtin knowledge of a specific function
1627
Richard Smith081ad4d2017-01-24 19:39:46 +00001628.. option:: -fno-elide-type
1629
1630Do not elide types when printing diagnostics
1631
Richard Smith081ad4d2017-01-24 19:39:46 +00001632.. option:: -fno-max-type-align
1633
Richard Smith081ad4d2017-01-24 19:39:46 +00001634.. option:: -fno-operator-names
1635
1636Do not treat C++ operator name keywords as synonyms for operators
1637
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001638.. option:: -fno-rtti-data
1639
1640Control emission of RTTI data
1641
Richard Smith081ad4d2017-01-24 19:39:46 +00001642.. option:: -fno-strict-modules-decluse
1643
Richard Smith081ad4d2017-01-24 19:39:46 +00001644.. option:: -fno-working-directory
1645
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001646.. option:: -fnoxray-link-deps
1647
Richard Smith081ad4d2017-01-24 19:39:46 +00001648.. option:: -fobjc-abi-version=<arg>
1649
Richard Smith081ad4d2017-01-24 19:39:46 +00001650.. option:: -fobjc-arc, -fno-objc-arc
1651
1652Synthesize retain and release calls for Objective-C pointers
1653
Richard Smith081ad4d2017-01-24 19:39:46 +00001654.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1655
1656Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1657
Richard Smith081ad4d2017-01-24 19:39:46 +00001658.. option:: -fobjc-exceptions, -fno-objc-exceptions
1659
1660Enable Objective-C exceptions
1661
Richard Smith081ad4d2017-01-24 19:39:46 +00001662.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1663
Richard Smith081ad4d2017-01-24 19:39:46 +00001664.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1665
Richard Smith081ad4d2017-01-24 19:39:46 +00001666.. option:: -fobjc-link-runtime
1667
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1669
Richard Smith081ad4d2017-01-24 19:39:46 +00001670.. option:: -fobjc-nonfragile-abi-version=<arg>
1671
Richard Smith081ad4d2017-01-24 19:39:46 +00001672.. option:: -fobjc-runtime=<arg>
1673
1674Specify the target Objective-C runtime kind and version
1675
Richard Smith081ad4d2017-01-24 19:39:46 +00001676.. option:: -fobjc-sender-dependent-dispatch
1677
Richard Smith081ad4d2017-01-24 19:39:46 +00001678.. option:: -fobjc-weak, -fno-objc-weak
1679
1680Enable ARC-style weak references in Objective-C
1681
Richard Smith081ad4d2017-01-24 19:39:46 +00001682.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1683
Richard Smith081ad4d2017-01-24 19:39:46 +00001684.. option:: -fopenmp, -fno-openmp
1685
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001686Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001687
Craig Topper287c8012018-01-03 18:29:12 +00001688.. option:: -fopenmp-simd, -fno-openmp-simd
1689
1690Emit OpenMP code only for SIMD-based constructs.
1691
Richard Smith081ad4d2017-01-24 19:39:46 +00001692.. option:: -fopenmp-version=<arg>
1693
Richard Smithb2c82a62017-01-27 01:54:42 +00001694.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001695.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001696.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001697
Richard Smith081ad4d2017-01-24 19:39:46 +00001698.. option:: -foperator-arrow-depth=<arg>
1699
Richard Smith081ad4d2017-01-24 19:39:46 +00001700.. option:: -foptimization-record-file=<arg>
1701
1702Specify the file name of any generated YAML optimization record
1703
Richard Smith081ad4d2017-01-24 19:39:46 +00001704.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1705
Richard Smith081ad4d2017-01-24 19:39:46 +00001706.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1707
Richard Smith081ad4d2017-01-24 19:39:46 +00001708.. option:: -fpack-struct, -fno-pack-struct
1709
Richard Smithb2c82a62017-01-27 01:54:42 +00001710.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001711.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001712.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001713
1714Specify the default maximum struct packing alignment
1715
Richard Smith081ad4d2017-01-24 19:39:46 +00001716.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1717
1718Recognize and construct Pascal-style string literals
1719
Richard Smith081ad4d2017-01-24 19:39:46 +00001720.. option:: -fpcc-struct-return
1721
1722Override the default ABI to return all structs on the stack
1723
Richard Smith081ad4d2017-01-24 19:39:46 +00001724.. option:: -fpch-preprocess
1725
Richard Smith081ad4d2017-01-24 19:39:46 +00001726.. option:: -fpic, -fno-pic
1727
Richard Smith081ad4d2017-01-24 19:39:46 +00001728.. option:: -fpie, -fno-pie
1729
Craig Topper16418662017-11-20 18:07:43 +00001730.. option:: -fplt, -fno-plt
1731
1732Use the PLT to make function calls
1733
Richard Smith081ad4d2017-01-24 19:39:46 +00001734.. option:: -fplugin=<dsopath>
1735
1736Load the named plugin (dynamic shared object)
1737
Richard Smith081ad4d2017-01-24 19:39:46 +00001738.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1739
Richard Smith081ad4d2017-01-24 19:39:46 +00001740.. option:: -fprofile-arcs, -fno-profile-arcs
1741
Richard Smith081ad4d2017-01-24 19:39:46 +00001742.. option:: -fprofile-dir=<arg>
1743
Richard Smith081ad4d2017-01-24 19:39:46 +00001744.. option:: -fprofile-generate, -fno-profile-generate
1745
1746Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1747
Richard Smithb2c82a62017-01-27 01:54:42 +00001748.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001749.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001750.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001751
1752Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1753
Richard Smith081ad4d2017-01-24 19:39:46 +00001754.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1755
1756Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1757
Richard Smithb2c82a62017-01-27 01:54:42 +00001758.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001759.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001760.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001761
1762Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1763
Richard Smith081ad4d2017-01-24 19:39:46 +00001764.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1765
Richard Smithb2c82a62017-01-27 01:54:42 +00001766.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001767.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001768.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001769
1770Use instrumentation data for profile-guided optimization
1771
Boris Kolpackovb150d242017-08-30 09:15:53 +00001772.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1773
1774Specifies that the sample profile is accurate. If the sample
1775 profile is accurate, callsites without profile samples are marked
1776 as cold. Otherwise, treat callsites without profile samples as if
1777 we have no profile
1778
Richard Smith78e23fd2017-04-13 22:39:49 +00001779.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1780
1781.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001782.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001783.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001784
1785Enable sample-based profile guided optimizations
1786
Richard Smithb2c82a62017-01-27 01:54:42 +00001787.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001788.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001789.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001790
1791Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1792
Richard Smith081ad4d2017-01-24 19:39:46 +00001793.. option:: -freciprocal-math, -fno-reciprocal-math
1794
1795Allow division operations to be reassociated
1796
Richard Smith081ad4d2017-01-24 19:39:46 +00001797.. option:: -freg-struct-return
1798
1799Override the default ABI to return small structs in registers
1800
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001801.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1802
1803Use atexit or \_\_cxa\_atexit to register global destructors
1804
Richard Smith081ad4d2017-01-24 19:39:46 +00001805.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1806
1807Enable C++17 relaxed template template argument matching
1808
Richard Smith081ad4d2017-01-24 19:39:46 +00001809.. option:: -freroll-loops, -fno-reroll-loops
1810
1811Turn on loop reroller
1812
Richard Smith081ad4d2017-01-24 19:39:46 +00001813.. option:: -fretain-comments-from-system-headers
1814
Craig Topperd23254a2017-07-20 17:52:48 +00001815.. option:: -frewrite-imports, -fno-rewrite-imports
1816
Richard Smith081ad4d2017-01-24 19:39:46 +00001817.. option:: -frewrite-includes, -fno-rewrite-includes
1818
Richard Smith081ad4d2017-01-24 19:39:46 +00001819.. option:: -frewrite-map-file <arg>
1820
Richard Smithb2c82a62017-01-27 01:54:42 +00001821.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001822.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001823.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001824
Richard Smith081ad4d2017-01-24 19:39:46 +00001825.. option:: -fropi, -fno-ropi
1826
Richard Smith081ad4d2017-01-24 19:39:46 +00001827.. option:: -frtti, -fno-rtti
1828
Richard Smith081ad4d2017-01-24 19:39:46 +00001829.. option:: -frwpi, -fno-rwpi
1830
Richard Smith081ad4d2017-01-24 19:39:46 +00001831.. option:: -fsave-optimization-record, -fno-save-optimization-record
1832
1833Generate a YAML optimization record file
1834
Craig Topper188252d2017-12-11 21:09:16 +00001835.. option:: -fseh-exceptions
1836
1837Use SEH style exceptions
1838
Richard Smith081ad4d2017-01-24 19:39:46 +00001839.. option:: -fshort-enums, -fno-short-enums
1840
1841Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1842
Richard Smith081ad4d2017-01-24 19:39:46 +00001843.. option:: -fshort-wchar, -fno-short-wchar
1844
1845Force wchar\_t to be a short unsigned int
1846
Richard Smith081ad4d2017-01-24 19:39:46 +00001847.. option:: -fshow-column, -fno-show-column
1848
Richard Smith081ad4d2017-01-24 19:39:46 +00001849.. option:: -fshow-overloads=<arg>
1850
1851Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1852
Richard Smith081ad4d2017-01-24 19:39:46 +00001853.. option:: -fshow-source-location, -fno-show-source-location
1854
Richard Smith081ad4d2017-01-24 19:39:46 +00001855.. option:: -fsignaling-math, -fno-signaling-math
1856
Richard Smith081ad4d2017-01-24 19:39:46 +00001857.. option:: -fsigned-bitfields
1858
Richard Smith081ad4d2017-01-24 19:39:46 +00001859.. option:: -fsigned-char, -fno-signed-char, --signed-char
1860
Richard Smith081ad4d2017-01-24 19:39:46 +00001861.. option:: -fsigned-zeros, -fno-signed-zeros
1862
Richard Smith081ad4d2017-01-24 19:39:46 +00001863.. option:: -fsized-deallocation, -fno-sized-deallocation
1864
1865Enable C++14 sized global deallocation functions
1866
Richard Smith081ad4d2017-01-24 19:39:46 +00001867.. option:: -fsjlj-exceptions
1868
1869Use SjLj style exceptions
1870
Richard Smith081ad4d2017-01-24 19:39:46 +00001871.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1872
1873Enable the superword-level parallelism vectorization passes
1874
Richard Smith081ad4d2017-01-24 19:39:46 +00001875.. option:: -fspell-checking, -fno-spell-checking
1876
Richard Smith081ad4d2017-01-24 19:39:46 +00001877.. option:: -fspell-checking-limit=<arg>
1878
Richard Smith081ad4d2017-01-24 19:39:46 +00001879.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1880
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001881Provide 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 +00001882
Richard Smith081ad4d2017-01-24 19:39:46 +00001883.. option:: -fsplit-stack
1884
Richard Smith081ad4d2017-01-24 19:39:46 +00001885.. option:: -fstack-protector, -fno-stack-protector
1886
1887Enable stack protectors for functions potentially vulnerable to stack smashing
1888
Richard Smith081ad4d2017-01-24 19:39:46 +00001889.. option:: -fstack-protector-all
1890
1891Force the usage of stack protectors for all functions
1892
Richard Smith081ad4d2017-01-24 19:39:46 +00001893.. option:: -fstack-protector-strong
1894
1895Use a strong heuristic to apply stack protectors to functions
1896
Craig Topper596527b2018-01-23 18:40:15 +00001897.. option:: -fstack-size-section, -fno-stack-size-section
1898
1899Emit section containing metadata on function stack sizes
1900
Richard Smith081ad4d2017-01-24 19:39:46 +00001901.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1902
1903Emit full debug info for all types used by the program
1904
Richard Smith081ad4d2017-01-24 19:39:46 +00001905.. option:: -fstrict-aliasing, -fno-strict-aliasing
1906
Richard Smith081ad4d2017-01-24 19:39:46 +00001907.. option:: -fstrict-enums, -fno-strict-enums
1908
1909Enable optimizations based on the strict definition of an enum's value range
1910
Vedant Kumar368540f2018-08-23 17:55:03 +00001911.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
1912
1913Assume that overflowing float-to-int casts are undefined (default)
1914
Richard Smith081ad4d2017-01-24 19:39:46 +00001915.. option:: -fstrict-overflow, -fno-strict-overflow
1916
Richard Smith081ad4d2017-01-24 19:39:46 +00001917.. option:: -fstrict-return, -fno-strict-return
1918
Richard Smith78e23fd2017-04-13 22:39:49 +00001919Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00001920
Richard Smith081ad4d2017-01-24 19:39:46 +00001921.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1922
1923Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1924
Richard Smith081ad4d2017-01-24 19:39:46 +00001925.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1926
Richard Smith081ad4d2017-01-24 19:39:46 +00001927.. option:: -ftabstop=<arg>
1928
Richard Smith081ad4d2017-01-24 19:39:46 +00001929.. option:: -ftemplate-backtrace-limit=<arg>
1930
Richard Smith081ad4d2017-01-24 19:39:46 +00001931.. option:: -ftemplate-depth-<arg>
1932
Richard Smith081ad4d2017-01-24 19:39:46 +00001933.. option:: -ftemplate-depth=<arg>
1934
Richard Smith081ad4d2017-01-24 19:39:46 +00001935.. option:: -ftest-coverage
1936
Richard Smith081ad4d2017-01-24 19:39:46 +00001937.. option:: -fthinlto-index=<arg>
1938
1939Perform ThinLTO importing using provided function summary index
1940
Richard Smith081ad4d2017-01-24 19:39:46 +00001941.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1942
Richard Smith081ad4d2017-01-24 19:39:46 +00001943.. option:: -ftime-report
1944
Richard Smith081ad4d2017-01-24 19:39:46 +00001945.. option:: -ftls-model=<arg>
1946
Richard Smith081ad4d2017-01-24 19:39:46 +00001947.. option:: -ftrap-function=<arg>
1948
1949Issue call to specified function rather than a trap instruction
1950
Richard Smith081ad4d2017-01-24 19:39:46 +00001951.. option:: -ftrapping-math, -fno-trapping-math
1952
Richard Smith081ad4d2017-01-24 19:39:46 +00001953.. option:: -ftrapv
1954
1955Trap on integer overflow
1956
Richard Smith081ad4d2017-01-24 19:39:46 +00001957.. option:: -ftrapv-handler <arg>
1958
Richard Smithb2c82a62017-01-27 01:54:42 +00001959.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001960.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00001961.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001962
1963Specify the function to be called on overflow
1964
Richard Smith081ad4d2017-01-24 19:39:46 +00001965.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1966
1967Process trigraph sequences
1968
Richard Smith081ad4d2017-01-24 19:39:46 +00001969.. option:: -funique-section-names, -fno-unique-section-names
1970
1971Use unique names for text and data sections (ELF Only)
1972
Richard Smith081ad4d2017-01-24 19:39:46 +00001973.. option:: -funit-at-a-time, -fno-unit-at-a-time
1974
Richard Smith081ad4d2017-01-24 19:39:46 +00001975.. option:: -funroll-loops, -fno-unroll-loops
1976
1977Turn on loop unroller
1978
Richard Smith081ad4d2017-01-24 19:39:46 +00001979.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
1980
Richard Smith081ad4d2017-01-24 19:39:46 +00001981.. option:: -funsigned-bitfields
1982
Richard Smith081ad4d2017-01-24 19:39:46 +00001983.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
1984
Richard Smith081ad4d2017-01-24 19:39:46 +00001985.. option:: -funwind-tables, -fno-unwind-tables
1986
Richard Smith081ad4d2017-01-24 19:39:46 +00001987.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
1988
Richard Smith081ad4d2017-01-24 19:39:46 +00001989.. option:: -fuse-init-array, -fno-use-init-array
1990
1991Use .init\_array instead of .ctors
1992
Richard Smith081ad4d2017-01-24 19:39:46 +00001993.. option:: -fuse-ld=<arg>
1994
Richard Smith081ad4d2017-01-24 19:39:46 +00001995.. option:: -fuse-line-directives, -fno-use-line-directives
1996
Richard Smith081ad4d2017-01-24 19:39:46 +00001997.. option:: -fveclib=<arg>
1998
1999Use the given vector functions library
2000
Richard Smith081ad4d2017-01-24 19:39:46 +00002001.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2002
2003Enable the loop vectorization passes
2004
Richard Smith081ad4d2017-01-24 19:39:46 +00002005.. option:: -fverbose-asm, -fno-verbose-asm
2006
Richard Smith081ad4d2017-01-24 19:39:46 +00002007.. option:: -fvisibility-inlines-hidden
2008
Fangrui Songdf81b972018-07-19 22:45:41 +00002009Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00002010
Richard Smith081ad4d2017-01-24 19:39:46 +00002011.. option:: -fvisibility-ms-compat
2012
2013Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2014
Richard Smith081ad4d2017-01-24 19:39:46 +00002015.. option:: -fvisibility=<arg>
2016
2017Set the default symbol visibility for all global declarations
2018
Richard Smith081ad4d2017-01-24 19:39:46 +00002019.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2020
2021Enables whole-program vtable optimization. Requires -flto
2022
Richard Smith081ad4d2017-01-24 19:39:46 +00002023.. option:: -fwrapv, -fno-wrapv
2024
2025Treat signed integer overflow as two's complement
2026
Richard Smith081ad4d2017-01-24 19:39:46 +00002027.. option:: -fwritable-strings
2028
2029Store string literals as writable data
2030
Craig Topper188252d2017-12-11 21:09:16 +00002031.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2032
2033Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2034
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002035.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2036
2037Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2038
Richard Smith78e23fd2017-04-13 22:39:49 +00002039.. option:: -fxray-always-instrument=<arg>
2040
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002041DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2042
2043.. option:: -fxray-attr-list=<arg>
2044
2045Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002046
Richard Smith081ad4d2017-01-24 19:39:46 +00002047.. option:: -fxray-instruction-threshold<arg>
2048
Richard Smithb2c82a62017-01-27 01:54:42 +00002049.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002050.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002051.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002052
2053Sets the minimum function size to instrument with XRay
2054
Richard Smith081ad4d2017-01-24 19:39:46 +00002055.. option:: -fxray-instrument, -fno-xray-instrument
2056
2057Generate XRay instrumentation sleds on function entry and exit
2058
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002059.. option:: -fxray-instrumentation-bundle=<arg>
2060
2061Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'.
2062
2063.. option:: -fxray-link-deps
2064
2065Tells clang to add the link dependencies for XRay.
2066
2067.. option:: -fxray-modes=<arg>
2068
2069List of modes to link in by default into XRay instrumented binaries.
2070
Richard Smith78e23fd2017-04-13 22:39:49 +00002071.. option:: -fxray-never-instrument=<arg>
2072
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002073DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002074
Richard Smith081ad4d2017-01-24 19:39:46 +00002075.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2076
Richard Smith081ad4d2017-01-24 19:39:46 +00002077.. option:: -fzvector, -fno-zvector, -mzvector
2078
2079Enable System z vector language extension
2080
Richard Smith081ad4d2017-01-24 19:39:46 +00002081.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2082
Richard Smith081ad4d2017-01-24 19:39:46 +00002083.. option:: -pedantic-errors, --pedantic-errors
2084
2085OpenCL flags
2086------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002087.. option:: -cl-denorms-are-zero
2088
2089OpenCL only. Allow denormals to be flushed to zero.
2090
Richard Smith081ad4d2017-01-24 19:39:46 +00002091.. option:: -cl-fast-relaxed-math
2092
2093OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2094
Richard Smith081ad4d2017-01-24 19:39:46 +00002095.. option:: -cl-finite-math-only
2096
2097OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2098
Richard Smith081ad4d2017-01-24 19:39:46 +00002099.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2100
2101OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2102
Richard Smith081ad4d2017-01-24 19:39:46 +00002103.. option:: -cl-kernel-arg-info
2104
2105OpenCL only. Generate kernel argument metadata.
2106
Richard Smith081ad4d2017-01-24 19:39:46 +00002107.. option:: -cl-mad-enable
2108
2109OpenCL only. Allow use of less precise MAD computations in the generated binary.
2110
Richard Smith081ad4d2017-01-24 19:39:46 +00002111.. option:: -cl-no-signed-zeros
2112
2113OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2114
Richard Smith081ad4d2017-01-24 19:39:46 +00002115.. option:: -cl-opt-disable
2116
2117OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2118
Richard Smith081ad4d2017-01-24 19:39:46 +00002119.. option:: -cl-single-precision-constant
2120
2121OpenCL only. Treat double precision floating-point constant as single precision constant.
2122
Richard Smith081ad4d2017-01-24 19:39:46 +00002123.. option:: -cl-std=<arg>
2124
2125OpenCL language standard to compile for.
2126
Richard Smith081ad4d2017-01-24 19:39:46 +00002127.. option:: -cl-strict-aliasing
2128
2129OpenCL only. This option is added for compatibility with OpenCL 1.0.
2130
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002131.. option:: -cl-uniform-work-group-size
2132
2133OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2134
Richard Smith081ad4d2017-01-24 19:39:46 +00002135.. option:: -cl-unsafe-math-optimizations
2136
2137OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2138
2139Target-dependent compilation options
2140~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00002141.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2142
2143Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2144
Richard Smith081ad4d2017-01-24 19:39:46 +00002145.. option:: -m16
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -m32
2148
Richard Smith081ad4d2017-01-24 19:39:46 +00002149.. option:: -m64
2150
Richard Smith081ad4d2017-01-24 19:39:46 +00002151.. option:: -mabi=<arg>
2152
Richard Smith081ad4d2017-01-24 19:39:46 +00002153.. option:: -malign-double
2154
2155Align doubles to two words in structs (x86 only)
2156
Richard Smith081ad4d2017-01-24 19:39:46 +00002157.. option:: -march=<arg>
2158
Richard Smith081ad4d2017-01-24 19:39:46 +00002159.. option:: -masm=<arg>
2160
Richard Smith081ad4d2017-01-24 19:39:46 +00002161.. option:: -mbackchain, -mno-backchain
2162
2163Link stack frames through backchain on System Z
2164
Richard Smith081ad4d2017-01-24 19:39:46 +00002165.. option:: -mcmodel=<arg>
2166
Richard Smith081ad4d2017-01-24 19:39:46 +00002167.. option:: -mconsole<arg>
2168
Krzysztof Parzyszek57e67062018-10-19 15:36:45 +00002169.. 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 +00002170
Ziang Wande94ac92019-06-25 23:57:14 +00002171Use -mcpu=? to see a list of supported cpu models.
2172
Vedant Kumar368540f2018-08-23 17:55:03 +00002173.. option:: -mcrc, -mno-crc
2174
2175Allow use of CRC instructions (ARM/Mips only)
2176
Craig Topperd23254a2017-07-20 17:52:48 +00002177.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2178
Richard Smith081ad4d2017-01-24 19:39:46 +00002179.. option:: -mdll<arg>
2180
Richard Smith081ad4d2017-01-24 19:39:46 +00002181.. option:: -mdynamic-no-pic<arg>
2182
Richard Smith081ad4d2017-01-24 19:39:46 +00002183.. option:: -meabi <arg>
2184
2185Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2186
Richard Smith78e23fd2017-04-13 22:39:49 +00002187.. option:: -mfentry
2188
2189Insert calls to fentry at function entry (x86 only)
2190
Richard Smith081ad4d2017-01-24 19:39:46 +00002191.. option:: -mfloat-abi=<arg>
2192
Richard Smith081ad4d2017-01-24 19:39:46 +00002193.. option:: -mfpmath=<arg>
2194
Richard Smith081ad4d2017-01-24 19:39:46 +00002195.. option:: -mfpu=<arg>
2196
Richard Smith081ad4d2017-01-24 19:39:46 +00002197.. option:: -mglobal-merge, -mno-global-merge
2198
2199Enable merging of globals
2200
Richard Smith081ad4d2017-01-24 19:39:46 +00002201.. option:: -mhard-float
2202
Richard Smith081ad4d2017-01-24 19:39:46 +00002203.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2204
Richard Smith081ad4d2017-01-24 19:39:46 +00002205.. option:: -miamcu, -mno-iamcu
2206
2207Use Intel MCU ABI
2208
Richard Smith081ad4d2017-01-24 19:39:46 +00002209.. option:: -mimplicit-float, -mno-implicit-float
2210
Richard Smith081ad4d2017-01-24 19:39:46 +00002211.. option:: -mimplicit-it=<arg>
2212
Richard Smith081ad4d2017-01-24 19:39:46 +00002213.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2214
2215(integrated-as) Emit an object file which can be used with an incremental linker
2216
Richard Smith78e23fd2017-04-13 22:39:49 +00002217.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002218
Richard Smith081ad4d2017-01-24 19:39:46 +00002219.. option:: -mkernel
2220
Richard Smith081ad4d2017-01-24 19:39:46 +00002221.. option:: -mlong-calls, -mno-long-calls
2222
2223Generate branches with extended addressability, usually via indirect jumps.
2224
Craig Topperd23254a2017-07-20 17:52:48 +00002225.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002226
J. Ryan Stinnettd45eaf92019-05-30 16:46:22 +00002227Set macOS deployment target
Richard Smith081ad4d2017-01-24 19:39:46 +00002228
Craig Topperd23254a2017-07-20 17:52:48 +00002229.. option:: -mmcu=<arg>
2230
Richard Smith081ad4d2017-01-24 19:39:46 +00002231.. option:: -mms-bitfields, -mno-ms-bitfields
2232
2233Set the default structure layout to be compatible with the Microsoft compiler standard
2234
Richard Smith081ad4d2017-01-24 19:39:46 +00002235.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2236
2237Omit frame pointer setup for leaf functions
2238
Richard Smith081ad4d2017-01-24 19:39:46 +00002239.. option:: -moslib=<arg>
2240
Richard Smith081ad4d2017-01-24 19:39:46 +00002241.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2242
2243Use copy relocations support for PIE builds
2244
Craig Topper9a724aa2017-12-11 21:09:19 +00002245.. option:: -mprefer-vector-width=<arg>
2246
2247Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2248
Richard Smith081ad4d2017-01-24 19:39:46 +00002249.. option:: -mqdsp6-compat
2250
2251Enable hexagon-qdsp6 backward compatibility
2252
Richard Smith081ad4d2017-01-24 19:39:46 +00002253.. option:: -mrecip
2254
Richard Smithb2c82a62017-01-27 01:54:42 +00002255.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002256.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002257.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002258
Richard Smith081ad4d2017-01-24 19:39:46 +00002259.. option:: -mred-zone, -mno-red-zone
2260
Richard Smith081ad4d2017-01-24 19:39:46 +00002261.. option:: -mregparm=<arg>
2262
Richard Smith081ad4d2017-01-24 19:39:46 +00002263.. option:: -mrelax-all, -mno-relax-all
2264
2265(integrated-as) Relax all machine instructions
2266
Vedant Kumar368540f2018-08-23 17:55:03 +00002267.. option:: -mretpoline, -mno-retpoline
2268
Richard Smith081ad4d2017-01-24 19:39:46 +00002269.. option:: -mrtd, -mno-rtd
2270
2271Make StdCall calling convention the default
2272
Vedant Kumar368540f2018-08-23 17:55:03 +00002273.. option:: -msign-return-address=<arg>
2274
2275Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002276
Richard Smith081ad4d2017-01-24 19:39:46 +00002277.. option:: -msoft-float, -mno-soft-float
2278
2279Use software floating point
2280
Richard Smith081ad4d2017-01-24 19:39:46 +00002281.. option:: -mstack-alignment=<arg>
2282
2283Set the stack alignment
2284
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002285.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2286
2287Enable stack probes
2288
Richard Smith081ad4d2017-01-24 19:39:46 +00002289.. option:: -mstack-probe-size=<arg>
2290
2291Set the stack probe size
2292
Richard Smith081ad4d2017-01-24 19:39:46 +00002293.. option:: -mstackrealign, -mno-stackrealign
2294
2295Force realign the stack at entry to every function
2296
Richard Smith081ad4d2017-01-24 19:39:46 +00002297.. option:: -mthread-model <arg>
2298
2299The thread model to use, e.g. posix, single (posix by default)
2300
Richard Smith081ad4d2017-01-24 19:39:46 +00002301.. option:: -mthreads<arg>
2302
Richard Smith081ad4d2017-01-24 19:39:46 +00002303.. option:: -mthumb, -mno-thumb
2304
Richard Smith081ad4d2017-01-24 19:39:46 +00002305.. option:: -mtune=<arg>
2306
Ziang Wande94ac92019-06-25 23:57:14 +00002307Use -mtune=? to see a list of supported cpu models.
2308
Richard Smith78e23fd2017-04-13 22:39:49 +00002309.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002310
Richard Smith081ad4d2017-01-24 19:39:46 +00002311.. option:: -municode<arg>
2312
Richard Smith081ad4d2017-01-24 19:39:46 +00002313.. option:: -mvx, -mno-vx
2314
Richard Smith081ad4d2017-01-24 19:39:46 +00002315.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2316
Richard Smith78e23fd2017-04-13 22:39:49 +00002317.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002318
Richard Smith081ad4d2017-01-24 19:39:46 +00002319.. option:: -mwindows<arg>
2320
Richard Smith081ad4d2017-01-24 19:39:46 +00002321.. option:: -mx32
2322
Richard Smith081ad4d2017-01-24 19:39:46 +00002323AARCH64
2324-------
Tri Vo6e8abbc2018-09-12 23:45:04 +00002325.. option:: -ffixed-x1
2326
2327Reserve the x1 register (AArch64 only)
2328
2329.. option:: -ffixed-x2
2330
2331Reserve the x2 register (AArch64 only)
2332
2333.. option:: -ffixed-x3
2334
2335Reserve the x3 register (AArch64 only)
2336
2337.. option:: -ffixed-x4
2338
2339Reserve the x4 register (AArch64 only)
2340
2341.. option:: -ffixed-x5
2342
2343Reserve the x5 register (AArch64 only)
2344
2345.. option:: -ffixed-x6
2346
2347Reserve the x6 register (AArch64 only)
2348
2349.. option:: -ffixed-x7
2350
2351Reserve the x7 register (AArch64 only)
2352
Richard Smith081ad4d2017-01-24 19:39:46 +00002353.. option:: -ffixed-x18
2354
2355Reserve the x18 register (AArch64 only)
2356
Petr Hosek72509082018-06-12 20:00:50 +00002357.. option:: -ffixed-x20
2358
2359Reserve the x20 register (AArch64 only)
2360
Tri Vo28e7e602018-09-25 16:48:40 +00002361.. option:: -fcall-saved-x8
2362
2363Make the x8 register call-saved (AArch64 only)
2364
2365.. option:: -fcall-saved-x9
2366
2367Make the x9 register call-saved (AArch64 only)
2368
2369.. option:: -fcall-saved-x10
2370
2371Make the x10 register call-saved (AArch64 only)
2372
2373.. option:: -fcall-saved-x11
2374
2375Make the x11 register call-saved (AArch64 only)
2376
2377.. option:: -fcall-saved-x12
2378
2379Make the x12 register call-saved (AArch64 only)
2380
2381.. option:: -fcall-saved-x13
2382
2383Make the x13 register call-saved (AArch64 only)
2384
2385.. option:: -fcall-saved-x14
2386
2387Make the x14 register call-saved (AArch64 only)
2388
2389.. option:: -fcall-saved-x15
2390
2391Make the x15 register call-saved (AArch64 only)
2392
2393.. option:: -fcall-saved-x18
2394
2395Make the x18 register call-saved (AArch64 only)
2396
Richard Smith081ad4d2017-01-24 19:39:46 +00002397.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2398
2399Workaround Cortex-A53 erratum 835769 (AArch64 only)
2400
Richard Smith081ad4d2017-01-24 19:39:46 +00002401.. option:: -mgeneral-regs-only
2402
2403Generate code which only uses the general purpose registers (AArch64 only)
2404
2405AMDGPU
2406------
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002407.. option:: -mcumode, -mno-cumode
2408
2409CU wavefront execution mode is used if enabled and WGP wavefront execution mode
2410is used if disabled (AMDGPU only)
2411
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002412.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2413
2414Wavefront size 64 is used if enabled and wavefront size 32 if disabled (AMDGPU only)
2415
Craig Topper16418662017-11-20 18:07:43 +00002416.. option:: -mxnack, -mno-xnack
2417
2418Enable XNACK (AMDGPU only)
2419
Richard Smith081ad4d2017-01-24 19:39:46 +00002420ARM
2421---
Richard Smith081ad4d2017-01-24 19:39:46 +00002422.. option:: -ffixed-r9
2423
2424Reserve the r9 register (ARM only)
2425
Richard Smith081ad4d2017-01-24 19:39:46 +00002426.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2427
2428Disallow generation of data access to code sections (ARM only)
2429
Richard Smith081ad4d2017-01-24 19:39:46 +00002430.. option:: -mno-movt
2431
2432Disallow use of movt/movw pairs (ARM only)
2433
Richard Smith78e23fd2017-04-13 22:39:49 +00002434.. option:: -mno-neg-immediates
2435
2436Disallow converting instructions with negative immediates to their negation or inversion.
2437
Richard Smith081ad4d2017-01-24 19:39:46 +00002438.. option:: -mnocrc
2439
2440Disallow use of CRC instructions (ARM only)
2441
Richard Smith081ad4d2017-01-24 19:39:46 +00002442.. option:: -mrestrict-it, -mno-restrict-it
2443
2444Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2445
Craig Topper16418662017-11-20 18:07:43 +00002446.. option:: -mtp=<arg>
2447
2448Read thread pointer from coprocessor register (ARM only)
2449
Richard Smith081ad4d2017-01-24 19:39:46 +00002450.. option:: -munaligned-access, -mno-unaligned-access
2451
2452Allow memory accesses to be unaligned (AArch32/AArch64 only)
2453
2454Hexagon
2455-------
Craig Topper16418662017-11-20 18:07:43 +00002456.. option:: -mieee-rnd-near
2457
Vedant Kumar368540f2018-08-23 17:55:03 +00002458.. option:: -mmemops, -mno-memops
2459
2460Enable generation of memop instructions
2461
2462.. option:: -mnvj, -mno-nvj
2463
2464Enable generation of new-value jumps
2465
2466.. option:: -mnvs, -mno-nvs
2467
2468Enable generation of new-value stores
2469
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002470.. option:: -mpackets, -mno-packets
2471
2472Enable generation of instruction packets
2473
Craig Topper16418662017-11-20 18:07:43 +00002474Hexagon
2475-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002476.. option:: -mhvx, -mno-hvx
2477
2478Enable Hexagon Vector eXtensions
2479
Craig Topper16418662017-11-20 18:07:43 +00002480.. option:: -mhvx-length=<arg>
2481
2482Set Hexagon Vector Length
2483
2484.. program:: clang1
2485.. option:: -mhvx=<arg>
2486.. program:: clang
2487
2488Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002489
Vedant Kumar368540f2018-08-23 17:55:03 +00002490MIPS
2491----
2492.. option:: -mabicalls, -mno-abicalls
2493
2494Enable SVR4-style position-independent code (Mips only)
2495
2496.. option:: -mabs=<arg>
2497
2498.. option:: -mcheck-zero-division, -mno-check-zero-division
2499
2500.. option:: -mcompact-branches=<arg>
2501
2502.. option:: -mdouble-float
2503
2504.. option:: -mdsp, -mno-dsp
2505
2506.. option:: -mdspr2, -mno-dspr2
2507
2508.. option:: -membedded-data, -mno-embedded-data
2509
2510Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2511
2512.. option:: -mextern-sdata, -mno-extern-sdata
2513
2514Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2515
2516.. option:: -mfp32
2517
2518Use 32-bit floating point registers (MIPS only)
2519
2520.. option:: -mfp64
2521
2522Use 64-bit floating point registers (MIPS only)
2523
2524.. option:: -mginv, -mno-ginv
2525
2526.. option:: -mgpopt, -mno-gpopt
2527
2528Use GP relative accesses for symbols known to be in a small data section (MIPS)
2529
2530.. option:: -mindirect-jump=<arg>
2531
2532Change indirect jump instructions to inhibit speculation
2533
2534.. option:: -mips16
2535
2536.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2537
2538.. option:: -mlocal-sdata, -mno-local-sdata
2539
2540Extend the -G behaviour to object local data (MIPS)
2541
2542.. option:: -mmadd4, -mno-madd4
2543
2544Enable the generation of 4-operand madd.s, madd.d and related instructions.
2545
2546.. option:: -mmicromips, -mno-micromips
2547
2548.. option:: -mmsa, -mno-msa
2549
2550Enable MSA ASE (MIPS only)
2551
2552.. option:: -mmt, -mno-mt
2553
2554Enable MT ASE (MIPS only)
2555
2556.. option:: -mnan=<arg>
2557
2558.. option:: -mno-mips16
2559
2560.. option:: -msingle-float
2561
2562.. option:: -mvirt, -mno-virt
2563
2564.. option:: -mxgot, -mno-xgot
2565
Richard Smith081ad4d2017-01-24 19:39:46 +00002566PowerPC
2567-------
Richard Smith78e23fd2017-04-13 22:39:49 +00002568.. option:: -maltivec, -mno-altivec
2569
Richard Smith081ad4d2017-01-24 19:39:46 +00002570.. option:: -mcmpb, -mno-cmpb
2571
Richard Smith081ad4d2017-01-24 19:39:46 +00002572.. option:: -mcrbits, -mno-crbits
2573
Richard Smith081ad4d2017-01-24 19:39:46 +00002574.. option:: -mcrypto, -mno-crypto
2575
Richard Smith081ad4d2017-01-24 19:39:46 +00002576.. option:: -mdirect-move, -mno-direct-move
2577
Richard Smith081ad4d2017-01-24 19:39:46 +00002578.. option:: -mfloat128, -mno-float128
2579
Richard Smith081ad4d2017-01-24 19:39:46 +00002580.. option:: -mfprnd, -mno-fprnd
2581
Richard Smith081ad4d2017-01-24 19:39:46 +00002582.. option:: -mhtm, -mno-htm
2583
Richard Smith081ad4d2017-01-24 19:39:46 +00002584.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2585
Richard Smith081ad4d2017-01-24 19:39:46 +00002586.. option:: -misel, -mno-isel
2587
Richard Smith081ad4d2017-01-24 19:39:46 +00002588.. option:: -mlongcall, -mno-longcall
2589
Richard Smith081ad4d2017-01-24 19:39:46 +00002590.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2591
Richard Smith081ad4d2017-01-24 19:39:46 +00002592.. option:: -mpopcntd, -mno-popcntd
2593
Richard Smith081ad4d2017-01-24 19:39:46 +00002594.. option:: -mpower8-vector, -mno-power8-vector
2595
Richard Smith081ad4d2017-01-24 19:39:46 +00002596.. option:: -mpower9-vector, -mno-power9-vector
2597
Richard Smith081ad4d2017-01-24 19:39:46 +00002598.. option:: -mqpx, -mno-qpx
2599
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002600.. option:: -msecure-plt
2601
Richard Smith081ad4d2017-01-24 19:39:46 +00002602.. option:: -mvsx, -mno-vsx
2603
2604WebAssembly
2605-----------
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002606.. option:: -mexception-handling, -mno-exception-handling
2607
Craig Topper188252d2017-12-11 21:09:16 +00002608.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
2609
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00002610.. option:: -msign-ext, -mno-sign-ext
2611
Richard Smith081ad4d2017-01-24 19:39:46 +00002612.. option:: -msimd128, -mno-simd128
2613
2614X86
2615---
Richard Smith081ad4d2017-01-24 19:39:46 +00002616.. option:: -m3dnow, -mno-3dnow
2617
Richard Smith081ad4d2017-01-24 19:39:46 +00002618.. option:: -m3dnowa, -mno-3dnowa
2619
Richard Smith081ad4d2017-01-24 19:39:46 +00002620.. option:: -madx, -mno-adx
2621
Richard Smith081ad4d2017-01-24 19:39:46 +00002622.. option:: -maes, -mno-aes
2623
Richard Smith081ad4d2017-01-24 19:39:46 +00002624.. option:: -mavx, -mno-avx
2625
Richard Smith081ad4d2017-01-24 19:39:46 +00002626.. option:: -mavx2, -mno-avx2
2627
Craig Topper287c8012018-01-03 18:29:12 +00002628.. option:: -mavx512bitalg, -mno-avx512bitalg
2629
Luo, Yuanke844f6622019-05-06 08:25:11 +00002630.. option:: -mavx512bf16, -mno-avx512bf16
2631
Richard Smith081ad4d2017-01-24 19:39:46 +00002632.. option:: -mavx512bw, -mno-avx512bw
2633
Richard Smith081ad4d2017-01-24 19:39:46 +00002634.. option:: -mavx512cd, -mno-avx512cd
2635
Richard Smith081ad4d2017-01-24 19:39:46 +00002636.. option:: -mavx512dq, -mno-avx512dq
2637
Richard Smith081ad4d2017-01-24 19:39:46 +00002638.. option:: -mavx512er, -mno-avx512er
2639
Richard Smith081ad4d2017-01-24 19:39:46 +00002640.. option:: -mavx512f, -mno-avx512f
2641
Richard Smith081ad4d2017-01-24 19:39:46 +00002642.. option:: -mavx512ifma, -mno-avx512ifma
2643
Richard Smith081ad4d2017-01-24 19:39:46 +00002644.. option:: -mavx512pf, -mno-avx512pf
2645
Richard Smith081ad4d2017-01-24 19:39:46 +00002646.. option:: -mavx512vbmi, -mno-avx512vbmi
2647
Craig Topper287c8012018-01-03 18:29:12 +00002648.. option:: -mavx512vbmi2, -mno-avx512vbmi2
2649
Richard Smith081ad4d2017-01-24 19:39:46 +00002650.. option:: -mavx512vl, -mno-avx512vl
2651
Craig Topper287c8012018-01-03 18:29:12 +00002652.. option:: -mavx512vnni, -mno-avx512vnni
2653
Pengfei Wangcc3629d2019-05-31 06:09:35 +00002654.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
2655
Craig Topperd23254a2017-07-20 17:52:48 +00002656.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2657
Richard Smith081ad4d2017-01-24 19:39:46 +00002658.. option:: -mbmi, -mno-bmi
2659
Richard Smith081ad4d2017-01-24 19:39:46 +00002660.. option:: -mbmi2, -mno-bmi2
2661
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002662.. option:: -mcldemote, -mno-cldemote
2663
Craig Topper78b47872017-02-08 06:48:58 +00002664.. option:: -mclflushopt, -mno-clflushopt
2665
Craig Topper177a57c2017-02-08 07:57:01 +00002666.. option:: -mclwb, -mno-clwb
2667
Richard Smith78e23fd2017-04-13 22:39:49 +00002668.. option:: -mclzero, -mno-clzero
2669
Richard Smith081ad4d2017-01-24 19:39:46 +00002670.. option:: -mcx16, -mno-cx16
2671
Pengfei Wang3a29f7c2019-06-06 08:28:42 +00002672.. option:: -menqcmd, -mno-enqcmd
2673
Richard Smith081ad4d2017-01-24 19:39:46 +00002674.. option:: -mf16c, -mno-f16c
2675
Richard Smith081ad4d2017-01-24 19:39:46 +00002676.. option:: -mfma, -mno-fma
2677
Richard Smith081ad4d2017-01-24 19:39:46 +00002678.. option:: -mfma4, -mno-fma4
2679
Richard Smith081ad4d2017-01-24 19:39:46 +00002680.. option:: -mfsgsbase, -mno-fsgsbase
2681
Richard Smith081ad4d2017-01-24 19:39:46 +00002682.. option:: -mfxsr, -mno-fxsr
2683
Craig Topper287c8012018-01-03 18:29:12 +00002684.. option:: -mgfni, -mno-gfni
2685
Vedant Kumar368540f2018-08-23 17:55:03 +00002686.. option:: -minvpcid, -mno-invpcid
2687
Craig Topperd23254a2017-07-20 17:52:48 +00002688.. option:: -mlwp, -mno-lwp
2689
Richard Smith081ad4d2017-01-24 19:39:46 +00002690.. option:: -mlzcnt, -mno-lzcnt
2691
Richard Smith081ad4d2017-01-24 19:39:46 +00002692.. option:: -mmmx, -mno-mmx
2693
Craig Topper177a57c2017-02-08 07:57:01 +00002694.. option:: -mmovbe, -mno-movbe
2695
Gabor Buellaa51e0c22018-05-01 10:05:42 +00002696.. option:: -mmovdir64b, -mno-movdir64b
2697
Vedant Kumar368540f2018-08-23 17:55:03 +00002698.. option:: -mmovdiri, -mno-movdiri
2699
Craig Topperb16cb822017-02-08 07:56:42 +00002700.. option:: -mmpx, -mno-mpx
2701
Richard Smith081ad4d2017-01-24 19:39:46 +00002702.. option:: -mmwaitx, -mno-mwaitx
2703
Richard Smith081ad4d2017-01-24 19:39:46 +00002704.. option:: -mpclmul, -mno-pclmul
2705
Vedant Kumar368540f2018-08-23 17:55:03 +00002706.. option:: -mpconfig, -mno-pconfig
2707
Richard Smith081ad4d2017-01-24 19:39:46 +00002708.. option:: -mpku, -mno-pku
2709
Richard Smith081ad4d2017-01-24 19:39:46 +00002710.. option:: -mpopcnt, -mno-popcnt
2711
Craig Topperd2bf7b02017-02-08 08:23:40 +00002712.. option:: -mprefetchwt1, -mno-prefetchwt1
2713
Richard Smith081ad4d2017-01-24 19:39:46 +00002714.. option:: -mprfchw, -mno-prfchw
2715
Vedant Kumar368540f2018-08-23 17:55:03 +00002716.. option:: -mptwrite, -mno-ptwrite
2717
Craig Topper596527b2018-01-23 18:40:15 +00002718.. option:: -mrdpid, -mno-rdpid
2719
Richard Smith081ad4d2017-01-24 19:39:46 +00002720.. option:: -mrdrnd, -mno-rdrnd
2721
Richard Smith081ad4d2017-01-24 19:39:46 +00002722.. option:: -mrdseed, -mno-rdseed
2723
Craig Topper596527b2018-01-23 18:40:15 +00002724.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
2725
Richard Smith081ad4d2017-01-24 19:39:46 +00002726.. option:: -mrtm, -mno-rtm
2727
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002728.. option:: -msahf, -mno-sahf
2729
Craig Topper204ecff2017-02-08 08:23:17 +00002730.. option:: -msgx, -mno-sgx
2731
Richard Smith081ad4d2017-01-24 19:39:46 +00002732.. option:: -msha, -mno-sha
2733
Craig Topper188252d2017-12-11 21:09:16 +00002734.. option:: -mshstk, -mno-shstk
2735
Richard Smith081ad4d2017-01-24 19:39:46 +00002736.. option:: -msse, -mno-sse
2737
Richard Smith081ad4d2017-01-24 19:39:46 +00002738.. option:: -msse2, -mno-sse2
2739
Richard Smith081ad4d2017-01-24 19:39:46 +00002740.. option:: -msse3, -mno-sse3
2741
Richard Smith081ad4d2017-01-24 19:39:46 +00002742.. option:: -msse4.1, -mno-sse4.1
2743
Richard Smithb2c82a62017-01-27 01:54:42 +00002744.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002745.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00002746.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002747
Richard Smith081ad4d2017-01-24 19:39:46 +00002748.. option:: -msse4a, -mno-sse4a
2749
Richard Smith081ad4d2017-01-24 19:39:46 +00002750.. option:: -mssse3, -mno-ssse3
2751
Richard Smith081ad4d2017-01-24 19:39:46 +00002752.. option:: -mtbm, -mno-tbm
2753
Craig Topper287c8012018-01-03 18:29:12 +00002754.. option:: -mvaes, -mno-vaes
2755
2756.. option:: -mvpclmulqdq, -mno-vpclmulqdq
2757
Craig Topper42da9cb2018-04-23 21:41:06 +00002758.. option:: -mwaitpkg, -mno-waitpkg
2759
Gabor Buellaa0520162018-04-11 20:09:09 +00002760.. option:: -mwbnoinvd, -mno-wbnoinvd
2761
Richard Smith081ad4d2017-01-24 19:39:46 +00002762.. option:: -mx87, -m80387, -mno-x87
2763
Richard Smith081ad4d2017-01-24 19:39:46 +00002764.. option:: -mxop, -mno-xop
2765
Richard Smith081ad4d2017-01-24 19:39:46 +00002766.. option:: -mxsave, -mno-xsave
2767
Richard Smith081ad4d2017-01-24 19:39:46 +00002768.. option:: -mxsavec, -mno-xsavec
2769
Richard Smith081ad4d2017-01-24 19:39:46 +00002770.. option:: -mxsaveopt, -mno-xsaveopt
2771
Richard Smith081ad4d2017-01-24 19:39:46 +00002772.. option:: -mxsaves, -mno-xsaves
2773
Vedant Kumar368540f2018-08-23 17:55:03 +00002774RISCV
2775-----
2776.. option:: -mrelax, -mno-relax
2777
2778Enable linker relaxation
2779
Richard Smith081ad4d2017-01-24 19:39:46 +00002780Optimization level
2781~~~~~~~~~~~~~~~~~~
2782
2783Flags controlling how much optimization should be performed.
2784
Richard Smith081ad4d2017-01-24 19:39:46 +00002785.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2786
Richard Smith081ad4d2017-01-24 19:39:46 +00002787.. option:: -Ofast<arg>
2788
2789Debug information generation
2790~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2791
2792Flags controlling how much and what kind of debug information should be
2793generated.
2794
2795Kind and level of debug information
2796-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002797.. option:: -g, --debug, --debug=<arg>
2798
2799Generate source-level debug information
2800
Richard Smith081ad4d2017-01-24 19:39:46 +00002801.. option:: -gdwarf-2
2802
2803Generate source-level debug information with dwarf version 2
2804
Richard Smith081ad4d2017-01-24 19:39:46 +00002805.. option:: -gdwarf-3
2806
2807Generate source-level debug information with dwarf version 3
2808
Richard Smith081ad4d2017-01-24 19:39:46 +00002809.. option:: -gdwarf-4, -gdwarf
2810
2811Generate source-level debug information with dwarf version 4
2812
Richard Smith081ad4d2017-01-24 19:39:46 +00002813.. option:: -gdwarf-5
2814
2815Generate source-level debug information with dwarf version 5
2816
Richard Smith081ad4d2017-01-24 19:39:46 +00002817.. option:: -gfull
2818
Richard Smith081ad4d2017-01-24 19:39:46 +00002819.. option:: -gused
2820
2821Debug level
2822___________
Richard Smith081ad4d2017-01-24 19:39:46 +00002823.. option:: -g0
2824
Richard Smith081ad4d2017-01-24 19:39:46 +00002825.. option:: -g2
2826
Richard Smith081ad4d2017-01-24 19:39:46 +00002827.. option:: -g3
2828
Richard Smith081ad4d2017-01-24 19:39:46 +00002829.. option:: -ggdb0
2830
Richard Smith081ad4d2017-01-24 19:39:46 +00002831.. option:: -ggdb1
2832
Richard Smith081ad4d2017-01-24 19:39:46 +00002833.. option:: -ggdb2
2834
Richard Smith081ad4d2017-01-24 19:39:46 +00002835.. option:: -ggdb3
2836
Richard Smith081ad4d2017-01-24 19:39:46 +00002837.. option:: -gline-tables-only, -g1, -gmlt
2838
2839Emit debug line number tables only
2840
Richard Smith081ad4d2017-01-24 19:39:46 +00002841.. option:: -gmodules
2842
2843Generate debug info with external references to clang modules or precompiled headers
2844
2845Debugger to tune debug information for
2846______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00002847.. option:: -ggdb
2848
Richard Smith081ad4d2017-01-24 19:39:46 +00002849.. option:: -glldb
2850
Richard Smith081ad4d2017-01-24 19:39:46 +00002851.. option:: -gsce
2852
2853Debug information flags
2854-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002855.. option:: -gcolumn-info, -gno-column-info
2856
Richard Smith081ad4d2017-01-24 19:39:46 +00002857.. option:: -gdwarf-aranges
2858
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002859.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00002860
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002861Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00002862
Vedant Kumar368540f2018-08-23 17:55:03 +00002863.. option:: -ggnu-pubnames, -gno-gnu-pubnames
2864
2865.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00002866
Scott Linderde6beb02018-12-14 15:38:15 +00002867.. option:: -grecord-command-line, -grecord-gcc-switches, -gno-record-command-line, -gno-record-gcc-switches
Richard Smith081ad4d2017-01-24 19:39:46 +00002868
Richard Smith081ad4d2017-01-24 19:39:46 +00002869.. option:: -gsplit-dwarf
2870
Richard Smith081ad4d2017-01-24 19:39:46 +00002871.. option:: -gstrict-dwarf, -gno-strict-dwarf
2872
Craig Topperd23254a2017-07-20 17:52:48 +00002873.. option:: -gz
2874
2875DWARF debug sections compression type
2876
2877.. program:: clang1
2878.. option:: -gz=<arg>
2879.. program:: clang
2880
2881DWARF debug sections compression type
2882
Richard Smithc5b2e002017-01-27 02:08:37 +00002883Static analyzer flags
2884=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00002885
Richard Smithc5b2e002017-01-27 02:08:37 +00002886Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00002887
Richard Smithc5b2e002017-01-27 02:08:37 +00002888.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002889
Richard Smithc5b2e002017-01-27 02:08:37 +00002890Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00002891
2892Fortran compilation flags
2893=========================
2894
2895Flags that will be passed onto the ``gfortran`` compiler when Clang is given
2896a Fortran input.
2897
Richard Smithc5b2e002017-01-27 02:08:37 +00002898.. option:: -A<arg>, --assert <arg>, --assert=<arg>
2899
Richard Smith081ad4d2017-01-24 19:39:46 +00002900.. option:: -A-<arg>
2901
Richard Smith081ad4d2017-01-24 19:39:46 +00002902.. option:: -J<arg>
2903
Richard Smith081ad4d2017-01-24 19:39:46 +00002904.. option:: -cpp
2905
Richard Smith081ad4d2017-01-24 19:39:46 +00002906.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
2907
Richard Smith081ad4d2017-01-24 19:39:46 +00002908.. option:: -falign-commons, -fno-align-commons
2909
Richard Smith081ad4d2017-01-24 19:39:46 +00002910.. option:: -fall-intrinsics, -fno-all-intrinsics
2911
Richard Smith081ad4d2017-01-24 19:39:46 +00002912.. option:: -fautomatic, -fno-automatic
2913
Richard Smith081ad4d2017-01-24 19:39:46 +00002914.. option:: -fbackslash, -fno-backslash
2915
Richard Smith081ad4d2017-01-24 19:39:46 +00002916.. option:: -fbacktrace, -fno-backtrace
2917
Richard Smith081ad4d2017-01-24 19:39:46 +00002918.. option:: -fblas-matmul-limit=<arg>
2919
Richard Smith081ad4d2017-01-24 19:39:46 +00002920.. option:: -fbounds-check, -fno-bounds-check
2921
Richard Smith081ad4d2017-01-24 19:39:46 +00002922.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
2923
Richard Smith081ad4d2017-01-24 19:39:46 +00002924.. option:: -fcheck=<arg>
2925
Richard Smith081ad4d2017-01-24 19:39:46 +00002926.. option:: -fcoarray=<arg>
2927
Richard Smith081ad4d2017-01-24 19:39:46 +00002928.. option:: -fconvert=<arg>
2929
Richard Smith081ad4d2017-01-24 19:39:46 +00002930.. option:: -fcray-pointer, -fno-cray-pointer
2931
Richard Smith081ad4d2017-01-24 19:39:46 +00002932.. option:: -fd-lines-as-code, -fno-d-lines-as-code
2933
Richard Smith081ad4d2017-01-24 19:39:46 +00002934.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
2935
Richard Smith081ad4d2017-01-24 19:39:46 +00002936.. option:: -fdefault-double-8, -fno-default-double-8
2937
Richard Smith081ad4d2017-01-24 19:39:46 +00002938.. option:: -fdefault-integer-8, -fno-default-integer-8
2939
Richard Smith081ad4d2017-01-24 19:39:46 +00002940.. option:: -fdefault-real-8, -fno-default-real-8
2941
Richard Smith081ad4d2017-01-24 19:39:46 +00002942.. option:: -fdollar-ok, -fno-dollar-ok
2943
Richard Smith081ad4d2017-01-24 19:39:46 +00002944.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
2945
Richard Smith081ad4d2017-01-24 19:39:46 +00002946.. option:: -fdump-fortran-original, -fno-dump-fortran-original
2947
Richard Smith081ad4d2017-01-24 19:39:46 +00002948.. option:: -fdump-parse-tree, -fno-dump-parse-tree
2949
Richard Smith081ad4d2017-01-24 19:39:46 +00002950.. option:: -fexternal-blas, -fno-external-blas
2951
Richard Smith081ad4d2017-01-24 19:39:46 +00002952.. option:: -ff2c, -fno-f2c
2953
Richard Smith081ad4d2017-01-24 19:39:46 +00002954.. option:: -ffixed-form, -fno-fixed-form
2955
Richard Smith081ad4d2017-01-24 19:39:46 +00002956.. option:: -ffixed-line-length-<arg>
2957
Richard Smith081ad4d2017-01-24 19:39:46 +00002958.. option:: -ffpe-trap=<arg>
2959
Richard Smith081ad4d2017-01-24 19:39:46 +00002960.. option:: -ffree-form, -fno-free-form
2961
Richard Smith081ad4d2017-01-24 19:39:46 +00002962.. option:: -ffree-line-length-<arg>
2963
Richard Smith081ad4d2017-01-24 19:39:46 +00002964.. option:: -ffrontend-optimize, -fno-frontend-optimize
2965
Richard Smith081ad4d2017-01-24 19:39:46 +00002966.. option:: -fimplicit-none, -fno-implicit-none
2967
Richard Smith081ad4d2017-01-24 19:39:46 +00002968.. option:: -finit-character=<arg>
2969
Richard Smith081ad4d2017-01-24 19:39:46 +00002970.. option:: -finit-integer=<arg>
2971
Richard Smith081ad4d2017-01-24 19:39:46 +00002972.. option:: -finit-local-zero, -fno-init-local-zero
2973
Richard Smith081ad4d2017-01-24 19:39:46 +00002974.. option:: -finit-logical=<arg>
2975
Richard Smith081ad4d2017-01-24 19:39:46 +00002976.. option:: -finit-real=<arg>
2977
Richard Smith081ad4d2017-01-24 19:39:46 +00002978.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
2979
Richard Smith081ad4d2017-01-24 19:39:46 +00002980.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
2981
Richard Smith081ad4d2017-01-24 19:39:46 +00002982.. option:: -fmax-array-constructor=<arg>
2983
Richard Smith081ad4d2017-01-24 19:39:46 +00002984.. option:: -fmax-errors=<arg>
2985
Richard Smith081ad4d2017-01-24 19:39:46 +00002986.. option:: -fmax-identifier-length, -fno-max-identifier-length
2987
Richard Smith081ad4d2017-01-24 19:39:46 +00002988.. option:: -fmax-stack-var-size=<arg>
2989
Richard Smith081ad4d2017-01-24 19:39:46 +00002990.. option:: -fmax-subrecord-length=<arg>
2991
Richard Smith081ad4d2017-01-24 19:39:46 +00002992.. option:: -fmodule-private, -fno-module-private
2993
Richard Smith081ad4d2017-01-24 19:39:46 +00002994.. option:: -fpack-derived, -fno-pack-derived
2995
Richard Smith081ad4d2017-01-24 19:39:46 +00002996.. option:: -fprotect-parens, -fno-protect-parens
2997
Richard Smith081ad4d2017-01-24 19:39:46 +00002998.. option:: -frange-check, -fno-range-check
2999
Richard Smith081ad4d2017-01-24 19:39:46 +00003000.. option:: -freal-4-real-10, -fno-real-4-real-10
3001
Richard Smith081ad4d2017-01-24 19:39:46 +00003002.. option:: -freal-4-real-16, -fno-real-4-real-16
3003
Richard Smith081ad4d2017-01-24 19:39:46 +00003004.. option:: -freal-4-real-8, -fno-real-4-real-8
3005
Richard Smith081ad4d2017-01-24 19:39:46 +00003006.. option:: -freal-8-real-10, -fno-real-8-real-10
3007
Richard Smith081ad4d2017-01-24 19:39:46 +00003008.. option:: -freal-8-real-16, -fno-real-8-real-16
3009
Richard Smith081ad4d2017-01-24 19:39:46 +00003010.. option:: -freal-8-real-4, -fno-real-8-real-4
3011
Richard Smith081ad4d2017-01-24 19:39:46 +00003012.. option:: -frealloc-lhs, -fno-realloc-lhs
3013
Richard Smith081ad4d2017-01-24 19:39:46 +00003014.. option:: -frecord-marker=<arg>
3015
Richard Smith081ad4d2017-01-24 19:39:46 +00003016.. option:: -frecursive, -fno-recursive
3017
Richard Smith081ad4d2017-01-24 19:39:46 +00003018.. option:: -frepack-arrays, -fno-repack-arrays
3019
Richard Smith081ad4d2017-01-24 19:39:46 +00003020.. option:: -fsecond-underscore, -fno-second-underscore
3021
Richard Smith081ad4d2017-01-24 19:39:46 +00003022.. option:: -fsign-zero, -fno-sign-zero
3023
Richard Smith081ad4d2017-01-24 19:39:46 +00003024.. option:: -fstack-arrays, -fno-stack-arrays
3025
Richard Smith081ad4d2017-01-24 19:39:46 +00003026.. option:: -funderscoring, -fno-underscoring
3027
Richard Smith081ad4d2017-01-24 19:39:46 +00003028.. option:: -fwhole-file, -fno-whole-file
3029
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003030.. option:: -imultilib <arg>
3031
Richard Smith081ad4d2017-01-24 19:39:46 +00003032.. option:: -nocpp
3033
Richard Smith081ad4d2017-01-24 19:39:46 +00003034.. option:: -static-libgfortran
3035
Richard Smithc5b2e002017-01-27 02:08:37 +00003036Linker flags
3037============
3038Flags that are passed on to the linker
3039
3040.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3041
3042Add directory to library search path
3043
3044.. option:: -Mach
3045
3046.. option:: -T<script>
3047
3048Specify <script> as linker script
3049
Richard Smith78e23fd2017-04-13 22:39:49 +00003050.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003051
3052Set starting address of BSS to <addr>
3053
Richard Smith78e23fd2017-04-13 22:39:49 +00003054.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003055
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003056Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003057
Richard Smith78e23fd2017-04-13 22:39:49 +00003058.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003059
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003060Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003061
3062.. option:: -Wl,<arg>,<arg2>...
3063
3064Pass the comma separated arguments in <arg> to the linker
3065
3066.. option:: -X
3067
3068.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3069
3070Pass <arg> to the linker
3071
3072.. program:: clang1
3073.. option:: -Z
3074.. program:: clang
3075
3076.. option:: -e<arg>, --entry
3077
3078.. option:: -filelist <arg>
3079
Vedant Kumar368540f2018-08-23 17:55:03 +00003080.. option:: --hip-device-lib-path=<arg>
3081
3082HIP device library path
3083
3084.. option:: --hip-device-lib=<arg>
3085
3086HIP device library
3087
Richard Smithc5b2e002017-01-27 02:08:37 +00003088.. option:: -l<arg>
3089
3090.. option:: -r
3091
3092.. option:: -rpath <arg>
3093
3094.. option:: -s
3095
3096.. option:: -t
3097
3098.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3099
3100.. option:: -undef
3101
3102undef all system defines
3103
3104.. option:: -undefined<arg>, --no-undefined
3105
3106.. option:: -z <arg>
3107
3108Pass -z <arg> to the linker
3109