blob: 4c1fe07be3a6265873df7901262e1b20b4c757a0 [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
Petr Hosek08cb3422019-07-11 19:06:38 +0000349.. option:: -noprofilelib
350
Richard Smith081ad4d2017-01-24 19:39:46 +0000351.. option:: -noseglinkedit
352
Richard Smith081ad4d2017-01-24 19:39:46 +0000353.. option:: -nostartfiles
354
Richard Smith081ad4d2017-01-24 19:39:46 +0000355.. option:: -nostdinc, --no-standard-includes
356
Richard Smithb2c82a62017-01-27 01:54:42 +0000357.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000358.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000359.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000360
361Disable standard #include directories for the C++ standard library
362
Richard Smith081ad4d2017-01-24 19:39:46 +0000363.. option:: -nostdlib, --no-standard-libraries
364
Boris Kolpackovb150d242017-08-30 09:15:53 +0000365.. program:: clang1
366.. option:: -nostdlib++
367.. program:: clang
368
Richard Smith081ad4d2017-01-24 19:39:46 +0000369.. option:: -nostdlibinc
370
Richard Smith081ad4d2017-01-24 19:39:46 +0000371.. option:: -o<file>, --output <arg>, --output=<arg>
372
373Write output to <file>
374
Richard Smith081ad4d2017-01-24 19:39:46 +0000375.. option:: -objcmt-atomic-property
376
377Make migration to 'atomic' properties
378
Richard Smith081ad4d2017-01-24 19:39:46 +0000379.. option:: -objcmt-migrate-all
380
381Enable migration to modern ObjC
382
Richard Smith081ad4d2017-01-24 19:39:46 +0000383.. option:: -objcmt-migrate-annotation
384
385Enable migration to property and method annotations
386
Richard Smith081ad4d2017-01-24 19:39:46 +0000387.. option:: -objcmt-migrate-designated-init
388
389Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
390
Richard Smith081ad4d2017-01-24 19:39:46 +0000391.. option:: -objcmt-migrate-instancetype
392
393Enable migration to infer instancetype for method result type
394
Richard Smith081ad4d2017-01-24 19:39:46 +0000395.. option:: -objcmt-migrate-literals
396
397Enable migration to modern ObjC literals
398
Richard Smith081ad4d2017-01-24 19:39:46 +0000399.. option:: -objcmt-migrate-ns-macros
400
401Enable migration to NS\_ENUM/NS\_OPTIONS macros
402
Richard Smith081ad4d2017-01-24 19:39:46 +0000403.. option:: -objcmt-migrate-property
404
405Enable migration to modern ObjC property
406
Richard Smith081ad4d2017-01-24 19:39:46 +0000407.. option:: -objcmt-migrate-property-dot-syntax
408
409Enable migration of setter/getter messages to property-dot syntax
410
Richard Smith081ad4d2017-01-24 19:39:46 +0000411.. option:: -objcmt-migrate-protocol-conformance
412
413Enable migration to add protocol conformance on classes
414
Richard Smith081ad4d2017-01-24 19:39:46 +0000415.. option:: -objcmt-migrate-readonly-property
416
417Enable migration to modern ObjC readonly property
418
Richard Smith081ad4d2017-01-24 19:39:46 +0000419.. option:: -objcmt-migrate-readwrite-property
420
421Enable migration to modern ObjC readwrite property
422
Richard Smith081ad4d2017-01-24 19:39:46 +0000423.. option:: -objcmt-migrate-subscripting
424
425Enable migration to modern ObjC subscripting
426
Richard Smith081ad4d2017-01-24 19:39:46 +0000427.. option:: -objcmt-ns-nonatomic-iosonly
428
429Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
430
Richard Smith081ad4d2017-01-24 19:39:46 +0000431.. option:: -objcmt-returns-innerpointer-property
432
433Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
434
Richard Smith081ad4d2017-01-24 19:39:46 +0000435.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
436
437Only modify files with a filename contained in the provided directory path
438
Richard Smith081ad4d2017-01-24 19:39:46 +0000439.. option:: -object
440
Richard Smith081ad4d2017-01-24 19:39:46 +0000441.. option:: -p, --profile
442
Richard Smith081ad4d2017-01-24 19:39:46 +0000443.. option:: -pagezero\_size<arg>
444
Richard Smith081ad4d2017-01-24 19:39:46 +0000445.. option:: -pg
446
447Enable mcount instrumentation
448
Richard Smith081ad4d2017-01-24 19:39:46 +0000449.. option:: -pie
450
Richard Smith081ad4d2017-01-24 19:39:46 +0000451.. option:: -pipe, --pipe
452
453Use pipes between commands, when possible
454
Richard Smith081ad4d2017-01-24 19:39:46 +0000455.. option:: -prebind
456
Richard Smithb2c82a62017-01-27 01:54:42 +0000457.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000458.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000459.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000460
Richard Smith081ad4d2017-01-24 19:39:46 +0000461.. option:: -preload
462
Richard Smith081ad4d2017-01-24 19:39:46 +0000463.. option:: --print-diagnostic-categories
464
Vedant Kumar368540f2018-08-23 17:55:03 +0000465.. option:: -print-effective-triple, --print-effective-triple
466
467Print the effective target triple
468
Richard Smith081ad4d2017-01-24 19:39:46 +0000469.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
470
471Print the full library path of <file>
472
Richard Smith081ad4d2017-01-24 19:39:46 +0000473.. option:: -print-ivar-layout
474
475Enable Objective-C Ivar layout bitmap print trace
476
Richard Smith081ad4d2017-01-24 19:39:46 +0000477.. option:: -print-libgcc-file-name, --print-libgcc-file-name
478
479Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
480
Richard Smith081ad4d2017-01-24 19:39:46 +0000481.. option:: -print-multi-directory, --print-multi-directory
482
Richard Smith081ad4d2017-01-24 19:39:46 +0000483.. option:: -print-multi-lib, --print-multi-lib
484
Richard Smith081ad4d2017-01-24 19:39:46 +0000485.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
486
487Print the full program path of <name>
488
Richard Smith78e23fd2017-04-13 22:39:49 +0000489.. option:: -print-resource-dir, --print-resource-dir
490
491Print the resource directory pathname
492
Richard Smith081ad4d2017-01-24 19:39:46 +0000493.. option:: -print-search-dirs, --print-search-dirs
494
495Print the paths used for finding libraries and programs
496
Vedant Kumar368540f2018-08-23 17:55:03 +0000497.. option:: -print-target-triple, --print-target-triple
498
499Print the normalized target triple
500
Richard Smith081ad4d2017-01-24 19:39:46 +0000501.. option:: -private\_bundle
502
Richard Smith081ad4d2017-01-24 19:39:46 +0000503.. option:: -pthread, -no-pthread
504
505Support POSIX threads in generated code
506
Richard Smith081ad4d2017-01-24 19:39:46 +0000507.. option:: -pthreads
508
Richard Smith081ad4d2017-01-24 19:39:46 +0000509.. option:: -rdynamic
510
Richard Smith081ad4d2017-01-24 19:39:46 +0000511.. option:: -read\_only\_relocs <arg>
512
Richard Smith081ad4d2017-01-24 19:39:46 +0000513.. option:: -relocatable-pch, --relocatable-pch
514
515Whether to build a relocatable precompiled header
516
Richard Smith081ad4d2017-01-24 19:39:46 +0000517.. option:: -remap
518
Richard Smith081ad4d2017-01-24 19:39:46 +0000519.. option:: -rewrite-legacy-objc
520
521Rewrite Legacy Objective-C source to C++
522
Richard Smith081ad4d2017-01-24 19:39:46 +0000523.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
524
525Compiler runtime library to use
526
Richard Smith081ad4d2017-01-24 19:39:46 +0000527.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
528
529Save llvm statistics.
530
Richard Smith081ad4d2017-01-24 19:39:46 +0000531.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
532
533Save intermediate compilation results.
534
Richard Smith081ad4d2017-01-24 19:39:46 +0000535.. option:: -sectalign <arg1> <arg2> <arg3>
536
Richard Smith081ad4d2017-01-24 19:39:46 +0000537.. option:: -sectcreate <arg1> <arg2> <arg3>
538
Richard Smith081ad4d2017-01-24 19:39:46 +0000539.. option:: -sectobjectsymbols <arg1> <arg2>
540
Richard Smith081ad4d2017-01-24 19:39:46 +0000541.. option:: -sectorder <arg1> <arg2> <arg3>
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -seg1addr<arg>
544
Richard Smith081ad4d2017-01-24 19:39:46 +0000545.. option:: -seg\_addr\_table <arg>
546
Richard Smithb2c82a62017-01-27 01:54:42 +0000547.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000548.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000549.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000550
Richard Smith081ad4d2017-01-24 19:39:46 +0000551.. option:: -segaddr <arg1> <arg2>
552
Richard Smith081ad4d2017-01-24 19:39:46 +0000553.. option:: -segcreate <arg1> <arg2> <arg3>
554
Richard Smith081ad4d2017-01-24 19:39:46 +0000555.. option:: -seglinkedit
556
Richard Smith081ad4d2017-01-24 19:39:46 +0000557.. option:: -segprot <arg1> <arg2> <arg3>
558
Richard Smith081ad4d2017-01-24 19:39:46 +0000559.. option:: -segs\_read\_<arg>
560
Richard Smithb2c82a62017-01-27 01:54:42 +0000561.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000562.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000563.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000564
Richard Smithb2c82a62017-01-27 01:54:42 +0000565.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000566.. option:: -segs\_read\_write\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000567.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000568
Richard Smith081ad4d2017-01-24 19:39:46 +0000569.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
570
571Serialize compiler diagnostics to a file
572
Richard Smith081ad4d2017-01-24 19:39:46 +0000573.. option:: -shared, --shared
574
Richard Smith081ad4d2017-01-24 19:39:46 +0000575.. option:: -shared-libgcc
576
Craig Topper16418662017-11-20 18:07:43 +0000577.. option:: -shared-libsan, -shared-libasan
578
Vedant Kumar368540f2018-08-23 17:55:03 +0000579Dynamically link the sanitizer runtime
580
Richard Smith081ad4d2017-01-24 19:39:46 +0000581.. option:: -single\_module
582
Richard Smith081ad4d2017-01-24 19:39:46 +0000583.. option:: -specs=<arg>, --specs=<arg>
584
Richard Smith081ad4d2017-01-24 19:39:46 +0000585.. option:: -static, --static
586
Richard Smith081ad4d2017-01-24 19:39:46 +0000587.. option:: -static-libgcc
588
Craig Topper16418662017-11-20 18:07:43 +0000589.. option:: -static-libsan
590
Vedant Kumar368540f2018-08-23 17:55:03 +0000591Statically link the sanitizer runtime
592
Richard Smith081ad4d2017-01-24 19:39:46 +0000593.. option:: -static-libstdc++
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -std-default=<arg>
596
Richard Smith081ad4d2017-01-24 19:39:46 +0000597.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
598
599C++ standard library to use
600
Richard Smith081ad4d2017-01-24 19:39:46 +0000601.. option:: -sub\_library<arg>
602
Richard Smithb2c82a62017-01-27 01:54:42 +0000603.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000604.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000605.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000606
Richard Smith081ad4d2017-01-24 19:39:46 +0000607.. option:: --sysroot=<arg>, --sysroot <arg>
608
Richard Smith081ad4d2017-01-24 19:39:46 +0000609.. option:: --target-help
610
Richard Smith081ad4d2017-01-24 19:39:46 +0000611.. option:: --target=<arg>, -target <arg>
612
613Generate code for the given target
614
Ziang Wanaf857b92019-06-14 21:42:21 +0000615.. option:: --print-supported-cpus
616
617Print supported cpu models for the given target
618
Richard Smith081ad4d2017-01-24 19:39:46 +0000619.. option:: -time
620
621Time individual commands
622
Richard Smith081ad4d2017-01-24 19:39:46 +0000623.. option:: -traditional, --traditional
624
Richard Smith081ad4d2017-01-24 19:39:46 +0000625.. option:: -traditional-cpp, --traditional-cpp
626
627Enable some traditional CPP emulation
628
Richard Smith081ad4d2017-01-24 19:39:46 +0000629.. option:: -twolevel\_namespace
630
Richard Smithb2c82a62017-01-27 01:54:42 +0000631.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000632.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000633.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000634
Richard Smith081ad4d2017-01-24 19:39:46 +0000635.. option:: -umbrella <arg>
636
Richard Smith081ad4d2017-01-24 19:39:46 +0000637.. option:: -unexported\_symbols\_list <arg>
638
Richard Smith081ad4d2017-01-24 19:39:46 +0000639.. option:: -v, --verbose
640
641Show commands to run and use verbose output
642
Richard Smith081ad4d2017-01-24 19:39:46 +0000643.. option:: --verify-debug-info
644
645Verify the binary representation of debug output
646
Richard Smith081ad4d2017-01-24 19:39:46 +0000647.. option:: --version
648
Craig Topper16418662017-11-20 18:07:43 +0000649Print version information
650
Richard Smith081ad4d2017-01-24 19:39:46 +0000651.. option:: -w, --no-warnings
652
653Suppress all warnings
654
Richard Smith081ad4d2017-01-24 19:39:46 +0000655.. option:: -weak-l<arg>
656
Richard Smith081ad4d2017-01-24 19:39:46 +0000657.. option:: -weak\_framework <arg>
658
Richard Smithb2c82a62017-01-27 01:54:42 +0000659.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000660.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000661.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000662
Richard Smithb2c82a62017-01-27 01:54:42 +0000663.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000664.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000665.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000666
Richard Smith081ad4d2017-01-24 19:39:46 +0000667.. option:: -whatsloaded
668
Richard Smith081ad4d2017-01-24 19:39:46 +0000669.. option:: -whyload
670
Richard Smith081ad4d2017-01-24 19:39:46 +0000671.. option:: -working-directory<arg>, -working-directory=<arg>
672
673Resolve file paths relative to the specified directory
674
Richard Smith081ad4d2017-01-24 19:39:46 +0000675.. option:: -x<language>, --language <arg>, --language=<arg>
676
677Treat subsequent input files as having type <language>
678
Richard Smith081ad4d2017-01-24 19:39:46 +0000679.. option:: -y<arg>
680
681Actions
682=======
683The action to perform on the input.
684
Richard Smith081ad4d2017-01-24 19:39:46 +0000685.. option:: -E, --preprocess
686
687Only run the preprocessor
688
Richard Smith081ad4d2017-01-24 19:39:46 +0000689.. option:: -S, --assemble
690
691Only run preprocess and compilation steps
692
Richard Smithc5b2e002017-01-27 02:08:37 +0000693.. option:: -c, --compile
694
695Only run preprocess, compile, and assemble steps
696
Richard Smith081ad4d2017-01-24 19:39:46 +0000697.. option:: -emit-llvm
698
699Use the LLVM representation for assembler and object files
700
Richard Smith081ad4d2017-01-24 19:39:46 +0000701.. option:: -fsyntax-only
702
Richard Smith081ad4d2017-01-24 19:39:46 +0000703.. option:: -module-file-info
704
705Provide information about a particular module file
706
Richard Smith081ad4d2017-01-24 19:39:46 +0000707.. option:: --precompile
708
709Only precompile the input
710
Richard Smith081ad4d2017-01-24 19:39:46 +0000711.. option:: -rewrite-objc
712
713Rewrite Objective-C source to C++
714
Richard Smith081ad4d2017-01-24 19:39:46 +0000715.. option:: -verify-pch
716
717Load and verify that a pre-compiled header file is not stale
718
719Compilation flags
720=================
721
722Flags controlling the behavior of Clang during compilation. These flags have
723no effect during actions that do not perform compilation.
724
Richard Smithc5b2e002017-01-27 02:08:37 +0000725.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000726
Richard Smithc5b2e002017-01-27 02:08:37 +0000727Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000728
Richard Smith081ad4d2017-01-24 19:39:46 +0000729.. option:: -Xclang <arg>
730
731Pass <arg> to the clang compiler
732
Boris Kolpackovb150d242017-08-30 09:15:53 +0000733.. option:: -fclang-abi-compat=<version>
734
735Attempt to match the ABI of Clang <version>
736
Richard Smith081ad4d2017-01-24 19:39:46 +0000737.. option:: -fcomment-block-commands=<arg>,<arg2>...
738
739Treat each comma separated argument in <arg> as a documentation comment block command
740
Vedant Kumar368540f2018-08-23 17:55:03 +0000741.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
742
743Require member pointer base types to be complete if they would be significant under the Microsoft ABI
744
745.. option:: -fcrash-diagnostics-dir=<arg>
746
Richard Smith081ad4d2017-01-24 19:39:46 +0000747.. option:: -fdeclspec, -fno-declspec
748
749Allow \_\_declspec as a keyword
750
Richard Smith081ad4d2017-01-24 19:39:46 +0000751.. option:: -fdepfile-entry=<arg>
752
Richard Smith081ad4d2017-01-24 19:39:46 +0000753.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
754
Richard Smith081ad4d2017-01-24 19:39:46 +0000755.. option:: -fdiagnostics-format=<arg>
756
Richard Smith081ad4d2017-01-24 19:39:46 +0000757.. option:: -fdiagnostics-parseable-fixits
758
759Print fix-its in machine parseable form
760
Richard Smith081ad4d2017-01-24 19:39:46 +0000761.. option:: -fdiagnostics-print-source-range-info
762
763Print source range spans in numeric form
764
Richard Smith081ad4d2017-01-24 19:39:46 +0000765.. option:: -fdiagnostics-show-category=<arg>
766
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000767.. option:: -fdiscard-value-names, -fno-discard-value-names
768
769Discard value names in LLVM IR
770
771.. option:: -fexperimental-isel, -fno-experimental-isel
772
773Enables the experimental global instruction selector
774
Richard Smith081ad4d2017-01-24 19:39:46 +0000775.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
776
777Enables an experimental new pass manager in LLVM.
778
Craig Topper16418662017-11-20 18:07:43 +0000779.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
780
Vedant Kumar368540f2018-08-23 17:55:03 +0000781Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Craig Topper16418662017-11-20 18:07:43 +0000782
Richard Smith081ad4d2017-01-24 19:39:46 +0000783.. option:: -finline-functions, -fno-inline-functions
784
785Inline suitable functions
786
Richard Smith081ad4d2017-01-24 19:39:46 +0000787.. option:: -finline-hint-functions
788
789Inline functions which are (explicitly or implicitly) marked inline
790
Richard Smith081ad4d2017-01-24 19:39:46 +0000791.. option:: -fno-crash-diagnostics
792
Richard Smith78e23fd2017-04-13 22:39:49 +0000793Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
794
Richard Smith081ad4d2017-01-24 19:39:46 +0000795.. option:: -fno-sanitize-blacklist
796
797Don't use blacklist file for sanitizers
798
Richard Smith081ad4d2017-01-24 19:39:46 +0000799.. option:: -fparse-all-comments
800
Scott Linderde6beb02018-12-14 15:38:15 +0000801.. option:: -frecord-command-line, -frecord-gcc-switches, -fno-record-command-line, -fno-record-gcc-switches
802
803Generate a section named ".GCC.command.line" containing the clang driver
804command-line. After linking, the section may contain multiple command lines,
805which will be individually terminated by null bytes. Separate arguments within
806a command line are combined with spaces; spaces and backslashes within an
807argument are escaped with backslashes. This format differs from the format of
808the equivalent section produced by GCC with the -frecord-gcc-switches flag.
809This option is currently only supported on ELF targets.
810
Richard Smith081ad4d2017-01-24 19:39:46 +0000811.. option:: -fsanitize-address-field-padding=<arg>
812
813Level of field padding for AddressSanitizer
814
Craig Topperd23254a2017-07-20 17:52:48 +0000815.. option:: -fsanitize-address-globals-dead-stripping
816
817Enable linker dead stripping of globals in AddressSanitizer
818
Vitaly Buka8076c572018-12-05 01:44:31 +0000819.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
820
821Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
822
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000823.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000824
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000825Enable "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.
826
827An 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 +0000828
Richard Smith081ad4d2017-01-24 19:39:46 +0000829.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
830
831Enable use-after-scope detection in AddressSanitizer
832
Richard Smith081ad4d2017-01-24 19:39:46 +0000833.. option:: -fsanitize-blacklist=<arg>
834
835Path to blacklist file for sanitizers
836
Richard Smith081ad4d2017-01-24 19:39:46 +0000837.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
838
839Enable control flow integrity (CFI) checks for cross-DSO calls.
840
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000841.. option:: -fsanitize-cfi-icall-generalize-pointers
842
Craig Topper16418662017-11-20 18:07:43 +0000843Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000844
Richard Smith081ad4d2017-01-24 19:39:46 +0000845.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
846
847Specify the type of coverage instrumentation for Sanitizers
848
Richard Smith081ad4d2017-01-24 19:39:46 +0000849.. option:: -fsanitize-link-c++-runtime
850
Richard Smith081ad4d2017-01-24 19:39:46 +0000851.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
852
853Enable origins tracking in MemorySanitizer
854
Richard Smithb2c82a62017-01-27 01:54:42 +0000855.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000856.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000857.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000858
859Enable origins tracking in MemorySanitizer
860
Craig Topper16418662017-11-20 18:07:43 +0000861.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000862
863Enable use-after-destroy detection in MemorySanitizer
864
Boris Kolpackovb150d242017-08-30 09:15:53 +0000865.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
866
Richard Smith081ad4d2017-01-24 19:39:46 +0000867.. option:: -fsanitize-recover, -fno-sanitize-recover
868
Richard Smithb2c82a62017-01-27 01:54:42 +0000869.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000870.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +0000871.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000872
873Enable recovery for specified sanitizers
874
Richard Smith081ad4d2017-01-24 19:39:46 +0000875.. option:: -fsanitize-stats, -fno-sanitize-stats
876
877Enable sanitizer statistics gathering.
878
Richard Smith081ad4d2017-01-24 19:39:46 +0000879.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
880
881Enable atomic operations instrumentation in ThreadSanitizer (default)
882
Richard Smith081ad4d2017-01-24 19:39:46 +0000883.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
884
885Enable function entry/exit instrumentation in ThreadSanitizer (default)
886
Richard Smith081ad4d2017-01-24 19:39:46 +0000887.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
888
889Enable memory access instrumentation in ThreadSanitizer (default)
890
Richard Smith081ad4d2017-01-24 19:39:46 +0000891.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
892
893Enable trapping for specified sanitizers
894
Richard Smith081ad4d2017-01-24 19:39:46 +0000895.. option:: -fsanitize-undefined-strip-path-components=<number>
896
897Strip (or keep only, if negative) a given number of path components when emitting check metadata.
898
Richard Smith081ad4d2017-01-24 19:39:46 +0000899.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
900
Richard Smith081ad4d2017-01-24 19:39:46 +0000901.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
902
903Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
904
Vedant Kumar368540f2018-08-23 17:55:03 +0000905.. option:: -moutline, -mno-outline
906
907Enable function outlining (AArch64 only)
908
Richard Smith081ad4d2017-01-24 19:39:46 +0000909.. option:: --param <arg>, --param=<arg>
910
Richard Smith081ad4d2017-01-24 19:39:46 +0000911.. option:: -std=<arg>, --std=<arg>, --std <arg>
912
913Language standard to compile for
914
Richard Smithc5b2e002017-01-27 02:08:37 +0000915Preprocessor flags
916~~~~~~~~~~~~~~~~~~
917
918Flags controlling the behavior of the Clang preprocessor.
919
920.. option:: -C, --comments
921
922Include comments in preprocessed output
923
924.. option:: -CC, --comments-in-macros
925
926Include comments from within macros in preprocessed output
927
928.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
929
930Define <macro> to <value> (or 1 if <value> omitted)
931
932.. option:: -H, --trace-includes
933
934Show header includes and nesting depth
935
936.. option:: -P, --no-line-commands
937
938Disable linemarker output in -E mode
939
940.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
941
942Undefine macro <macro>
943
944.. option:: -Wp,<arg>,<arg2>...
945
946Pass the comma separated arguments in <arg> to the preprocessor
947
948.. option:: -Xpreprocessor <arg>
949
950Pass <arg> to the preprocessor
951
Richard Smith081ad4d2017-01-24 19:39:46 +0000952Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +0000953-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +0000954
955Flags controlling how ``#include``\s are resolved to files.
956
Richard Smithc5b2e002017-01-27 02:08:37 +0000957.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000958
959Add directory to include search path
960
Richard Smith081ad4d2017-01-24 19:39:46 +0000961.. option:: -I-, --include-barrier
962
Richard Smithc5b2e002017-01-27 02:08:37 +0000963Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
964
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000965.. option:: --cuda-path-ignore-env
966
967Ignore environment variables to detect CUDA installation
968
Richard Smith081ad4d2017-01-24 19:39:46 +0000969.. option:: --cuda-path=<arg>
970
971CUDA installation path
972
Richard Smith081ad4d2017-01-24 19:39:46 +0000973.. option:: -cxx-isystem<directory>
974
975Add directory to the C++ SYSTEM include search path
976
Richard Smith081ad4d2017-01-24 19:39:46 +0000977.. option:: -fbuild-session-file=<file>
978
979Use the last modification time of <file> as the build session timestamp
980
Richard Smith081ad4d2017-01-24 19:39:46 +0000981.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
982
983Time when the current build session started
984
Boris Kolpackovb150d242017-08-30 09:15:53 +0000985.. option:: -fmodule-file=\[<name>=\]<file>
986
987Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
988
Richard Smith081ad4d2017-01-24 19:39:46 +0000989.. option:: -fmodules-cache-path=<directory>
990
991Specify the module cache path
992
Richard Smith081ad4d2017-01-24 19:39:46 +0000993.. option:: -fmodules-disable-diagnostic-validation
994
995Disable validation of the diagnostic options when loading the module
996
Richard Smith081ad4d2017-01-24 19:39:46 +0000997.. option:: -fmodules-prune-after=<seconds>
998
999Specify the interval (in seconds) after which a module file will be considered unused
1000
Richard Smith081ad4d2017-01-24 19:39:46 +00001001.. option:: -fmodules-prune-interval=<seconds>
1002
1003Specify the interval (in seconds) between attempts to prune the module cache
1004
Richard Smith081ad4d2017-01-24 19:39:46 +00001005.. option:: -fmodules-user-build-path <directory>
1006
1007Specify the module user build path
1008
Richard Smith081ad4d2017-01-24 19:39:46 +00001009.. option:: -fmodules-validate-once-per-build-session
1010
1011Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1012
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001013.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
Richard Smith081ad4d2017-01-24 19:39:46 +00001014
1015Validate the system headers that a module depends on when loading the module
1016
Richard Smith081ad4d2017-01-24 19:39:46 +00001017.. option:: -fprebuilt-module-path=<directory>
1018
1019Specify the prebuilt module path
1020
Richard Smith081ad4d2017-01-24 19:39:46 +00001021.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1022
1023Add directory to AFTER include search path
1024
Richard Smith081ad4d2017-01-24 19:39:46 +00001025.. option:: -iframework<arg>
1026
1027Add directory to SYSTEM framework search path
1028
Richard Smith78e23fd2017-04-13 22:39:49 +00001029.. option:: -iframeworkwithsysroot<directory>
1030
1031Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1032
Richard Smith081ad4d2017-01-24 19:39:46 +00001033.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1034
1035Include macros from file before parsing
1036
Richard Smith081ad4d2017-01-24 19:39:46 +00001037.. option:: -include<file>, --include<file>, --include=<arg>
1038
1039Include file before parsing
1040
Richard Smith081ad4d2017-01-24 19:39:46 +00001041.. option:: -include-pch <file>
1042
1043Include precompiled header file
1044
Richard Smith081ad4d2017-01-24 19:39:46 +00001045.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1046
1047Set the -iwithprefix/-iwithprefixbefore prefix
1048
Richard Smith081ad4d2017-01-24 19:39:46 +00001049.. option:: -iquote<directory>
1050
1051Add directory to QUOTE include search path
1052
Richard Smith081ad4d2017-01-24 19:39:46 +00001053.. option:: -isysroot<dir>
1054
1055Set the system root directory (usually /)
1056
Richard Smith081ad4d2017-01-24 19:39:46 +00001057.. option:: -isystem<directory>
1058
1059Add directory to SYSTEM include search path
1060
Richard Smith081ad4d2017-01-24 19:39:46 +00001061.. option:: -isystem-after<directory>
1062
1063Add directory to end of the SYSTEM include search path
1064
Richard Smith081ad4d2017-01-24 19:39:46 +00001065.. option:: -ivfsoverlay<arg>
1066
1067Overlay the virtual filesystem described by file over the real file system
1068
Richard Smith081ad4d2017-01-24 19:39:46 +00001069.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1070
1071Set directory to SYSTEM include search path with prefix
1072
Richard Smith081ad4d2017-01-24 19:39:46 +00001073.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1074
1075Set directory to include search path with prefix
1076
Richard Smith081ad4d2017-01-24 19:39:46 +00001077.. option:: -iwithsysroot<directory>
1078
1079Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1080
Richard Smith081ad4d2017-01-24 19:39:46 +00001081.. option:: --ptxas-path=<arg>
1082
1083Path to ptxas (used for compiling CUDA code)
1084
Richard Smith081ad4d2017-01-24 19:39:46 +00001085.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1086
1087Treat all #include paths starting with <prefix> as including a system header.
1088
1089Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +00001090--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001091
1092Flags controlling generation of a dependency file for ``make``-like build
1093systems.
1094
Richard Smith081ad4d2017-01-24 19:39:46 +00001095.. option:: -M, --dependencies
1096
1097Like -MD, but also implies -E and writes to stdout by default
1098
Richard Smith081ad4d2017-01-24 19:39:46 +00001099.. option:: -MD, --write-dependencies
1100
1101Write a depfile containing user and system headers
1102
Richard Smith081ad4d2017-01-24 19:39:46 +00001103.. option:: -MF<file>
1104
1105Write depfile output from -MMD, -MD, -MM, or -M to <file>
1106
Richard Smith081ad4d2017-01-24 19:39:46 +00001107.. option:: -MG, --print-missing-file-dependencies
1108
1109Add missing headers to depfile
1110
Richard Smith081ad4d2017-01-24 19:39:46 +00001111.. option:: -MJ<arg>
1112
1113Write a compilation database entry per input
1114
Richard Smith081ad4d2017-01-24 19:39:46 +00001115.. option:: -MM, --user-dependencies
1116
1117Like -MMD, but also implies -E and writes to stdout by default
1118
Richard Smith081ad4d2017-01-24 19:39:46 +00001119.. option:: -MMD, --write-user-dependencies
1120
1121Write a depfile containing user headers
1122
Richard Smith081ad4d2017-01-24 19:39:46 +00001123.. option:: -MP
1124
1125Create phony target for each dependency (other than main file)
1126
Richard Smith081ad4d2017-01-24 19:39:46 +00001127.. option:: -MQ<arg>
1128
1129Specify name of main file output to quote in depfile
1130
Richard Smith081ad4d2017-01-24 19:39:46 +00001131.. option:: -MT<arg>
1132
1133Specify name of main file output in depfile
1134
Richard Smith081ad4d2017-01-24 19:39:46 +00001135.. option:: -MV
1136
1137Use NMake/Jom format for the depfile
1138
1139Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001140--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001141
1142Flags allowing the state of the preprocessor to be dumped in various ways.
1143
Richard Smith081ad4d2017-01-24 19:39:46 +00001144.. option:: -d
1145
Richard Smithb2c82a62017-01-27 01:54:42 +00001146.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001147.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001148.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001149
Richard Smith081ad4d2017-01-24 19:39:46 +00001150.. option:: -dA
1151
Richard Smith081ad4d2017-01-24 19:39:46 +00001152.. option:: -dD
1153
1154Print macro definitions in -E mode in addition to normal output
1155
Richard Smith081ad4d2017-01-24 19:39:46 +00001156.. option:: -dI
1157
1158Print include directives in -E mode in addition to normal output
1159
Richard Smith081ad4d2017-01-24 19:39:46 +00001160.. option:: -dM
1161
1162Print macro definitions in -E mode instead of normal output
1163
1164Diagnostic flags
1165~~~~~~~~~~~~~~~~
1166
1167Flags controlling which warnings, errors, and remarks Clang will generate.
1168See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1169
Richard Smith081ad4d2017-01-24 19:39:46 +00001170.. option:: -R<remark>
1171
1172Enable the specified remark
1173
Richard Smith081ad4d2017-01-24 19:39:46 +00001174.. option:: -Rpass-analysis=<arg>
1175
1176Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1177
Richard Smith081ad4d2017-01-24 19:39:46 +00001178.. option:: -Rpass-missed=<arg>
1179
1180Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1181
Richard Smith081ad4d2017-01-24 19:39:46 +00001182.. option:: -Rpass=<arg>
1183
1184Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1185
Richard Smith081ad4d2017-01-24 19:39:46 +00001186.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1187
1188Enable the specified warning
1189
Richard Smith081ad4d2017-01-24 19:39:46 +00001190.. option:: -Wdeprecated, -Wno-deprecated
1191
Richard Smithc5b2e002017-01-27 02:08:37 +00001192Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001193
Richard Smith081ad4d2017-01-24 19:39:46 +00001194.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1195
Richard Smith081ad4d2017-01-24 19:39:46 +00001196Target-independent compilation options
1197~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001198.. option:: -Wframe-larger-than=<arg>
1199
Richard Smith081ad4d2017-01-24 19:39:46 +00001200.. option:: -fPIC, -fno-PIC
1201
Richard Smith081ad4d2017-01-24 19:39:46 +00001202.. option:: -fPIE, -fno-PIE
1203
Richard Smith081ad4d2017-01-24 19:39:46 +00001204.. option:: -faccess-control, -fno-access-control
1205
Vedant Kumar368540f2018-08-23 17:55:03 +00001206.. option:: -faddrsig, -fno-addrsig
1207
1208Emit an address-significance table
1209
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001210.. option:: -falign-functions, -fno-align-functions
1211
1212.. program:: clang1
1213.. option:: -falign-functions=<arg>
1214.. program:: clang
1215
Richard Smithb2c82a62017-01-27 01:54:42 +00001216.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001217.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001218.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001219
1220Enable C++17 aligned allocation functions
1221
Craig Topperd23254a2017-07-20 17:52:48 +00001222.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1223
1224Treat editor placeholders as valid source code
1225
Richard Smith081ad4d2017-01-24 19:39:46 +00001226.. option:: -fallow-unsupported
1227
Richard Smith78e23fd2017-04-13 22:39:49 +00001228.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001229
Richard Smith081ad4d2017-01-24 19:39:46 +00001230.. option:: -fansi-escape-codes
1231
1232Use ANSI escape codes for diagnostics
1233
Richard Smith081ad4d2017-01-24 19:39:46 +00001234.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1235
1236Use Apple's kernel extensions ABI
1237
Richard Smith081ad4d2017-01-24 19:39:46 +00001238.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1239
1240Enable Apple gcc-compatible #pragma pack handling
1241
Richard Smith081ad4d2017-01-24 19:39:46 +00001242.. option:: -fapplication-extension, -fno-application-extension
1243
1244Restrict code to those available for App Extensions
1245
Richard Smith081ad4d2017-01-24 19:39:46 +00001246.. option:: -fasm, -fno-asm
1247
Richard Smith081ad4d2017-01-24 19:39:46 +00001248.. option:: -fasm-blocks, -fno-asm-blocks
1249
Richard Smith081ad4d2017-01-24 19:39:46 +00001250.. option:: -fassociative-math, -fno-associative-math
1251
Richard Smith081ad4d2017-01-24 19:39:46 +00001252.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1253
Richard Smith081ad4d2017-01-24 19:39:46 +00001254.. option:: -fast
1255
Richard Smith081ad4d2017-01-24 19:39:46 +00001256.. option:: -fastcp
1257
Richard Smith081ad4d2017-01-24 19:39:46 +00001258.. option:: -fastf
1259
Richard Smith081ad4d2017-01-24 19:39:46 +00001260.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262.. option:: -fautolink, -fno-autolink
1263
Richard Smith081ad4d2017-01-24 19:39:46 +00001264.. option:: -fblocks, -fno-blocks
1265
1266Enable the 'blocks' language feature
1267
Richard Smith081ad4d2017-01-24 19:39:46 +00001268.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1269
Richard Smith081ad4d2017-01-24 19:39:46 +00001270.. option:: -fborland-extensions, -fno-borland-extensions
1271
1272Accept non-standard constructs supported by the Borland compiler
1273
Richard Smith081ad4d2017-01-24 19:39:46 +00001274.. option:: -fbracket-depth=<arg>
1275
Richard Smith081ad4d2017-01-24 19:39:46 +00001276.. option:: -fbuiltin, -fno-builtin
1277
Richard Smith081ad4d2017-01-24 19:39:46 +00001278.. option:: -fbuiltin-module-map
1279
1280Load the clang builtins module map file.
1281
Vedant Kumar368540f2018-08-23 17:55:03 +00001282.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1283
1284Enable C++ static destructor registration (the default)
1285
Richard Smith081ad4d2017-01-24 19:39:46 +00001286.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1287
Craig Topper596527b2018-01-23 18:40:15 +00001288.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1289
1290Instrument control-flow architecture protection. Options: return, branch, full, none.
1291
Vedant Kumar368540f2018-08-23 17:55:03 +00001292.. option:: -fchar8\_t, -fno-char8\_t
1293
1294Enable C++ builtin type char8\_t
1295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1297
Richard Smith081ad4d2017-01-24 19:39:46 +00001298.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1299
1300Use colors in diagnostics
1301
Richard Smith081ad4d2017-01-24 19:39:46 +00001302.. option:: -fcommon, -fno-common
1303
Richard Smith081ad4d2017-01-24 19:39:46 +00001304.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1305
Richard Smith081ad4d2017-01-24 19:39:46 +00001306.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1307
Richard Smith081ad4d2017-01-24 19:39:46 +00001308.. option:: -fconstant-string-class=<arg>
1309
Richard Smith081ad4d2017-01-24 19:39:46 +00001310.. option:: -fconstexpr-backtrace-limit=<arg>
1311
Richard Smith081ad4d2017-01-24 19:39:46 +00001312.. option:: -fconstexpr-depth=<arg>
1313
Richard Smith081ad4d2017-01-24 19:39:46 +00001314.. option:: -fconstexpr-steps=<arg>
1315
Richard Smith081ad4d2017-01-24 19:39:46 +00001316.. option:: -fcoroutines-ts, -fno-coroutines-ts
1317
1318Enable support for the C++ Coroutines TS
1319
Richard Smith081ad4d2017-01-24 19:39:46 +00001320.. option:: -fcoverage-mapping, -fno-coverage-mapping
1321
1322Generate coverage mapping to enable code coverage analysis
1323
Richard Smith081ad4d2017-01-24 19:39:46 +00001324.. option:: -fcreate-profile
1325
Richard Smith081ad4d2017-01-24 19:39:46 +00001326.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1327
1328Enable C++ exceptions
1329
Richard Smith081ad4d2017-01-24 19:39:46 +00001330.. option:: -fcxx-modules, -fno-cxx-modules
1331
Richard Smith081ad4d2017-01-24 19:39:46 +00001332.. option:: -fdata-sections, -fno-data-sections
1333
1334Place each data in its own section (ELF Only)
1335
Richard Smith081ad4d2017-01-24 19:39:46 +00001336.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1337
1338Emit extra debug info to make sample profile more accurate.
1339
Richard Smith78e23fd2017-04-13 22:39:49 +00001340.. option:: -fdebug-macro, -fno-debug-macro
1341
1342Emit macro debug information
1343
Richard Smith081ad4d2017-01-24 19:39:46 +00001344.. option:: -fdebug-pass-arguments
1345
Richard Smith081ad4d2017-01-24 19:39:46 +00001346.. option:: -fdebug-pass-structure
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fdebug-prefix-map=<arg>
1349
1350remap file source paths in debug info
1351
Richard Smith081ad4d2017-01-24 19:39:46 +00001352.. option:: -fdebug-types-section, -fno-debug-types-section
1353
1354Place debug types in their own section (ELF Only)
1355
Richard Smith081ad4d2017-01-24 19:39:46 +00001356.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1357
1358Parse templated function definitions at the end of the translation unit
1359
Vedant Kumar368540f2018-08-23 17:55:03 +00001360.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1361
1362Treat usage of null pointers as undefined behavior.
1363
Richard Smith081ad4d2017-01-24 19:39:46 +00001364.. option:: -fdenormal-fp-math=<arg>
1365
Richard Smith081ad4d2017-01-24 19:39:46 +00001366.. option:: -fdiagnostics-absolute-paths
1367
1368Print absolute paths in diagnostics
1369
Richard Smith081ad4d2017-01-24 19:39:46 +00001370.. option:: -fdiagnostics-color, -fno-diagnostics-color
1371
Richard Smithb2c82a62017-01-27 01:54:42 +00001372.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001373.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001374.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001375
Craig Topperd23254a2017-07-20 17:52:48 +00001376.. option:: -fdiagnostics-hotness-threshold=<number>
1377
1378Prevent optimization remarks from being output if they do not have at least this profile count
1379
Richard Smith081ad4d2017-01-24 19:39:46 +00001380.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1381
1382Enable profile hotness information in diagnostic line
1383
Richard Smith081ad4d2017-01-24 19:39:46 +00001384.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1385
1386Display include stacks for diagnostic notes
1387
Richard Smith081ad4d2017-01-24 19:39:46 +00001388.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1389
1390Print option name with mappable diagnostics
1391
Richard Smith081ad4d2017-01-24 19:39:46 +00001392.. option:: -fdiagnostics-show-template-tree
1393
1394Print a template comparison tree for differing templates
1395
Vedant Kumar368540f2018-08-23 17:55:03 +00001396.. option:: -fdigraphs, -fno-digraphs
1397
1398Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1399
Richard Smith081ad4d2017-01-24 19:39:46 +00001400.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1401
1402Allow '$' in identifiers
1403
Craig Topper16418662017-11-20 18:07:43 +00001404.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1405
1406Enable '\[\[\]\]' attributes in all C and C++ language modes
1407
Richard Smith081ad4d2017-01-24 19:39:46 +00001408.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1409
Craig Topper188252d2017-12-11 21:09:16 +00001410.. option:: -fdwarf-exceptions
1411
1412Use DWARF style exceptions
1413
Richard Smith081ad4d2017-01-24 19:39:46 +00001414.. option:: -felide-constructors, -fno-elide-constructors
1415
Richard Smith081ad4d2017-01-24 19:39:46 +00001416.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1417
Richard Smith081ad4d2017-01-24 19:39:46 +00001418.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1419
1420Embed LLVM bitcode (option: off, all, bitcode, marker)
1421
Richard Smith081ad4d2017-01-24 19:39:46 +00001422.. option:: -femit-all-decls
1423
1424Emit all declarations, even if unused
1425
Richard Smith081ad4d2017-01-24 19:39:46 +00001426.. option:: -femulated-tls, -fno-emulated-tls
1427
1428Use emutls functions to access thread\_local variables
1429
Richard Smith081ad4d2017-01-24 19:39:46 +00001430.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1431
Richard Smith081ad4d2017-01-24 19:39:46 +00001432.. option:: -ferror-limit=<arg>
1433
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001434.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1435
Richard Smith081ad4d2017-01-24 19:39:46 +00001436.. option:: -fexceptions, -fno-exceptions
1437
1438Enable support for exception handling
1439
Richard Smith081ad4d2017-01-24 19:39:46 +00001440.. option:: -fexec-charset=<arg>
1441
Richard Smith081ad4d2017-01-24 19:39:46 +00001442.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1443
Richard Smith081ad4d2017-01-24 19:39:46 +00001444.. option:: -ffast-math, -fno-fast-math
1445
1446Allow aggressive, lossy floating-point optimizations
1447
Richard Smith081ad4d2017-01-24 19:39:46 +00001448.. option:: -ffinite-math-only, -fno-finite-math-only
1449
Vedant Kumar368540f2018-08-23 17:55:03 +00001450.. option:: -ffixed-point, -fno-fixed-point
1451
1452Enable fixed point types
1453
Richard Smith081ad4d2017-01-24 19:39:46 +00001454.. option:: -ffor-scope, -fno-for-scope
1455
Vedant Kumar368540f2018-08-23 17:55:03 +00001456.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1457
1458Emits more virtual tables to improve devirtualization
1459
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001460.. option:: -fforce-enable-int128, -fno-force-enable-int128
1461
1462Enable support for int128\_t type
1463
Richard Smith081ad4d2017-01-24 19:39:46 +00001464.. option:: -ffp-contract=<arg>
1465
1466Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1467
Richard Smith081ad4d2017-01-24 19:39:46 +00001468.. option:: -ffreestanding
1469
1470Assert that the compilation takes place in a freestanding environment
1471
Richard Smith081ad4d2017-01-24 19:39:46 +00001472.. option:: -ffunction-sections, -fno-function-sections
1473
1474Place each function in its own section (ELF Only)
1475
Richard Smith081ad4d2017-01-24 19:39:46 +00001476.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1477
Richard Smith081ad4d2017-01-24 19:39:46 +00001478.. option:: -fgnu-keywords, -fno-gnu-keywords
1479
1480Allow GNU-extension keywords regardless of language standard
1481
Richard Smith081ad4d2017-01-24 19:39:46 +00001482.. option:: -fgnu-runtime
1483
1484Generate output compatible with the standard GNU Objective-C runtime
1485
Richard Smith081ad4d2017-01-24 19:39:46 +00001486.. option:: -fgnu89-inline, -fno-gnu89-inline
1487
1488Use the gnu89 inline semantics
1489
Richard Smith081ad4d2017-01-24 19:39:46 +00001490.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1491
Richard Smith081ad4d2017-01-24 19:39:46 +00001492.. option:: -fhonor-nans, -fno-honor-nans
1493
Richard Smith081ad4d2017-01-24 19:39:46 +00001494.. option:: -fhosted
1495
Richard Smith081ad4d2017-01-24 19:39:46 +00001496.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1497
1498Implicitly search the file system for module map files.
1499
Richard Smith081ad4d2017-01-24 19:39:46 +00001500.. option:: -fimplicit-modules, -fno-implicit-modules
1501
Richard Smith081ad4d2017-01-24 19:39:46 +00001502.. option:: -finput-charset=<arg>
1503
Craig Topper188252d2017-12-11 21:09:16 +00001504.. option:: -finstrument-function-entry-bare
1505
1506Instrument function entry only, after inlining, without arguments to the instrumentation call
1507
Richard Smith081ad4d2017-01-24 19:39:46 +00001508.. option:: -finstrument-functions
1509
1510Generate calls to instrument function entry and exit
1511
Craig Topper16418662017-11-20 18:07:43 +00001512.. option:: -finstrument-functions-after-inlining
1513
1514Like -finstrument-functions, but insert the calls after inlining
1515
Richard Smith081ad4d2017-01-24 19:39:46 +00001516.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1517
1518Enable the integrated assembler
1519
Richard Smith081ad4d2017-01-24 19:39:46 +00001520.. option:: -fjump-tables, -fno-jump-tables
1521
Vedant Kumar368540f2018-08-23 17:55:03 +00001522.. option:: -fkeep-static-consts
1523
1524Keep static const variables even if unused
1525
Richard Smith081ad4d2017-01-24 19:39:46 +00001526.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1527
Richard Smith081ad4d2017-01-24 19:39:46 +00001528.. option:: -flimited-precision=<arg>
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -flto, -fno-lto
1531
1532Enable LTO in 'full' mode
1533
Richard Smith081ad4d2017-01-24 19:39:46 +00001534.. option:: -flto-jobs=<arg>
1535
1536Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1537
Richard Smithb2c82a62017-01-27 01:54:42 +00001538.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001539.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001540.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001541
1542Set LTO mode to either 'full' or 'thin'
1543
Richard Smith081ad4d2017-01-24 19:39:46 +00001544.. option:: -fmacro-backtrace-limit=<arg>
1545
Richard Smith081ad4d2017-01-24 19:39:46 +00001546.. option:: -fmath-errno, -fno-math-errno
1547
1548Require math functions to indicate errors by setting errno
1549
Richard Smith081ad4d2017-01-24 19:39:46 +00001550.. option:: -fmax-type-align=<arg>
1551
1552Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1553
Richard Smith081ad4d2017-01-24 19:39:46 +00001554.. option:: -fmerge-all-constants, -fno-merge-all-constants
1555
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001556Allow merging of constants
1557
Richard Smith081ad4d2017-01-24 19:39:46 +00001558.. option:: -fmessage-length=<arg>
1559
Richard Smith081ad4d2017-01-24 19:39:46 +00001560.. option:: -fmodule-file-deps, -fno-module-file-deps
1561
Richard Smith081ad4d2017-01-24 19:39:46 +00001562.. option:: -fmodule-map-file=<file>
1563
1564Load this module map file
1565
Richard Smith081ad4d2017-01-24 19:39:46 +00001566.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1567
1568Specify the name of the module to build
1569
Richard Smith081ad4d2017-01-24 19:39:46 +00001570.. option:: -fmodules, -fno-modules
1571
1572Enable the 'modules' language feature
1573
Richard Smith081ad4d2017-01-24 19:39:46 +00001574.. option:: -fmodules-decluse, -fno-modules-decluse
1575
1576Require declaration of modules used within a module
1577
Richard Smith081ad4d2017-01-24 19:39:46 +00001578.. option:: -fmodules-ignore-macro=<arg>
1579
1580Ignore the definition of the given macro when building and loading modules
1581
Richard Smith081ad4d2017-01-24 19:39:46 +00001582.. option:: -fmodules-search-all, -fno-modules-search-all
1583
1584Search even non-imported modules to resolve references
1585
Richard Smith081ad4d2017-01-24 19:39:46 +00001586.. option:: -fmodules-strict-decluse
1587
1588Like -fmodules-decluse but requires all headers to be in modules
1589
Richard Smith081ad4d2017-01-24 19:39:46 +00001590.. option:: -fmodules-ts
1591
1592Enable support for the C++ Modules TS
1593
Richard Smith081ad4d2017-01-24 19:39:46 +00001594.. option:: -fms-compatibility, -fno-ms-compatibility
1595
1596Enable full Microsoft Visual C++ compatibility
1597
Richard Smith081ad4d2017-01-24 19:39:46 +00001598.. option:: -fms-compatibility-version=<arg>
1599
1600Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1601
Richard Smith081ad4d2017-01-24 19:39:46 +00001602.. option:: -fms-extensions, -fno-ms-extensions
1603
1604Accept some non-standard constructs supported by the Microsoft compiler
1605
Richard Smith081ad4d2017-01-24 19:39:46 +00001606.. option:: -fms-memptr-rep=<arg>
1607
Richard Smith081ad4d2017-01-24 19:39:46 +00001608.. option:: -fms-volatile<arg>
1609
Richard Smith081ad4d2017-01-24 19:39:46 +00001610.. option:: -fmsc-version=<arg>
1611
1612Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -fmudflap
1615
Richard Smith081ad4d2017-01-24 19:39:46 +00001616.. option:: -fmudflapth
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -fnested-functions
1619
Richard Smith081ad4d2017-01-24 19:39:46 +00001620.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1621
1622Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1623
Richard Smith081ad4d2017-01-24 19:39:46 +00001624.. option:: -fnext-runtime
1625
Richard Smith081ad4d2017-01-24 19:39:46 +00001626.. option:: -fno-builtin-<arg>
1627
1628Disable implicit builtin knowledge of a specific function
1629
Richard Smith081ad4d2017-01-24 19:39:46 +00001630.. option:: -fno-elide-type
1631
1632Do not elide types when printing diagnostics
1633
Richard Smith081ad4d2017-01-24 19:39:46 +00001634.. option:: -fno-max-type-align
1635
Richard Smith081ad4d2017-01-24 19:39:46 +00001636.. option:: -fno-operator-names
1637
1638Do not treat C++ operator name keywords as synonyms for operators
1639
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001640.. option:: -fno-rtti-data
1641
1642Control emission of RTTI data
1643
Richard Smith081ad4d2017-01-24 19:39:46 +00001644.. option:: -fno-strict-modules-decluse
1645
Richard Smith081ad4d2017-01-24 19:39:46 +00001646.. option:: -fno-working-directory
1647
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001648.. option:: -fnoxray-link-deps
1649
Richard Smith081ad4d2017-01-24 19:39:46 +00001650.. option:: -fobjc-abi-version=<arg>
1651
Richard Smith081ad4d2017-01-24 19:39:46 +00001652.. option:: -fobjc-arc, -fno-objc-arc
1653
1654Synthesize retain and release calls for Objective-C pointers
1655
Richard Smith081ad4d2017-01-24 19:39:46 +00001656.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1657
1658Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1659
Richard Smith081ad4d2017-01-24 19:39:46 +00001660.. option:: -fobjc-exceptions, -fno-objc-exceptions
1661
1662Enable Objective-C exceptions
1663
Richard Smith081ad4d2017-01-24 19:39:46 +00001664.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1665
Richard Smith081ad4d2017-01-24 19:39:46 +00001666.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1667
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -fobjc-link-runtime
1669
Richard Smith081ad4d2017-01-24 19:39:46 +00001670.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1671
Richard Smith081ad4d2017-01-24 19:39:46 +00001672.. option:: -fobjc-nonfragile-abi-version=<arg>
1673
Richard Smith081ad4d2017-01-24 19:39:46 +00001674.. option:: -fobjc-runtime=<arg>
1675
1676Specify the target Objective-C runtime kind and version
1677
Richard Smith081ad4d2017-01-24 19:39:46 +00001678.. option:: -fobjc-sender-dependent-dispatch
1679
Richard Smith081ad4d2017-01-24 19:39:46 +00001680.. option:: -fobjc-weak, -fno-objc-weak
1681
1682Enable ARC-style weak references in Objective-C
1683
Richard Smith081ad4d2017-01-24 19:39:46 +00001684.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1685
Richard Smith081ad4d2017-01-24 19:39:46 +00001686.. option:: -fopenmp, -fno-openmp
1687
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001688Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001689
Craig Topper287c8012018-01-03 18:29:12 +00001690.. option:: -fopenmp-simd, -fno-openmp-simd
1691
1692Emit OpenMP code only for SIMD-based constructs.
1693
Richard Smith081ad4d2017-01-24 19:39:46 +00001694.. option:: -fopenmp-version=<arg>
1695
Richard Smithb2c82a62017-01-27 01:54:42 +00001696.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001697.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001698.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001699
Richard Smith081ad4d2017-01-24 19:39:46 +00001700.. option:: -foperator-arrow-depth=<arg>
1701
Richard Smith081ad4d2017-01-24 19:39:46 +00001702.. option:: -foptimization-record-file=<arg>
1703
1704Specify the file name of any generated YAML optimization record
1705
Richard Smith081ad4d2017-01-24 19:39:46 +00001706.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1707
Richard Smith081ad4d2017-01-24 19:39:46 +00001708.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1709
Richard Smith081ad4d2017-01-24 19:39:46 +00001710.. option:: -fpack-struct, -fno-pack-struct
1711
Richard Smithb2c82a62017-01-27 01:54:42 +00001712.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001713.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001714.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001715
1716Specify the default maximum struct packing alignment
1717
Richard Smith081ad4d2017-01-24 19:39:46 +00001718.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1719
1720Recognize and construct Pascal-style string literals
1721
Richard Smith081ad4d2017-01-24 19:39:46 +00001722.. option:: -fpcc-struct-return
1723
1724Override the default ABI to return all structs on the stack
1725
Richard Smith081ad4d2017-01-24 19:39:46 +00001726.. option:: -fpch-preprocess
1727
Richard Smith081ad4d2017-01-24 19:39:46 +00001728.. option:: -fpic, -fno-pic
1729
Richard Smith081ad4d2017-01-24 19:39:46 +00001730.. option:: -fpie, -fno-pie
1731
Craig Topper16418662017-11-20 18:07:43 +00001732.. option:: -fplt, -fno-plt
1733
1734Use the PLT to make function calls
1735
Richard Smith081ad4d2017-01-24 19:39:46 +00001736.. option:: -fplugin=<dsopath>
1737
1738Load the named plugin (dynamic shared object)
1739
Richard Smith081ad4d2017-01-24 19:39:46 +00001740.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1741
Richard Smith081ad4d2017-01-24 19:39:46 +00001742.. option:: -fprofile-arcs, -fno-profile-arcs
1743
Richard Smith081ad4d2017-01-24 19:39:46 +00001744.. option:: -fprofile-dir=<arg>
1745
Richard Smith081ad4d2017-01-24 19:39:46 +00001746.. option:: -fprofile-generate, -fno-profile-generate
1747
1748Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1749
Richard Smithb2c82a62017-01-27 01:54:42 +00001750.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001751.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001752.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001753
1754Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1755
Richard Smith081ad4d2017-01-24 19:39:46 +00001756.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1757
1758Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1759
Richard Smithb2c82a62017-01-27 01:54:42 +00001760.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001761.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001762.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001763
1764Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1765
Richard Smith081ad4d2017-01-24 19:39:46 +00001766.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1767
Richard Smithb2c82a62017-01-27 01:54:42 +00001768.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001769.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001770.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001771
1772Use instrumentation data for profile-guided optimization
1773
Boris Kolpackovb150d242017-08-30 09:15:53 +00001774.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1775
1776Specifies that the sample profile is accurate. If the sample
1777 profile is accurate, callsites without profile samples are marked
1778 as cold. Otherwise, treat callsites without profile samples as if
1779 we have no profile
1780
Richard Smith78e23fd2017-04-13 22:39:49 +00001781.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1782
1783.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001784.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001785.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001786
1787Enable sample-based profile guided optimizations
1788
Richard Smithb2c82a62017-01-27 01:54:42 +00001789.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001790.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001791.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001792
1793Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1794
Richard Smith081ad4d2017-01-24 19:39:46 +00001795.. option:: -freciprocal-math, -fno-reciprocal-math
1796
1797Allow division operations to be reassociated
1798
Richard Smith081ad4d2017-01-24 19:39:46 +00001799.. option:: -freg-struct-return
1800
1801Override the default ABI to return small structs in registers
1802
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001803.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1804
1805Use atexit or \_\_cxa\_atexit to register global destructors
1806
Richard Smith081ad4d2017-01-24 19:39:46 +00001807.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1808
1809Enable C++17 relaxed template template argument matching
1810
Richard Smith081ad4d2017-01-24 19:39:46 +00001811.. option:: -freroll-loops, -fno-reroll-loops
1812
1813Turn on loop reroller
1814
Richard Smith081ad4d2017-01-24 19:39:46 +00001815.. option:: -fretain-comments-from-system-headers
1816
Craig Topperd23254a2017-07-20 17:52:48 +00001817.. option:: -frewrite-imports, -fno-rewrite-imports
1818
Richard Smith081ad4d2017-01-24 19:39:46 +00001819.. option:: -frewrite-includes, -fno-rewrite-includes
1820
Richard Smith081ad4d2017-01-24 19:39:46 +00001821.. option:: -frewrite-map-file <arg>
1822
Richard Smithb2c82a62017-01-27 01:54:42 +00001823.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001824.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001825.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001826
Richard Smith081ad4d2017-01-24 19:39:46 +00001827.. option:: -fropi, -fno-ropi
1828
Richard Smith081ad4d2017-01-24 19:39:46 +00001829.. option:: -frtti, -fno-rtti
1830
Richard Smith081ad4d2017-01-24 19:39:46 +00001831.. option:: -frwpi, -fno-rwpi
1832
Richard Smith081ad4d2017-01-24 19:39:46 +00001833.. option:: -fsave-optimization-record, -fno-save-optimization-record
1834
1835Generate a YAML optimization record file
1836
Craig Topper188252d2017-12-11 21:09:16 +00001837.. option:: -fseh-exceptions
1838
1839Use SEH style exceptions
1840
Richard Smith081ad4d2017-01-24 19:39:46 +00001841.. option:: -fshort-enums, -fno-short-enums
1842
1843Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1844
Richard Smith081ad4d2017-01-24 19:39:46 +00001845.. option:: -fshort-wchar, -fno-short-wchar
1846
1847Force wchar\_t to be a short unsigned int
1848
Richard Smith081ad4d2017-01-24 19:39:46 +00001849.. option:: -fshow-column, -fno-show-column
1850
Richard Smith081ad4d2017-01-24 19:39:46 +00001851.. option:: -fshow-overloads=<arg>
1852
1853Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1854
Richard Smith081ad4d2017-01-24 19:39:46 +00001855.. option:: -fshow-source-location, -fno-show-source-location
1856
Richard Smith081ad4d2017-01-24 19:39:46 +00001857.. option:: -fsignaling-math, -fno-signaling-math
1858
Richard Smith081ad4d2017-01-24 19:39:46 +00001859.. option:: -fsigned-bitfields
1860
Richard Smith081ad4d2017-01-24 19:39:46 +00001861.. option:: -fsigned-char, -fno-signed-char, --signed-char
1862
Richard Smith081ad4d2017-01-24 19:39:46 +00001863.. option:: -fsigned-zeros, -fno-signed-zeros
1864
Richard Smith081ad4d2017-01-24 19:39:46 +00001865.. option:: -fsized-deallocation, -fno-sized-deallocation
1866
1867Enable C++14 sized global deallocation functions
1868
Richard Smith081ad4d2017-01-24 19:39:46 +00001869.. option:: -fsjlj-exceptions
1870
1871Use SjLj style exceptions
1872
Richard Smith081ad4d2017-01-24 19:39:46 +00001873.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1874
1875Enable the superword-level parallelism vectorization passes
1876
Richard Smith081ad4d2017-01-24 19:39:46 +00001877.. option:: -fspell-checking, -fno-spell-checking
1878
Richard Smith081ad4d2017-01-24 19:39:46 +00001879.. option:: -fspell-checking-limit=<arg>
1880
Richard Smith081ad4d2017-01-24 19:39:46 +00001881.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1882
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001883Provide 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 +00001884
Richard Smith081ad4d2017-01-24 19:39:46 +00001885.. option:: -fsplit-stack
1886
Richard Smith081ad4d2017-01-24 19:39:46 +00001887.. option:: -fstack-protector, -fno-stack-protector
1888
1889Enable stack protectors for functions potentially vulnerable to stack smashing
1890
Richard Smith081ad4d2017-01-24 19:39:46 +00001891.. option:: -fstack-protector-all
1892
1893Force the usage of stack protectors for all functions
1894
Richard Smith081ad4d2017-01-24 19:39:46 +00001895.. option:: -fstack-protector-strong
1896
1897Use a strong heuristic to apply stack protectors to functions
1898
Craig Topper596527b2018-01-23 18:40:15 +00001899.. option:: -fstack-size-section, -fno-stack-size-section
1900
1901Emit section containing metadata on function stack sizes
1902
Richard Smith081ad4d2017-01-24 19:39:46 +00001903.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1904
1905Emit full debug info for all types used by the program
1906
Richard Smith081ad4d2017-01-24 19:39:46 +00001907.. option:: -fstrict-aliasing, -fno-strict-aliasing
1908
Richard Smith081ad4d2017-01-24 19:39:46 +00001909.. option:: -fstrict-enums, -fno-strict-enums
1910
1911Enable optimizations based on the strict definition of an enum's value range
1912
Vedant Kumar368540f2018-08-23 17:55:03 +00001913.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
1914
1915Assume that overflowing float-to-int casts are undefined (default)
1916
Richard Smith081ad4d2017-01-24 19:39:46 +00001917.. option:: -fstrict-overflow, -fno-strict-overflow
1918
Richard Smith081ad4d2017-01-24 19:39:46 +00001919.. option:: -fstrict-return, -fno-strict-return
1920
Richard Smith78e23fd2017-04-13 22:39:49 +00001921Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00001922
Richard Smith081ad4d2017-01-24 19:39:46 +00001923.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1924
1925Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1926
Richard Smith081ad4d2017-01-24 19:39:46 +00001927.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1928
Richard Smith081ad4d2017-01-24 19:39:46 +00001929.. option:: -ftabstop=<arg>
1930
Richard Smith081ad4d2017-01-24 19:39:46 +00001931.. option:: -ftemplate-backtrace-limit=<arg>
1932
Richard Smith081ad4d2017-01-24 19:39:46 +00001933.. option:: -ftemplate-depth-<arg>
1934
Richard Smith081ad4d2017-01-24 19:39:46 +00001935.. option:: -ftemplate-depth=<arg>
1936
Richard Smith081ad4d2017-01-24 19:39:46 +00001937.. option:: -ftest-coverage
1938
Richard Smith081ad4d2017-01-24 19:39:46 +00001939.. option:: -fthinlto-index=<arg>
1940
1941Perform ThinLTO importing using provided function summary index
1942
Richard Smith081ad4d2017-01-24 19:39:46 +00001943.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1944
Richard Smith081ad4d2017-01-24 19:39:46 +00001945.. option:: -ftime-report
1946
Richard Smith081ad4d2017-01-24 19:39:46 +00001947.. option:: -ftls-model=<arg>
1948
Richard Smith081ad4d2017-01-24 19:39:46 +00001949.. option:: -ftrap-function=<arg>
1950
1951Issue call to specified function rather than a trap instruction
1952
Richard Smith081ad4d2017-01-24 19:39:46 +00001953.. option:: -ftrapping-math, -fno-trapping-math
1954
Richard Smith081ad4d2017-01-24 19:39:46 +00001955.. option:: -ftrapv
1956
1957Trap on integer overflow
1958
Richard Smith081ad4d2017-01-24 19:39:46 +00001959.. option:: -ftrapv-handler <arg>
1960
Richard Smithb2c82a62017-01-27 01:54:42 +00001961.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001962.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00001963.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001964
1965Specify the function to be called on overflow
1966
Richard Smith081ad4d2017-01-24 19:39:46 +00001967.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1968
1969Process trigraph sequences
1970
Richard Smith081ad4d2017-01-24 19:39:46 +00001971.. option:: -funique-section-names, -fno-unique-section-names
1972
1973Use unique names for text and data sections (ELF Only)
1974
Richard Smith081ad4d2017-01-24 19:39:46 +00001975.. option:: -funit-at-a-time, -fno-unit-at-a-time
1976
Richard Smith081ad4d2017-01-24 19:39:46 +00001977.. option:: -funroll-loops, -fno-unroll-loops
1978
1979Turn on loop unroller
1980
Richard Smith081ad4d2017-01-24 19:39:46 +00001981.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
1982
Richard Smith081ad4d2017-01-24 19:39:46 +00001983.. option:: -funsigned-bitfields
1984
Richard Smith081ad4d2017-01-24 19:39:46 +00001985.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
1986
Richard Smith081ad4d2017-01-24 19:39:46 +00001987.. option:: -funwind-tables, -fno-unwind-tables
1988
Richard Smith081ad4d2017-01-24 19:39:46 +00001989.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
1990
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -fuse-init-array, -fno-use-init-array
1992
1993Use .init\_array instead of .ctors
1994
Richard Smith081ad4d2017-01-24 19:39:46 +00001995.. option:: -fuse-ld=<arg>
1996
Richard Smith081ad4d2017-01-24 19:39:46 +00001997.. option:: -fuse-line-directives, -fno-use-line-directives
1998
Richard Smith081ad4d2017-01-24 19:39:46 +00001999.. option:: -fveclib=<arg>
2000
2001Use the given vector functions library
2002
Richard Smith081ad4d2017-01-24 19:39:46 +00002003.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2004
2005Enable the loop vectorization passes
2006
Richard Smith081ad4d2017-01-24 19:39:46 +00002007.. option:: -fverbose-asm, -fno-verbose-asm
2008
Richard Smith081ad4d2017-01-24 19:39:46 +00002009.. option:: -fvisibility-inlines-hidden
2010
Fangrui Songdf81b972018-07-19 22:45:41 +00002011Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00002012
Richard Smith081ad4d2017-01-24 19:39:46 +00002013.. option:: -fvisibility-ms-compat
2014
2015Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2016
Richard Smith081ad4d2017-01-24 19:39:46 +00002017.. option:: -fvisibility=<arg>
2018
2019Set the default symbol visibility for all global declarations
2020
Richard Smith081ad4d2017-01-24 19:39:46 +00002021.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2022
2023Enables whole-program vtable optimization. Requires -flto
2024
Richard Smith081ad4d2017-01-24 19:39:46 +00002025.. option:: -fwrapv, -fno-wrapv
2026
2027Treat signed integer overflow as two's complement
2028
Richard Smith081ad4d2017-01-24 19:39:46 +00002029.. option:: -fwritable-strings
2030
2031Store string literals as writable data
2032
Craig Topper188252d2017-12-11 21:09:16 +00002033.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2034
2035Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2036
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002037.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2038
2039Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2040
Richard Smith78e23fd2017-04-13 22:39:49 +00002041.. option:: -fxray-always-instrument=<arg>
2042
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002043DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2044
2045.. option:: -fxray-attr-list=<arg>
2046
2047Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002048
Richard Smith081ad4d2017-01-24 19:39:46 +00002049.. option:: -fxray-instruction-threshold<arg>
2050
Richard Smithb2c82a62017-01-27 01:54:42 +00002051.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002052.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002053.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002054
2055Sets the minimum function size to instrument with XRay
2056
Richard Smith081ad4d2017-01-24 19:39:46 +00002057.. option:: -fxray-instrument, -fno-xray-instrument
2058
2059Generate XRay instrumentation sleds on function entry and exit
2060
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002061.. option:: -fxray-instrumentation-bundle=<arg>
2062
2063Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'.
2064
2065.. option:: -fxray-link-deps
2066
2067Tells clang to add the link dependencies for XRay.
2068
2069.. option:: -fxray-modes=<arg>
2070
2071List of modes to link in by default into XRay instrumented binaries.
2072
Richard Smith78e23fd2017-04-13 22:39:49 +00002073.. option:: -fxray-never-instrument=<arg>
2074
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002075DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002076
Richard Smith081ad4d2017-01-24 19:39:46 +00002077.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2078
Richard Smith081ad4d2017-01-24 19:39:46 +00002079.. option:: -fzvector, -fno-zvector, -mzvector
2080
2081Enable System z vector language extension
2082
Richard Smith081ad4d2017-01-24 19:39:46 +00002083.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2084
Richard Smith081ad4d2017-01-24 19:39:46 +00002085.. option:: -pedantic-errors, --pedantic-errors
2086
2087OpenCL flags
2088------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002089.. option:: -cl-denorms-are-zero
2090
2091OpenCL only. Allow denormals to be flushed to zero.
2092
Richard Smith081ad4d2017-01-24 19:39:46 +00002093.. option:: -cl-fast-relaxed-math
2094
2095OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2096
Richard Smith081ad4d2017-01-24 19:39:46 +00002097.. option:: -cl-finite-math-only
2098
2099OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2100
Richard Smith081ad4d2017-01-24 19:39:46 +00002101.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2102
2103OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2104
Richard Smith081ad4d2017-01-24 19:39:46 +00002105.. option:: -cl-kernel-arg-info
2106
2107OpenCL only. Generate kernel argument metadata.
2108
Richard Smith081ad4d2017-01-24 19:39:46 +00002109.. option:: -cl-mad-enable
2110
2111OpenCL only. Allow use of less precise MAD computations in the generated binary.
2112
Richard Smith081ad4d2017-01-24 19:39:46 +00002113.. option:: -cl-no-signed-zeros
2114
2115OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2116
Richard Smith081ad4d2017-01-24 19:39:46 +00002117.. option:: -cl-opt-disable
2118
2119OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2120
Richard Smith081ad4d2017-01-24 19:39:46 +00002121.. option:: -cl-single-precision-constant
2122
2123OpenCL only. Treat double precision floating-point constant as single precision constant.
2124
Richard Smith081ad4d2017-01-24 19:39:46 +00002125.. option:: -cl-std=<arg>
2126
2127OpenCL language standard to compile for.
2128
Richard Smith081ad4d2017-01-24 19:39:46 +00002129.. option:: -cl-strict-aliasing
2130
2131OpenCL only. This option is added for compatibility with OpenCL 1.0.
2132
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002133.. option:: -cl-uniform-work-group-size
2134
2135OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2136
Richard Smith081ad4d2017-01-24 19:39:46 +00002137.. option:: -cl-unsafe-math-optimizations
2138
2139OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2140
2141Target-dependent compilation options
2142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00002143.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2144
2145Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -m16
2148
Richard Smith081ad4d2017-01-24 19:39:46 +00002149.. option:: -m32
2150
Richard Smith081ad4d2017-01-24 19:39:46 +00002151.. option:: -m64
2152
Richard Smith081ad4d2017-01-24 19:39:46 +00002153.. option:: -mabi=<arg>
2154
Richard Smith081ad4d2017-01-24 19:39:46 +00002155.. option:: -malign-double
2156
2157Align doubles to two words in structs (x86 only)
2158
Richard Smith081ad4d2017-01-24 19:39:46 +00002159.. option:: -march=<arg>
2160
Richard Smith081ad4d2017-01-24 19:39:46 +00002161.. option:: -masm=<arg>
2162
Richard Smith081ad4d2017-01-24 19:39:46 +00002163.. option:: -mbackchain, -mno-backchain
2164
2165Link stack frames through backchain on System Z
2166
Richard Smith081ad4d2017-01-24 19:39:46 +00002167.. option:: -mcmodel=<arg>
2168
Richard Smith081ad4d2017-01-24 19:39:46 +00002169.. option:: -mconsole<arg>
2170
Krzysztof Parzyszek57e67062018-10-19 15:36:45 +00002171.. 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 +00002172
Ziang Wande94ac92019-06-25 23:57:14 +00002173Use -mcpu=? to see a list of supported cpu models.
2174
Vedant Kumar368540f2018-08-23 17:55:03 +00002175.. option:: -mcrc, -mno-crc
2176
2177Allow use of CRC instructions (ARM/Mips only)
2178
Craig Topperd23254a2017-07-20 17:52:48 +00002179.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2180
Richard Smith081ad4d2017-01-24 19:39:46 +00002181.. option:: -mdll<arg>
2182
Richard Smith081ad4d2017-01-24 19:39:46 +00002183.. option:: -mdynamic-no-pic<arg>
2184
Richard Smith081ad4d2017-01-24 19:39:46 +00002185.. option:: -meabi <arg>
2186
2187Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2188
Richard Smith78e23fd2017-04-13 22:39:49 +00002189.. option:: -mfentry
2190
2191Insert calls to fentry at function entry (x86 only)
2192
Richard Smith081ad4d2017-01-24 19:39:46 +00002193.. option:: -mfloat-abi=<arg>
2194
Richard Smith081ad4d2017-01-24 19:39:46 +00002195.. option:: -mfpmath=<arg>
2196
Richard Smith081ad4d2017-01-24 19:39:46 +00002197.. option:: -mfpu=<arg>
2198
Richard Smith081ad4d2017-01-24 19:39:46 +00002199.. option:: -mglobal-merge, -mno-global-merge
2200
2201Enable merging of globals
2202
Richard Smith081ad4d2017-01-24 19:39:46 +00002203.. option:: -mhard-float
2204
Richard Smith081ad4d2017-01-24 19:39:46 +00002205.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2206
Richard Smith081ad4d2017-01-24 19:39:46 +00002207.. option:: -miamcu, -mno-iamcu
2208
2209Use Intel MCU ABI
2210
Richard Smith081ad4d2017-01-24 19:39:46 +00002211.. option:: -mimplicit-float, -mno-implicit-float
2212
Richard Smith081ad4d2017-01-24 19:39:46 +00002213.. option:: -mimplicit-it=<arg>
2214
Richard Smith081ad4d2017-01-24 19:39:46 +00002215.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2216
2217(integrated-as) Emit an object file which can be used with an incremental linker
2218
Richard Smith78e23fd2017-04-13 22:39:49 +00002219.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002220
Richard Smith081ad4d2017-01-24 19:39:46 +00002221.. option:: -mkernel
2222
Richard Smith081ad4d2017-01-24 19:39:46 +00002223.. option:: -mlong-calls, -mno-long-calls
2224
2225Generate branches with extended addressability, usually via indirect jumps.
2226
Craig Topperd23254a2017-07-20 17:52:48 +00002227.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002228
J. Ryan Stinnettd45eaf92019-05-30 16:46:22 +00002229Set macOS deployment target
Richard Smith081ad4d2017-01-24 19:39:46 +00002230
Craig Topperd23254a2017-07-20 17:52:48 +00002231.. option:: -mmcu=<arg>
2232
Richard Smith081ad4d2017-01-24 19:39:46 +00002233.. option:: -mms-bitfields, -mno-ms-bitfields
2234
2235Set the default structure layout to be compatible with the Microsoft compiler standard
2236
Richard Smith081ad4d2017-01-24 19:39:46 +00002237.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2238
2239Omit frame pointer setup for leaf functions
2240
Richard Smith081ad4d2017-01-24 19:39:46 +00002241.. option:: -moslib=<arg>
2242
Richard Smith081ad4d2017-01-24 19:39:46 +00002243.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2244
2245Use copy relocations support for PIE builds
2246
Craig Topper9a724aa2017-12-11 21:09:19 +00002247.. option:: -mprefer-vector-width=<arg>
2248
2249Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2250
Richard Smith081ad4d2017-01-24 19:39:46 +00002251.. option:: -mqdsp6-compat
2252
2253Enable hexagon-qdsp6 backward compatibility
2254
Richard Smith081ad4d2017-01-24 19:39:46 +00002255.. option:: -mrecip
2256
Richard Smithb2c82a62017-01-27 01:54:42 +00002257.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002258.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002259.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002260
Richard Smith081ad4d2017-01-24 19:39:46 +00002261.. option:: -mred-zone, -mno-red-zone
2262
Richard Smith081ad4d2017-01-24 19:39:46 +00002263.. option:: -mregparm=<arg>
2264
Richard Smith081ad4d2017-01-24 19:39:46 +00002265.. option:: -mrelax-all, -mno-relax-all
2266
2267(integrated-as) Relax all machine instructions
2268
Vedant Kumar368540f2018-08-23 17:55:03 +00002269.. option:: -mretpoline, -mno-retpoline
2270
Richard Smith081ad4d2017-01-24 19:39:46 +00002271.. option:: -mrtd, -mno-rtd
2272
2273Make StdCall calling convention the default
2274
Vedant Kumar368540f2018-08-23 17:55:03 +00002275.. option:: -msign-return-address=<arg>
2276
2277Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002278
Richard Smith081ad4d2017-01-24 19:39:46 +00002279.. option:: -msoft-float, -mno-soft-float
2280
2281Use software floating point
2282
Richard Smith081ad4d2017-01-24 19:39:46 +00002283.. option:: -mstack-alignment=<arg>
2284
2285Set the stack alignment
2286
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002287.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2288
2289Enable stack probes
2290
Richard Smith081ad4d2017-01-24 19:39:46 +00002291.. option:: -mstack-probe-size=<arg>
2292
2293Set the stack probe size
2294
Richard Smith081ad4d2017-01-24 19:39:46 +00002295.. option:: -mstackrealign, -mno-stackrealign
2296
2297Force realign the stack at entry to every function
2298
Richard Smith081ad4d2017-01-24 19:39:46 +00002299.. option:: -mthread-model <arg>
2300
2301The thread model to use, e.g. posix, single (posix by default)
2302
Richard Smith081ad4d2017-01-24 19:39:46 +00002303.. option:: -mthreads<arg>
2304
Richard Smith081ad4d2017-01-24 19:39:46 +00002305.. option:: -mthumb, -mno-thumb
2306
Richard Smith081ad4d2017-01-24 19:39:46 +00002307.. option:: -mtune=<arg>
2308
Ziang Wande94ac92019-06-25 23:57:14 +00002309Use -mtune=? to see a list of supported cpu models.
2310
Richard Smith78e23fd2017-04-13 22:39:49 +00002311.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002312
Richard Smith081ad4d2017-01-24 19:39:46 +00002313.. option:: -municode<arg>
2314
Richard Smith081ad4d2017-01-24 19:39:46 +00002315.. option:: -mvx, -mno-vx
2316
Richard Smith081ad4d2017-01-24 19:39:46 +00002317.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2318
Richard Smith78e23fd2017-04-13 22:39:49 +00002319.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002320
Richard Smith081ad4d2017-01-24 19:39:46 +00002321.. option:: -mwindows<arg>
2322
Richard Smith081ad4d2017-01-24 19:39:46 +00002323.. option:: -mx32
2324
Richard Smith081ad4d2017-01-24 19:39:46 +00002325AARCH64
2326-------
Tri Vo6e8abbc2018-09-12 23:45:04 +00002327.. option:: -ffixed-x1
2328
2329Reserve the x1 register (AArch64 only)
2330
2331.. option:: -ffixed-x2
2332
2333Reserve the x2 register (AArch64 only)
2334
2335.. option:: -ffixed-x3
2336
2337Reserve the x3 register (AArch64 only)
2338
2339.. option:: -ffixed-x4
2340
2341Reserve the x4 register (AArch64 only)
2342
2343.. option:: -ffixed-x5
2344
2345Reserve the x5 register (AArch64 only)
2346
2347.. option:: -ffixed-x6
2348
2349Reserve the x6 register (AArch64 only)
2350
2351.. option:: -ffixed-x7
2352
2353Reserve the x7 register (AArch64 only)
2354
Richard Smith081ad4d2017-01-24 19:39:46 +00002355.. option:: -ffixed-x18
2356
2357Reserve the x18 register (AArch64 only)
2358
Petr Hosek72509082018-06-12 20:00:50 +00002359.. option:: -ffixed-x20
2360
2361Reserve the x20 register (AArch64 only)
2362
Tri Vo28e7e602018-09-25 16:48:40 +00002363.. option:: -fcall-saved-x8
2364
2365Make the x8 register call-saved (AArch64 only)
2366
2367.. option:: -fcall-saved-x9
2368
2369Make the x9 register call-saved (AArch64 only)
2370
2371.. option:: -fcall-saved-x10
2372
2373Make the x10 register call-saved (AArch64 only)
2374
2375.. option:: -fcall-saved-x11
2376
2377Make the x11 register call-saved (AArch64 only)
2378
2379.. option:: -fcall-saved-x12
2380
2381Make the x12 register call-saved (AArch64 only)
2382
2383.. option:: -fcall-saved-x13
2384
2385Make the x13 register call-saved (AArch64 only)
2386
2387.. option:: -fcall-saved-x14
2388
2389Make the x14 register call-saved (AArch64 only)
2390
2391.. option:: -fcall-saved-x15
2392
2393Make the x15 register call-saved (AArch64 only)
2394
2395.. option:: -fcall-saved-x18
2396
2397Make the x18 register call-saved (AArch64 only)
2398
Richard Smith081ad4d2017-01-24 19:39:46 +00002399.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2400
2401Workaround Cortex-A53 erratum 835769 (AArch64 only)
2402
Richard Smith081ad4d2017-01-24 19:39:46 +00002403.. option:: -mgeneral-regs-only
2404
2405Generate code which only uses the general purpose registers (AArch64 only)
2406
2407AMDGPU
2408------
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002409.. option:: -mcumode, -mno-cumode
2410
2411CU wavefront execution mode is used if enabled and WGP wavefront execution mode
2412is used if disabled (AMDGPU only)
2413
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002414.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2415
2416Wavefront size 64 is used if enabled and wavefront size 32 if disabled (AMDGPU only)
2417
Craig Topper16418662017-11-20 18:07:43 +00002418.. option:: -mxnack, -mno-xnack
2419
2420Enable XNACK (AMDGPU only)
2421
Richard Smith081ad4d2017-01-24 19:39:46 +00002422ARM
2423---
Richard Smith081ad4d2017-01-24 19:39:46 +00002424.. option:: -ffixed-r9
2425
2426Reserve the r9 register (ARM only)
2427
Richard Smith081ad4d2017-01-24 19:39:46 +00002428.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2429
2430Disallow generation of data access to code sections (ARM only)
2431
Richard Smith081ad4d2017-01-24 19:39:46 +00002432.. option:: -mno-movt
2433
2434Disallow use of movt/movw pairs (ARM only)
2435
Richard Smith78e23fd2017-04-13 22:39:49 +00002436.. option:: -mno-neg-immediates
2437
2438Disallow converting instructions with negative immediates to their negation or inversion.
2439
Richard Smith081ad4d2017-01-24 19:39:46 +00002440.. option:: -mnocrc
2441
2442Disallow use of CRC instructions (ARM only)
2443
Richard Smith081ad4d2017-01-24 19:39:46 +00002444.. option:: -mrestrict-it, -mno-restrict-it
2445
2446Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2447
Craig Topper16418662017-11-20 18:07:43 +00002448.. option:: -mtp=<arg>
2449
2450Read thread pointer from coprocessor register (ARM only)
2451
Richard Smith081ad4d2017-01-24 19:39:46 +00002452.. option:: -munaligned-access, -mno-unaligned-access
2453
2454Allow memory accesses to be unaligned (AArch32/AArch64 only)
2455
2456Hexagon
2457-------
Craig Topper16418662017-11-20 18:07:43 +00002458.. option:: -mieee-rnd-near
2459
Vedant Kumar368540f2018-08-23 17:55:03 +00002460.. option:: -mmemops, -mno-memops
2461
2462Enable generation of memop instructions
2463
2464.. option:: -mnvj, -mno-nvj
2465
2466Enable generation of new-value jumps
2467
2468.. option:: -mnvs, -mno-nvs
2469
2470Enable generation of new-value stores
2471
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002472.. option:: -mpackets, -mno-packets
2473
2474Enable generation of instruction packets
2475
Craig Topper16418662017-11-20 18:07:43 +00002476Hexagon
2477-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002478.. option:: -mhvx, -mno-hvx
2479
2480Enable Hexagon Vector eXtensions
2481
Craig Topper16418662017-11-20 18:07:43 +00002482.. option:: -mhvx-length=<arg>
2483
2484Set Hexagon Vector Length
2485
2486.. program:: clang1
2487.. option:: -mhvx=<arg>
2488.. program:: clang
2489
2490Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002491
Vedant Kumar368540f2018-08-23 17:55:03 +00002492MIPS
2493----
2494.. option:: -mabicalls, -mno-abicalls
2495
2496Enable SVR4-style position-independent code (Mips only)
2497
2498.. option:: -mabs=<arg>
2499
2500.. option:: -mcheck-zero-division, -mno-check-zero-division
2501
2502.. option:: -mcompact-branches=<arg>
2503
2504.. option:: -mdouble-float
2505
2506.. option:: -mdsp, -mno-dsp
2507
2508.. option:: -mdspr2, -mno-dspr2
2509
2510.. option:: -membedded-data, -mno-embedded-data
2511
2512Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2513
2514.. option:: -mextern-sdata, -mno-extern-sdata
2515
2516Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2517
2518.. option:: -mfp32
2519
2520Use 32-bit floating point registers (MIPS only)
2521
2522.. option:: -mfp64
2523
2524Use 64-bit floating point registers (MIPS only)
2525
2526.. option:: -mginv, -mno-ginv
2527
2528.. option:: -mgpopt, -mno-gpopt
2529
2530Use GP relative accesses for symbols known to be in a small data section (MIPS)
2531
2532.. option:: -mindirect-jump=<arg>
2533
2534Change indirect jump instructions to inhibit speculation
2535
2536.. option:: -mips16
2537
2538.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2539
2540.. option:: -mlocal-sdata, -mno-local-sdata
2541
2542Extend the -G behaviour to object local data (MIPS)
2543
2544.. option:: -mmadd4, -mno-madd4
2545
2546Enable the generation of 4-operand madd.s, madd.d and related instructions.
2547
2548.. option:: -mmicromips, -mno-micromips
2549
2550.. option:: -mmsa, -mno-msa
2551
2552Enable MSA ASE (MIPS only)
2553
2554.. option:: -mmt, -mno-mt
2555
2556Enable MT ASE (MIPS only)
2557
2558.. option:: -mnan=<arg>
2559
2560.. option:: -mno-mips16
2561
2562.. option:: -msingle-float
2563
2564.. option:: -mvirt, -mno-virt
2565
2566.. option:: -mxgot, -mno-xgot
2567
Richard Smith081ad4d2017-01-24 19:39:46 +00002568PowerPC
2569-------
Richard Smith78e23fd2017-04-13 22:39:49 +00002570.. option:: -maltivec, -mno-altivec
2571
Richard Smith081ad4d2017-01-24 19:39:46 +00002572.. option:: -mcmpb, -mno-cmpb
2573
Richard Smith081ad4d2017-01-24 19:39:46 +00002574.. option:: -mcrbits, -mno-crbits
2575
Richard Smith081ad4d2017-01-24 19:39:46 +00002576.. option:: -mcrypto, -mno-crypto
2577
Richard Smith081ad4d2017-01-24 19:39:46 +00002578.. option:: -mdirect-move, -mno-direct-move
2579
Richard Smith081ad4d2017-01-24 19:39:46 +00002580.. option:: -mfloat128, -mno-float128
2581
Richard Smith081ad4d2017-01-24 19:39:46 +00002582.. option:: -mfprnd, -mno-fprnd
2583
Richard Smith081ad4d2017-01-24 19:39:46 +00002584.. option:: -mhtm, -mno-htm
2585
Richard Smith081ad4d2017-01-24 19:39:46 +00002586.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2587
Richard Smith081ad4d2017-01-24 19:39:46 +00002588.. option:: -misel, -mno-isel
2589
Richard Smith081ad4d2017-01-24 19:39:46 +00002590.. option:: -mlongcall, -mno-longcall
2591
Richard Smith081ad4d2017-01-24 19:39:46 +00002592.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2593
Richard Smith081ad4d2017-01-24 19:39:46 +00002594.. option:: -mpopcntd, -mno-popcntd
2595
Richard Smith081ad4d2017-01-24 19:39:46 +00002596.. option:: -mpower8-vector, -mno-power8-vector
2597
Richard Smith081ad4d2017-01-24 19:39:46 +00002598.. option:: -mpower9-vector, -mno-power9-vector
2599
Richard Smith081ad4d2017-01-24 19:39:46 +00002600.. option:: -mqpx, -mno-qpx
2601
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002602.. option:: -msecure-plt
2603
Richard Smith081ad4d2017-01-24 19:39:46 +00002604.. option:: -mvsx, -mno-vsx
2605
2606WebAssembly
2607-----------
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002608.. option:: -mexception-handling, -mno-exception-handling
2609
Craig Topper188252d2017-12-11 21:09:16 +00002610.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
2611
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00002612.. option:: -msign-ext, -mno-sign-ext
2613
Richard Smith081ad4d2017-01-24 19:39:46 +00002614.. option:: -msimd128, -mno-simd128
2615
2616X86
2617---
Richard Smith081ad4d2017-01-24 19:39:46 +00002618.. option:: -m3dnow, -mno-3dnow
2619
Richard Smith081ad4d2017-01-24 19:39:46 +00002620.. option:: -m3dnowa, -mno-3dnowa
2621
Richard Smith081ad4d2017-01-24 19:39:46 +00002622.. option:: -madx, -mno-adx
2623
Richard Smith081ad4d2017-01-24 19:39:46 +00002624.. option:: -maes, -mno-aes
2625
Richard Smith081ad4d2017-01-24 19:39:46 +00002626.. option:: -mavx, -mno-avx
2627
Richard Smith081ad4d2017-01-24 19:39:46 +00002628.. option:: -mavx2, -mno-avx2
2629
Craig Topper287c8012018-01-03 18:29:12 +00002630.. option:: -mavx512bitalg, -mno-avx512bitalg
2631
Luo, Yuanke844f6622019-05-06 08:25:11 +00002632.. option:: -mavx512bf16, -mno-avx512bf16
2633
Richard Smith081ad4d2017-01-24 19:39:46 +00002634.. option:: -mavx512bw, -mno-avx512bw
2635
Richard Smith081ad4d2017-01-24 19:39:46 +00002636.. option:: -mavx512cd, -mno-avx512cd
2637
Richard Smith081ad4d2017-01-24 19:39:46 +00002638.. option:: -mavx512dq, -mno-avx512dq
2639
Richard Smith081ad4d2017-01-24 19:39:46 +00002640.. option:: -mavx512er, -mno-avx512er
2641
Richard Smith081ad4d2017-01-24 19:39:46 +00002642.. option:: -mavx512f, -mno-avx512f
2643
Richard Smith081ad4d2017-01-24 19:39:46 +00002644.. option:: -mavx512ifma, -mno-avx512ifma
2645
Richard Smith081ad4d2017-01-24 19:39:46 +00002646.. option:: -mavx512pf, -mno-avx512pf
2647
Richard Smith081ad4d2017-01-24 19:39:46 +00002648.. option:: -mavx512vbmi, -mno-avx512vbmi
2649
Craig Topper287c8012018-01-03 18:29:12 +00002650.. option:: -mavx512vbmi2, -mno-avx512vbmi2
2651
Richard Smith081ad4d2017-01-24 19:39:46 +00002652.. option:: -mavx512vl, -mno-avx512vl
2653
Craig Topper287c8012018-01-03 18:29:12 +00002654.. option:: -mavx512vnni, -mno-avx512vnni
2655
Pengfei Wangcc3629d2019-05-31 06:09:35 +00002656.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
2657
Craig Topperd23254a2017-07-20 17:52:48 +00002658.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2659
Richard Smith081ad4d2017-01-24 19:39:46 +00002660.. option:: -mbmi, -mno-bmi
2661
Richard Smith081ad4d2017-01-24 19:39:46 +00002662.. option:: -mbmi2, -mno-bmi2
2663
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002664.. option:: -mcldemote, -mno-cldemote
2665
Craig Topper78b47872017-02-08 06:48:58 +00002666.. option:: -mclflushopt, -mno-clflushopt
2667
Craig Topper177a57c2017-02-08 07:57:01 +00002668.. option:: -mclwb, -mno-clwb
2669
Richard Smith78e23fd2017-04-13 22:39:49 +00002670.. option:: -mclzero, -mno-clzero
2671
Richard Smith081ad4d2017-01-24 19:39:46 +00002672.. option:: -mcx16, -mno-cx16
2673
Pengfei Wang3a29f7c2019-06-06 08:28:42 +00002674.. option:: -menqcmd, -mno-enqcmd
2675
Richard Smith081ad4d2017-01-24 19:39:46 +00002676.. option:: -mf16c, -mno-f16c
2677
Richard Smith081ad4d2017-01-24 19:39:46 +00002678.. option:: -mfma, -mno-fma
2679
Richard Smith081ad4d2017-01-24 19:39:46 +00002680.. option:: -mfma4, -mno-fma4
2681
Richard Smith081ad4d2017-01-24 19:39:46 +00002682.. option:: -mfsgsbase, -mno-fsgsbase
2683
Richard Smith081ad4d2017-01-24 19:39:46 +00002684.. option:: -mfxsr, -mno-fxsr
2685
Craig Topper287c8012018-01-03 18:29:12 +00002686.. option:: -mgfni, -mno-gfni
2687
Vedant Kumar368540f2018-08-23 17:55:03 +00002688.. option:: -minvpcid, -mno-invpcid
2689
Craig Topperd23254a2017-07-20 17:52:48 +00002690.. option:: -mlwp, -mno-lwp
2691
Richard Smith081ad4d2017-01-24 19:39:46 +00002692.. option:: -mlzcnt, -mno-lzcnt
2693
Richard Smith081ad4d2017-01-24 19:39:46 +00002694.. option:: -mmmx, -mno-mmx
2695
Craig Topper177a57c2017-02-08 07:57:01 +00002696.. option:: -mmovbe, -mno-movbe
2697
Gabor Buellaa51e0c22018-05-01 10:05:42 +00002698.. option:: -mmovdir64b, -mno-movdir64b
2699
Vedant Kumar368540f2018-08-23 17:55:03 +00002700.. option:: -mmovdiri, -mno-movdiri
2701
Craig Topperb16cb822017-02-08 07:56:42 +00002702.. option:: -mmpx, -mno-mpx
2703
Richard Smith081ad4d2017-01-24 19:39:46 +00002704.. option:: -mmwaitx, -mno-mwaitx
2705
Richard Smith081ad4d2017-01-24 19:39:46 +00002706.. option:: -mpclmul, -mno-pclmul
2707
Vedant Kumar368540f2018-08-23 17:55:03 +00002708.. option:: -mpconfig, -mno-pconfig
2709
Richard Smith081ad4d2017-01-24 19:39:46 +00002710.. option:: -mpku, -mno-pku
2711
Richard Smith081ad4d2017-01-24 19:39:46 +00002712.. option:: -mpopcnt, -mno-popcnt
2713
Craig Topperd2bf7b02017-02-08 08:23:40 +00002714.. option:: -mprefetchwt1, -mno-prefetchwt1
2715
Richard Smith081ad4d2017-01-24 19:39:46 +00002716.. option:: -mprfchw, -mno-prfchw
2717
Vedant Kumar368540f2018-08-23 17:55:03 +00002718.. option:: -mptwrite, -mno-ptwrite
2719
Craig Topper596527b2018-01-23 18:40:15 +00002720.. option:: -mrdpid, -mno-rdpid
2721
Richard Smith081ad4d2017-01-24 19:39:46 +00002722.. option:: -mrdrnd, -mno-rdrnd
2723
Richard Smith081ad4d2017-01-24 19:39:46 +00002724.. option:: -mrdseed, -mno-rdseed
2725
Craig Topper596527b2018-01-23 18:40:15 +00002726.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
2727
Richard Smith081ad4d2017-01-24 19:39:46 +00002728.. option:: -mrtm, -mno-rtm
2729
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002730.. option:: -msahf, -mno-sahf
2731
Craig Topper204ecff2017-02-08 08:23:17 +00002732.. option:: -msgx, -mno-sgx
2733
Richard Smith081ad4d2017-01-24 19:39:46 +00002734.. option:: -msha, -mno-sha
2735
Craig Topper188252d2017-12-11 21:09:16 +00002736.. option:: -mshstk, -mno-shstk
2737
Richard Smith081ad4d2017-01-24 19:39:46 +00002738.. option:: -msse, -mno-sse
2739
Richard Smith081ad4d2017-01-24 19:39:46 +00002740.. option:: -msse2, -mno-sse2
2741
Richard Smith081ad4d2017-01-24 19:39:46 +00002742.. option:: -msse3, -mno-sse3
2743
Richard Smith081ad4d2017-01-24 19:39:46 +00002744.. option:: -msse4.1, -mno-sse4.1
2745
Richard Smithb2c82a62017-01-27 01:54:42 +00002746.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002747.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00002748.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002749
Richard Smith081ad4d2017-01-24 19:39:46 +00002750.. option:: -msse4a, -mno-sse4a
2751
Richard Smith081ad4d2017-01-24 19:39:46 +00002752.. option:: -mssse3, -mno-ssse3
2753
Richard Smith081ad4d2017-01-24 19:39:46 +00002754.. option:: -mtbm, -mno-tbm
2755
Craig Topper287c8012018-01-03 18:29:12 +00002756.. option:: -mvaes, -mno-vaes
2757
2758.. option:: -mvpclmulqdq, -mno-vpclmulqdq
2759
Craig Topper42da9cb2018-04-23 21:41:06 +00002760.. option:: -mwaitpkg, -mno-waitpkg
2761
Gabor Buellaa0520162018-04-11 20:09:09 +00002762.. option:: -mwbnoinvd, -mno-wbnoinvd
2763
Richard Smith081ad4d2017-01-24 19:39:46 +00002764.. option:: -mx87, -m80387, -mno-x87
2765
Richard Smith081ad4d2017-01-24 19:39:46 +00002766.. option:: -mxop, -mno-xop
2767
Richard Smith081ad4d2017-01-24 19:39:46 +00002768.. option:: -mxsave, -mno-xsave
2769
Richard Smith081ad4d2017-01-24 19:39:46 +00002770.. option:: -mxsavec, -mno-xsavec
2771
Richard Smith081ad4d2017-01-24 19:39:46 +00002772.. option:: -mxsaveopt, -mno-xsaveopt
2773
Richard Smith081ad4d2017-01-24 19:39:46 +00002774.. option:: -mxsaves, -mno-xsaves
2775
Vedant Kumar368540f2018-08-23 17:55:03 +00002776RISCV
2777-----
2778.. option:: -mrelax, -mno-relax
2779
2780Enable linker relaxation
2781
Richard Smith081ad4d2017-01-24 19:39:46 +00002782Optimization level
2783~~~~~~~~~~~~~~~~~~
2784
2785Flags controlling how much optimization should be performed.
2786
Richard Smith081ad4d2017-01-24 19:39:46 +00002787.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2788
Richard Smith081ad4d2017-01-24 19:39:46 +00002789.. option:: -Ofast<arg>
2790
2791Debug information generation
2792~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2793
2794Flags controlling how much and what kind of debug information should be
2795generated.
2796
2797Kind and level of debug information
2798-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002799.. option:: -g, --debug, --debug=<arg>
2800
2801Generate source-level debug information
2802
Richard Smith081ad4d2017-01-24 19:39:46 +00002803.. option:: -gdwarf-2
2804
2805Generate source-level debug information with dwarf version 2
2806
Richard Smith081ad4d2017-01-24 19:39:46 +00002807.. option:: -gdwarf-3
2808
2809Generate source-level debug information with dwarf version 3
2810
Richard Smith081ad4d2017-01-24 19:39:46 +00002811.. option:: -gdwarf-4, -gdwarf
2812
2813Generate source-level debug information with dwarf version 4
2814
Richard Smith081ad4d2017-01-24 19:39:46 +00002815.. option:: -gdwarf-5
2816
2817Generate source-level debug information with dwarf version 5
2818
Richard Smith081ad4d2017-01-24 19:39:46 +00002819.. option:: -gfull
2820
Richard Smith081ad4d2017-01-24 19:39:46 +00002821.. option:: -gused
2822
2823Debug level
2824___________
Richard Smith081ad4d2017-01-24 19:39:46 +00002825.. option:: -g0
2826
Richard Smith081ad4d2017-01-24 19:39:46 +00002827.. option:: -g2
2828
Richard Smith081ad4d2017-01-24 19:39:46 +00002829.. option:: -g3
2830
Richard Smith081ad4d2017-01-24 19:39:46 +00002831.. option:: -ggdb0
2832
Richard Smith081ad4d2017-01-24 19:39:46 +00002833.. option:: -ggdb1
2834
Richard Smith081ad4d2017-01-24 19:39:46 +00002835.. option:: -ggdb2
2836
Richard Smith081ad4d2017-01-24 19:39:46 +00002837.. option:: -ggdb3
2838
Richard Smith081ad4d2017-01-24 19:39:46 +00002839.. option:: -gline-tables-only, -g1, -gmlt
2840
2841Emit debug line number tables only
2842
Richard Smith081ad4d2017-01-24 19:39:46 +00002843.. option:: -gmodules
2844
2845Generate debug info with external references to clang modules or precompiled headers
2846
2847Debugger to tune debug information for
2848______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00002849.. option:: -ggdb
2850
Richard Smith081ad4d2017-01-24 19:39:46 +00002851.. option:: -glldb
2852
Richard Smith081ad4d2017-01-24 19:39:46 +00002853.. option:: -gsce
2854
2855Debug information flags
2856-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002857.. option:: -gcolumn-info, -gno-column-info
2858
Richard Smith081ad4d2017-01-24 19:39:46 +00002859.. option:: -gdwarf-aranges
2860
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002861.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00002862
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002863Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00002864
Vedant Kumar368540f2018-08-23 17:55:03 +00002865.. option:: -ggnu-pubnames, -gno-gnu-pubnames
2866
2867.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00002868
Scott Linderde6beb02018-12-14 15:38:15 +00002869.. option:: -grecord-command-line, -grecord-gcc-switches, -gno-record-command-line, -gno-record-gcc-switches
Richard Smith081ad4d2017-01-24 19:39:46 +00002870
Richard Smith081ad4d2017-01-24 19:39:46 +00002871.. option:: -gsplit-dwarf
2872
Richard Smith081ad4d2017-01-24 19:39:46 +00002873.. option:: -gstrict-dwarf, -gno-strict-dwarf
2874
Craig Topperd23254a2017-07-20 17:52:48 +00002875.. option:: -gz
2876
2877DWARF debug sections compression type
2878
2879.. program:: clang1
2880.. option:: -gz=<arg>
2881.. program:: clang
2882
2883DWARF debug sections compression type
2884
Richard Smithc5b2e002017-01-27 02:08:37 +00002885Static analyzer flags
2886=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00002887
Richard Smithc5b2e002017-01-27 02:08:37 +00002888Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00002889
Richard Smithc5b2e002017-01-27 02:08:37 +00002890.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002891
Richard Smithc5b2e002017-01-27 02:08:37 +00002892Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00002893
2894Fortran compilation flags
2895=========================
2896
2897Flags that will be passed onto the ``gfortran`` compiler when Clang is given
2898a Fortran input.
2899
Richard Smithc5b2e002017-01-27 02:08:37 +00002900.. option:: -A<arg>, --assert <arg>, --assert=<arg>
2901
Richard Smith081ad4d2017-01-24 19:39:46 +00002902.. option:: -A-<arg>
2903
Richard Smith081ad4d2017-01-24 19:39:46 +00002904.. option:: -J<arg>
2905
Richard Smith081ad4d2017-01-24 19:39:46 +00002906.. option:: -cpp
2907
Richard Smith081ad4d2017-01-24 19:39:46 +00002908.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
2909
Richard Smith081ad4d2017-01-24 19:39:46 +00002910.. option:: -falign-commons, -fno-align-commons
2911
Richard Smith081ad4d2017-01-24 19:39:46 +00002912.. option:: -fall-intrinsics, -fno-all-intrinsics
2913
Richard Smith081ad4d2017-01-24 19:39:46 +00002914.. option:: -fautomatic, -fno-automatic
2915
Richard Smith081ad4d2017-01-24 19:39:46 +00002916.. option:: -fbackslash, -fno-backslash
2917
Richard Smith081ad4d2017-01-24 19:39:46 +00002918.. option:: -fbacktrace, -fno-backtrace
2919
Richard Smith081ad4d2017-01-24 19:39:46 +00002920.. option:: -fblas-matmul-limit=<arg>
2921
Richard Smith081ad4d2017-01-24 19:39:46 +00002922.. option:: -fbounds-check, -fno-bounds-check
2923
Richard Smith081ad4d2017-01-24 19:39:46 +00002924.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
2925
Richard Smith081ad4d2017-01-24 19:39:46 +00002926.. option:: -fcheck=<arg>
2927
Richard Smith081ad4d2017-01-24 19:39:46 +00002928.. option:: -fcoarray=<arg>
2929
Richard Smith081ad4d2017-01-24 19:39:46 +00002930.. option:: -fconvert=<arg>
2931
Richard Smith081ad4d2017-01-24 19:39:46 +00002932.. option:: -fcray-pointer, -fno-cray-pointer
2933
Richard Smith081ad4d2017-01-24 19:39:46 +00002934.. option:: -fd-lines-as-code, -fno-d-lines-as-code
2935
Richard Smith081ad4d2017-01-24 19:39:46 +00002936.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
2937
Richard Smith081ad4d2017-01-24 19:39:46 +00002938.. option:: -fdefault-double-8, -fno-default-double-8
2939
Richard Smith081ad4d2017-01-24 19:39:46 +00002940.. option:: -fdefault-integer-8, -fno-default-integer-8
2941
Richard Smith081ad4d2017-01-24 19:39:46 +00002942.. option:: -fdefault-real-8, -fno-default-real-8
2943
Richard Smith081ad4d2017-01-24 19:39:46 +00002944.. option:: -fdollar-ok, -fno-dollar-ok
2945
Richard Smith081ad4d2017-01-24 19:39:46 +00002946.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
2947
Richard Smith081ad4d2017-01-24 19:39:46 +00002948.. option:: -fdump-fortran-original, -fno-dump-fortran-original
2949
Richard Smith081ad4d2017-01-24 19:39:46 +00002950.. option:: -fdump-parse-tree, -fno-dump-parse-tree
2951
Richard Smith081ad4d2017-01-24 19:39:46 +00002952.. option:: -fexternal-blas, -fno-external-blas
2953
Richard Smith081ad4d2017-01-24 19:39:46 +00002954.. option:: -ff2c, -fno-f2c
2955
Richard Smith081ad4d2017-01-24 19:39:46 +00002956.. option:: -ffixed-form, -fno-fixed-form
2957
Richard Smith081ad4d2017-01-24 19:39:46 +00002958.. option:: -ffixed-line-length-<arg>
2959
Richard Smith081ad4d2017-01-24 19:39:46 +00002960.. option:: -ffpe-trap=<arg>
2961
Richard Smith081ad4d2017-01-24 19:39:46 +00002962.. option:: -ffree-form, -fno-free-form
2963
Richard Smith081ad4d2017-01-24 19:39:46 +00002964.. option:: -ffree-line-length-<arg>
2965
Richard Smith081ad4d2017-01-24 19:39:46 +00002966.. option:: -ffrontend-optimize, -fno-frontend-optimize
2967
Richard Smith081ad4d2017-01-24 19:39:46 +00002968.. option:: -fimplicit-none, -fno-implicit-none
2969
Richard Smith081ad4d2017-01-24 19:39:46 +00002970.. option:: -finit-character=<arg>
2971
Richard Smith081ad4d2017-01-24 19:39:46 +00002972.. option:: -finit-integer=<arg>
2973
Richard Smith081ad4d2017-01-24 19:39:46 +00002974.. option:: -finit-local-zero, -fno-init-local-zero
2975
Richard Smith081ad4d2017-01-24 19:39:46 +00002976.. option:: -finit-logical=<arg>
2977
Richard Smith081ad4d2017-01-24 19:39:46 +00002978.. option:: -finit-real=<arg>
2979
Richard Smith081ad4d2017-01-24 19:39:46 +00002980.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
2981
Richard Smith081ad4d2017-01-24 19:39:46 +00002982.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
2983
Richard Smith081ad4d2017-01-24 19:39:46 +00002984.. option:: -fmax-array-constructor=<arg>
2985
Richard Smith081ad4d2017-01-24 19:39:46 +00002986.. option:: -fmax-errors=<arg>
2987
Richard Smith081ad4d2017-01-24 19:39:46 +00002988.. option:: -fmax-identifier-length, -fno-max-identifier-length
2989
Richard Smith081ad4d2017-01-24 19:39:46 +00002990.. option:: -fmax-stack-var-size=<arg>
2991
Richard Smith081ad4d2017-01-24 19:39:46 +00002992.. option:: -fmax-subrecord-length=<arg>
2993
Richard Smith081ad4d2017-01-24 19:39:46 +00002994.. option:: -fmodule-private, -fno-module-private
2995
Richard Smith081ad4d2017-01-24 19:39:46 +00002996.. option:: -fpack-derived, -fno-pack-derived
2997
Richard Smith081ad4d2017-01-24 19:39:46 +00002998.. option:: -fprotect-parens, -fno-protect-parens
2999
Richard Smith081ad4d2017-01-24 19:39:46 +00003000.. option:: -frange-check, -fno-range-check
3001
Richard Smith081ad4d2017-01-24 19:39:46 +00003002.. option:: -freal-4-real-10, -fno-real-4-real-10
3003
Richard Smith081ad4d2017-01-24 19:39:46 +00003004.. option:: -freal-4-real-16, -fno-real-4-real-16
3005
Richard Smith081ad4d2017-01-24 19:39:46 +00003006.. option:: -freal-4-real-8, -fno-real-4-real-8
3007
Richard Smith081ad4d2017-01-24 19:39:46 +00003008.. option:: -freal-8-real-10, -fno-real-8-real-10
3009
Richard Smith081ad4d2017-01-24 19:39:46 +00003010.. option:: -freal-8-real-16, -fno-real-8-real-16
3011
Richard Smith081ad4d2017-01-24 19:39:46 +00003012.. option:: -freal-8-real-4, -fno-real-8-real-4
3013
Richard Smith081ad4d2017-01-24 19:39:46 +00003014.. option:: -frealloc-lhs, -fno-realloc-lhs
3015
Richard Smith081ad4d2017-01-24 19:39:46 +00003016.. option:: -frecord-marker=<arg>
3017
Richard Smith081ad4d2017-01-24 19:39:46 +00003018.. option:: -frecursive, -fno-recursive
3019
Richard Smith081ad4d2017-01-24 19:39:46 +00003020.. option:: -frepack-arrays, -fno-repack-arrays
3021
Richard Smith081ad4d2017-01-24 19:39:46 +00003022.. option:: -fsecond-underscore, -fno-second-underscore
3023
Richard Smith081ad4d2017-01-24 19:39:46 +00003024.. option:: -fsign-zero, -fno-sign-zero
3025
Richard Smith081ad4d2017-01-24 19:39:46 +00003026.. option:: -fstack-arrays, -fno-stack-arrays
3027
Richard Smith081ad4d2017-01-24 19:39:46 +00003028.. option:: -funderscoring, -fno-underscoring
3029
Richard Smith081ad4d2017-01-24 19:39:46 +00003030.. option:: -fwhole-file, -fno-whole-file
3031
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003032.. option:: -imultilib <arg>
3033
Richard Smith081ad4d2017-01-24 19:39:46 +00003034.. option:: -nocpp
3035
Richard Smith081ad4d2017-01-24 19:39:46 +00003036.. option:: -static-libgfortran
3037
Richard Smithc5b2e002017-01-27 02:08:37 +00003038Linker flags
3039============
3040Flags that are passed on to the linker
3041
3042.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3043
3044Add directory to library search path
3045
3046.. option:: -Mach
3047
3048.. option:: -T<script>
3049
3050Specify <script> as linker script
3051
Richard Smith78e23fd2017-04-13 22:39:49 +00003052.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003053
3054Set starting address of BSS to <addr>
3055
Richard Smith78e23fd2017-04-13 22:39:49 +00003056.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003057
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003058Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003059
Richard Smith78e23fd2017-04-13 22:39:49 +00003060.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003061
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003062Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003063
3064.. option:: -Wl,<arg>,<arg2>...
3065
3066Pass the comma separated arguments in <arg> to the linker
3067
3068.. option:: -X
3069
3070.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3071
3072Pass <arg> to the linker
3073
3074.. program:: clang1
3075.. option:: -Z
3076.. program:: clang
3077
3078.. option:: -e<arg>, --entry
3079
3080.. option:: -filelist <arg>
3081
Vedant Kumar368540f2018-08-23 17:55:03 +00003082.. option:: --hip-device-lib-path=<arg>
3083
3084HIP device library path
3085
3086.. option:: --hip-device-lib=<arg>
3087
3088HIP device library
3089
Richard Smithc5b2e002017-01-27 02:08:37 +00003090.. option:: -l<arg>
3091
3092.. option:: -r
3093
3094.. option:: -rpath <arg>
3095
3096.. option:: -s
3097
3098.. option:: -t
3099
3100.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3101
3102.. option:: -undef
3103
3104undef all system defines
3105
3106.. option:: -undefined<arg>, --no-undefined
3107
3108.. option:: -z <arg>
3109
3110Pass -z <arg> to the linker
3111