blob: 540c8527d280a37f977faa109d1532835f8bfd78 [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
161Include PTX for the follwing GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once.
162
Richard Smith081ad4d2017-01-24 19:39:46 +0000163.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
164
165Enable device-side debug info generation. Disables ptxas optimizations.
166
Richard Smith081ad4d2017-01-24 19:39:46 +0000167.. option:: -current\_version<arg>
168
Richard Smith081ad4d2017-01-24 19:39:46 +0000169.. option:: -dead\_strip
170
Richard Smith081ad4d2017-01-24 19:39:46 +0000171.. option:: -dependency-dot <arg>
172
173Filename to write DOT-formatted header dependencies to
174
Richard Smith081ad4d2017-01-24 19:39:46 +0000175.. option:: -dependency-file <arg>
176
177Filename (or -) to write dependency output to
178
Richard Smith081ad4d2017-01-24 19:39:46 +0000179.. option:: -dumpmachine
180
Richard Smith081ad4d2017-01-24 19:39:46 +0000181.. option:: -dumpversion
182
Richard Smith081ad4d2017-01-24 19:39:46 +0000183.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
184
Richard Smith081ad4d2017-01-24 19:39:46 +0000185.. option:: -dylib\_file <arg>
186
Richard Smith081ad4d2017-01-24 19:39:46 +0000187.. option:: -dylinker
188
Richard Smithb2c82a62017-01-27 01:54:42 +0000189.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000190.. option:: -dylinker\_install\_name<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000191.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000192
Richard Smith081ad4d2017-01-24 19:39:46 +0000193.. option:: -dynamic
194
Richard Smith081ad4d2017-01-24 19:39:46 +0000195.. option:: -dynamiclib
196
Richard Smith081ad4d2017-01-24 19:39:46 +0000197.. option:: -emit-ast
198
199Emit Clang AST files for source inputs
200
Richard Smith081ad4d2017-01-24 19:39:46 +0000201.. option:: -exported\_symbols\_list <arg>
202
Richard Smith081ad4d2017-01-24 19:39:46 +0000203.. option:: -faligned-new=<arg>
204
Richard Smith081ad4d2017-01-24 19:39:46 +0000205.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
206
207Use approximate transcendental functions
208
Richard Smith081ad4d2017-01-24 19:39:46 +0000209.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
210
211Flush denormal floating point values to zero in CUDA device mode.
212
Craig Topper42da9cb2018-04-23 21:41:06 +0000213.. option:: -fcuda-rdc, -fno-cuda-rdc
214
215Generate relocatable device code, also known as separate compilation mode.
216
Vedant Kumar368540f2018-08-23 17:55:03 +0000217.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
218
219Use 32-bit pointers for accessing const/local/shared address spaces.
220
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000221.. option:: -ffixed-r19
222
Vedant Kumar368540f2018-08-23 17:55:03 +0000223Reserve register r19 (Hexagon only)
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000224
Richard Smith081ad4d2017-01-24 19:39:46 +0000225.. option:: -fheinous-gnu-extensions
226
Richard Smith081ad4d2017-01-24 19:39:46 +0000227.. option:: -flat\_namespace
228
Richard Smith081ad4d2017-01-24 19:39:46 +0000229.. option:: -fopenmp-targets=<arg1>,<arg2>...
230
231Specify comma-separated list of triples OpenMP offloading targets to be supported
232
Richard Smith081ad4d2017-01-24 19:39:46 +0000233.. option:: -force\_cpusubtype\_ALL
234
Richard Smithb2c82a62017-01-27 01:54:42 +0000235.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000236.. option:: -force\_flat\_namespace
Richard Smithb2c82a62017-01-27 01:54:42 +0000237.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000238
Richard Smithb2c82a62017-01-27 01:54:42 +0000239.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000240.. option:: -force\_load <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000241.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000242
Richard Smith081ad4d2017-01-24 19:39:46 +0000243.. option:: -framework <arg>
244
Richard Smith78e23fd2017-04-13 22:39:49 +0000245.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
246
247Add -rpath with architecture-specific resource directory to the linker flags
248
Richard Smith081ad4d2017-01-24 19:39:46 +0000249.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
250
251Use the gcc toolchain at the given directory
252
Richard Smith081ad4d2017-01-24 19:39:46 +0000253.. option:: -gcodeview
254
255Generate CodeView debug information
256
Richard Smith081ad4d2017-01-24 19:39:46 +0000257.. option:: -headerpad\_max\_install\_names<arg>
258
Richard Smith081ad4d2017-01-24 19:39:46 +0000259.. option:: -help, --help
260
261Display available options
262
Richard Smith081ad4d2017-01-24 19:39:46 +0000263.. option:: --help-hidden
264
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000265Display help for hidden options
266
Vedant Kumar368540f2018-08-23 17:55:03 +0000267.. option:: --hip-link
268
269Link clang-offload-bundler bundles for HIP
270
Richard Smith081ad4d2017-01-24 19:39:46 +0000271.. option:: -image\_base <arg>
272
Richard Smith081ad4d2017-01-24 19:39:46 +0000273.. option:: -index-header-map
274
275Make the next included directory (-I or -F) an indexer header map
276
Richard Smith081ad4d2017-01-24 19:39:46 +0000277.. option:: -init <arg>
278
Richard Smith081ad4d2017-01-24 19:39:46 +0000279.. option:: -install\_name <arg>
280
Richard Smith081ad4d2017-01-24 19:39:46 +0000281.. option:: -keep\_private\_externs
282
Richard Smith081ad4d2017-01-24 19:39:46 +0000283.. option:: -lazy\_framework <arg>
284
Richard Smithb2c82a62017-01-27 01:54:42 +0000285.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000286.. option:: -lazy\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000287.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000288
Richard Smith081ad4d2017-01-24 19:39:46 +0000289.. option:: -mbig-endian, -EB
290
Richard Smith081ad4d2017-01-24 19:39:46 +0000291.. option:: --migrate
292
293Run the migrator
294
Richard Smith78e23fd2017-04-13 22:39:49 +0000295.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
296
Richard Smith081ad4d2017-01-24 19:39:46 +0000297.. option:: -mlinker-version=<arg>
298
Richard Smith081ad4d2017-01-24 19:39:46 +0000299.. option:: -mlittle-endian, -EL
300
Richard Smith081ad4d2017-01-24 19:39:46 +0000301.. option:: -mllvm <arg>
302
303Additional arguments to forward to LLVM's option processing
304
Richard Smith081ad4d2017-01-24 19:39:46 +0000305.. option:: -module-dependency-dir <arg>
306
307Directory to dump module dependencies to
308
Richard Smith78e23fd2017-04-13 22:39:49 +0000309.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
310
Richard Smith081ad4d2017-01-24 19:39:46 +0000311.. option:: -multi\_module
312
Richard Smith081ad4d2017-01-24 19:39:46 +0000313.. option:: -multiply\_defined <arg>
314
Richard Smithb2c82a62017-01-27 01:54:42 +0000315.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000316.. option:: -multiply\_defined\_unused <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000317.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000318
Richard Smith78e23fd2017-04-13 22:39:49 +0000319.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
320
Richard Smith081ad4d2017-01-24 19:39:46 +0000321.. option:: --no-cuda-version-check
322
323Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
324
Richard Smith081ad4d2017-01-24 19:39:46 +0000325.. option:: -no-integrated-cpp, --no-integrated-cpp
326
Richard Smith081ad4d2017-01-24 19:39:46 +0000327.. option:: -no\_dead\_strip\_inits\_and\_terms
328
Richard Smith081ad4d2017-01-24 19:39:46 +0000329.. option:: -nobuiltininc
330
331Disable builtin #include directories
332
Richard Smith081ad4d2017-01-24 19:39:46 +0000333.. option:: -nocudainc
334
Richard Smith081ad4d2017-01-24 19:39:46 +0000335.. option:: -nocudalib
336
Richard Smith081ad4d2017-01-24 19:39:46 +0000337.. option:: -nodefaultlibs
338
Richard Smith081ad4d2017-01-24 19:39:46 +0000339.. option:: -nofixprebinding
340
Richard Smith081ad4d2017-01-24 19:39:46 +0000341.. option:: -nolibc
342
Richard Smith081ad4d2017-01-24 19:39:46 +0000343.. option:: -nomultidefs
344
Craig Topperd23254a2017-07-20 17:52:48 +0000345.. option:: -nopie, -no-pie
Richard Smith081ad4d2017-01-24 19:39:46 +0000346
Richard Smith081ad4d2017-01-24 19:39:46 +0000347.. option:: -noprebind
348
Richard Smith081ad4d2017-01-24 19:39:46 +0000349.. option:: -noseglinkedit
350
Richard Smith081ad4d2017-01-24 19:39:46 +0000351.. option:: -nostartfiles
352
Richard Smith081ad4d2017-01-24 19:39:46 +0000353.. option:: -nostdinc, --no-standard-includes
354
Richard Smithb2c82a62017-01-27 01:54:42 +0000355.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000356.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000357.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000358
359Disable standard #include directories for the C++ standard library
360
Richard Smith081ad4d2017-01-24 19:39:46 +0000361.. option:: -nostdlib, --no-standard-libraries
362
Boris Kolpackovb150d242017-08-30 09:15:53 +0000363.. program:: clang1
364.. option:: -nostdlib++
365.. program:: clang
366
Richard Smith081ad4d2017-01-24 19:39:46 +0000367.. option:: -nostdlibinc
368
Richard Smith081ad4d2017-01-24 19:39:46 +0000369.. option:: -o<file>, --output <arg>, --output=<arg>
370
371Write output to <file>
372
Richard Smith081ad4d2017-01-24 19:39:46 +0000373.. option:: -objcmt-atomic-property
374
375Make migration to 'atomic' properties
376
Richard Smith081ad4d2017-01-24 19:39:46 +0000377.. option:: -objcmt-migrate-all
378
379Enable migration to modern ObjC
380
Richard Smith081ad4d2017-01-24 19:39:46 +0000381.. option:: -objcmt-migrate-annotation
382
383Enable migration to property and method annotations
384
Richard Smith081ad4d2017-01-24 19:39:46 +0000385.. option:: -objcmt-migrate-designated-init
386
387Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
388
Richard Smith081ad4d2017-01-24 19:39:46 +0000389.. option:: -objcmt-migrate-instancetype
390
391Enable migration to infer instancetype for method result type
392
Richard Smith081ad4d2017-01-24 19:39:46 +0000393.. option:: -objcmt-migrate-literals
394
395Enable migration to modern ObjC literals
396
Richard Smith081ad4d2017-01-24 19:39:46 +0000397.. option:: -objcmt-migrate-ns-macros
398
399Enable migration to NS\_ENUM/NS\_OPTIONS macros
400
Richard Smith081ad4d2017-01-24 19:39:46 +0000401.. option:: -objcmt-migrate-property
402
403Enable migration to modern ObjC property
404
Richard Smith081ad4d2017-01-24 19:39:46 +0000405.. option:: -objcmt-migrate-property-dot-syntax
406
407Enable migration of setter/getter messages to property-dot syntax
408
Richard Smith081ad4d2017-01-24 19:39:46 +0000409.. option:: -objcmt-migrate-protocol-conformance
410
411Enable migration to add protocol conformance on classes
412
Richard Smith081ad4d2017-01-24 19:39:46 +0000413.. option:: -objcmt-migrate-readonly-property
414
415Enable migration to modern ObjC readonly property
416
Richard Smith081ad4d2017-01-24 19:39:46 +0000417.. option:: -objcmt-migrate-readwrite-property
418
419Enable migration to modern ObjC readwrite property
420
Richard Smith081ad4d2017-01-24 19:39:46 +0000421.. option:: -objcmt-migrate-subscripting
422
423Enable migration to modern ObjC subscripting
424
Richard Smith081ad4d2017-01-24 19:39:46 +0000425.. option:: -objcmt-ns-nonatomic-iosonly
426
427Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
428
Richard Smith081ad4d2017-01-24 19:39:46 +0000429.. option:: -objcmt-returns-innerpointer-property
430
431Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
432
Richard Smith081ad4d2017-01-24 19:39:46 +0000433.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
434
435Only modify files with a filename contained in the provided directory path
436
Richard Smith081ad4d2017-01-24 19:39:46 +0000437.. option:: -object
438
Richard Smith081ad4d2017-01-24 19:39:46 +0000439.. option:: -p, --profile
440
Richard Smith081ad4d2017-01-24 19:39:46 +0000441.. option:: -pagezero\_size<arg>
442
Richard Smith081ad4d2017-01-24 19:39:46 +0000443.. option:: -pg
444
445Enable mcount instrumentation
446
Richard Smith081ad4d2017-01-24 19:39:46 +0000447.. option:: -pie
448
Richard Smith081ad4d2017-01-24 19:39:46 +0000449.. option:: -pipe, --pipe
450
451Use pipes between commands, when possible
452
Richard Smith081ad4d2017-01-24 19:39:46 +0000453.. option:: -prebind
454
Richard Smithb2c82a62017-01-27 01:54:42 +0000455.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000456.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000457.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000458
Richard Smith081ad4d2017-01-24 19:39:46 +0000459.. option:: -preload
460
Richard Smith081ad4d2017-01-24 19:39:46 +0000461.. option:: --print-diagnostic-categories
462
Vedant Kumar368540f2018-08-23 17:55:03 +0000463.. option:: -print-effective-triple, --print-effective-triple
464
465Print the effective target triple
466
Richard Smith081ad4d2017-01-24 19:39:46 +0000467.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
468
469Print the full library path of <file>
470
Richard Smith081ad4d2017-01-24 19:39:46 +0000471.. option:: -print-ivar-layout
472
473Enable Objective-C Ivar layout bitmap print trace
474
Richard Smith081ad4d2017-01-24 19:39:46 +0000475.. option:: -print-libgcc-file-name, --print-libgcc-file-name
476
477Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
478
Richard Smith081ad4d2017-01-24 19:39:46 +0000479.. option:: -print-multi-directory, --print-multi-directory
480
Richard Smith081ad4d2017-01-24 19:39:46 +0000481.. option:: -print-multi-lib, --print-multi-lib
482
Richard Smith081ad4d2017-01-24 19:39:46 +0000483.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
484
485Print the full program path of <name>
486
Richard Smith78e23fd2017-04-13 22:39:49 +0000487.. option:: -print-resource-dir, --print-resource-dir
488
489Print the resource directory pathname
490
Richard Smith081ad4d2017-01-24 19:39:46 +0000491.. option:: -print-search-dirs, --print-search-dirs
492
493Print the paths used for finding libraries and programs
494
Vedant Kumar368540f2018-08-23 17:55:03 +0000495.. option:: -print-target-triple, --print-target-triple
496
497Print the normalized target triple
498
Richard Smith081ad4d2017-01-24 19:39:46 +0000499.. option:: -private\_bundle
500
Richard Smith081ad4d2017-01-24 19:39:46 +0000501.. option:: -pthread, -no-pthread
502
503Support POSIX threads in generated code
504
Richard Smith081ad4d2017-01-24 19:39:46 +0000505.. option:: -pthreads
506
Richard Smith081ad4d2017-01-24 19:39:46 +0000507.. option:: -rdynamic
508
Richard Smith081ad4d2017-01-24 19:39:46 +0000509.. option:: -read\_only\_relocs <arg>
510
Richard Smith081ad4d2017-01-24 19:39:46 +0000511.. option:: -relocatable-pch, --relocatable-pch
512
513Whether to build a relocatable precompiled header
514
Richard Smith081ad4d2017-01-24 19:39:46 +0000515.. option:: -remap
516
Richard Smith081ad4d2017-01-24 19:39:46 +0000517.. option:: -rewrite-legacy-objc
518
519Rewrite Legacy Objective-C source to C++
520
Richard Smith081ad4d2017-01-24 19:39:46 +0000521.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
522
523Compiler runtime library to use
524
Richard Smith081ad4d2017-01-24 19:39:46 +0000525.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
526
527Save llvm statistics.
528
Richard Smith081ad4d2017-01-24 19:39:46 +0000529.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
530
531Save intermediate compilation results.
532
Richard Smith081ad4d2017-01-24 19:39:46 +0000533.. option:: -sectalign <arg1> <arg2> <arg3>
534
Richard Smith081ad4d2017-01-24 19:39:46 +0000535.. option:: -sectcreate <arg1> <arg2> <arg3>
536
Richard Smith081ad4d2017-01-24 19:39:46 +0000537.. option:: -sectobjectsymbols <arg1> <arg2>
538
Richard Smith081ad4d2017-01-24 19:39:46 +0000539.. option:: -sectorder <arg1> <arg2> <arg3>
540
Richard Smith081ad4d2017-01-24 19:39:46 +0000541.. option:: -seg1addr<arg>
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -seg\_addr\_table <arg>
544
Richard Smithb2c82a62017-01-27 01:54:42 +0000545.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000546.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000547.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000548
Richard Smith081ad4d2017-01-24 19:39:46 +0000549.. option:: -segaddr <arg1> <arg2>
550
Richard Smith081ad4d2017-01-24 19:39:46 +0000551.. option:: -segcreate <arg1> <arg2> <arg3>
552
Richard Smith081ad4d2017-01-24 19:39:46 +0000553.. option:: -seglinkedit
554
Richard Smith081ad4d2017-01-24 19:39:46 +0000555.. option:: -segprot <arg1> <arg2> <arg3>
556
Richard Smith081ad4d2017-01-24 19:39:46 +0000557.. option:: -segs\_read\_<arg>
558
Richard Smithb2c82a62017-01-27 01:54:42 +0000559.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000560.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000561.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000562
Richard Smithb2c82a62017-01-27 01:54:42 +0000563.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000564.. option:: -segs\_read\_write\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000565.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000566
Richard Smith081ad4d2017-01-24 19:39:46 +0000567.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
568
569Serialize compiler diagnostics to a file
570
Richard Smith081ad4d2017-01-24 19:39:46 +0000571.. option:: -shared, --shared
572
Richard Smith081ad4d2017-01-24 19:39:46 +0000573.. option:: -shared-libgcc
574
Craig Topper16418662017-11-20 18:07:43 +0000575.. option:: -shared-libsan, -shared-libasan
576
Vedant Kumar368540f2018-08-23 17:55:03 +0000577Dynamically link the sanitizer runtime
578
Richard Smith081ad4d2017-01-24 19:39:46 +0000579.. option:: -single\_module
580
Richard Smith081ad4d2017-01-24 19:39:46 +0000581.. option:: -specs=<arg>, --specs=<arg>
582
Richard Smith081ad4d2017-01-24 19:39:46 +0000583.. option:: -static, --static
584
Richard Smith081ad4d2017-01-24 19:39:46 +0000585.. option:: -static-libgcc
586
Craig Topper16418662017-11-20 18:07:43 +0000587.. option:: -static-libsan
588
Vedant Kumar368540f2018-08-23 17:55:03 +0000589Statically link the sanitizer runtime
590
Richard Smith081ad4d2017-01-24 19:39:46 +0000591.. option:: -static-libstdc++
592
Richard Smith081ad4d2017-01-24 19:39:46 +0000593.. option:: -std-default=<arg>
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
596
597C++ standard library to use
598
Richard Smith081ad4d2017-01-24 19:39:46 +0000599.. option:: -sub\_library<arg>
600
Richard Smithb2c82a62017-01-27 01:54:42 +0000601.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000602.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000603.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000604
Richard Smith081ad4d2017-01-24 19:39:46 +0000605.. option:: --sysroot=<arg>, --sysroot <arg>
606
Richard Smith081ad4d2017-01-24 19:39:46 +0000607.. option:: --target-help
608
Richard Smith081ad4d2017-01-24 19:39:46 +0000609.. option:: --target=<arg>, -target <arg>
610
611Generate code for the given target
612
Richard Smith081ad4d2017-01-24 19:39:46 +0000613.. option:: -time
614
615Time individual commands
616
Richard Smith081ad4d2017-01-24 19:39:46 +0000617.. option:: -traditional, --traditional
618
Richard Smith081ad4d2017-01-24 19:39:46 +0000619.. option:: -traditional-cpp, --traditional-cpp
620
621Enable some traditional CPP emulation
622
Richard Smith081ad4d2017-01-24 19:39:46 +0000623.. option:: -twolevel\_namespace
624
Richard Smithb2c82a62017-01-27 01:54:42 +0000625.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000626.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000627.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000628
Richard Smith081ad4d2017-01-24 19:39:46 +0000629.. option:: -umbrella <arg>
630
Richard Smith081ad4d2017-01-24 19:39:46 +0000631.. option:: -unexported\_symbols\_list <arg>
632
Richard Smith081ad4d2017-01-24 19:39:46 +0000633.. option:: -v, --verbose
634
635Show commands to run and use verbose output
636
Richard Smith081ad4d2017-01-24 19:39:46 +0000637.. option:: --verify-debug-info
638
639Verify the binary representation of debug output
640
Richard Smith081ad4d2017-01-24 19:39:46 +0000641.. option:: --version
642
Craig Topper16418662017-11-20 18:07:43 +0000643Print version information
644
Richard Smith081ad4d2017-01-24 19:39:46 +0000645.. option:: -w, --no-warnings
646
647Suppress all warnings
648
Richard Smith081ad4d2017-01-24 19:39:46 +0000649.. option:: -weak-l<arg>
650
Richard Smith081ad4d2017-01-24 19:39:46 +0000651.. option:: -weak\_framework <arg>
652
Richard Smithb2c82a62017-01-27 01:54:42 +0000653.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000654.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000655.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000656
Richard Smithb2c82a62017-01-27 01:54:42 +0000657.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000658.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000659.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000660
Richard Smith081ad4d2017-01-24 19:39:46 +0000661.. option:: -whatsloaded
662
Richard Smith081ad4d2017-01-24 19:39:46 +0000663.. option:: -whyload
664
Richard Smith081ad4d2017-01-24 19:39:46 +0000665.. option:: -working-directory<arg>, -working-directory=<arg>
666
667Resolve file paths relative to the specified directory
668
Richard Smith081ad4d2017-01-24 19:39:46 +0000669.. option:: -x<language>, --language <arg>, --language=<arg>
670
671Treat subsequent input files as having type <language>
672
Richard Smith081ad4d2017-01-24 19:39:46 +0000673.. option:: -y<arg>
674
675Actions
676=======
677The action to perform on the input.
678
Richard Smith081ad4d2017-01-24 19:39:46 +0000679.. option:: -E, --preprocess
680
681Only run the preprocessor
682
Richard Smith081ad4d2017-01-24 19:39:46 +0000683.. option:: -S, --assemble
684
685Only run preprocess and compilation steps
686
Richard Smithc5b2e002017-01-27 02:08:37 +0000687.. option:: -c, --compile
688
689Only run preprocess, compile, and assemble steps
690
Richard Smith081ad4d2017-01-24 19:39:46 +0000691.. option:: -emit-llvm
692
693Use the LLVM representation for assembler and object files
694
Richard Smith081ad4d2017-01-24 19:39:46 +0000695.. option:: -fsyntax-only
696
Richard Smith081ad4d2017-01-24 19:39:46 +0000697.. option:: -module-file-info
698
699Provide information about a particular module file
700
Richard Smith081ad4d2017-01-24 19:39:46 +0000701.. option:: --precompile
702
703Only precompile the input
704
Richard Smith081ad4d2017-01-24 19:39:46 +0000705.. option:: -rewrite-objc
706
707Rewrite Objective-C source to C++
708
Richard Smith081ad4d2017-01-24 19:39:46 +0000709.. option:: -verify-pch
710
711Load and verify that a pre-compiled header file is not stale
712
713Compilation flags
714=================
715
716Flags controlling the behavior of Clang during compilation. These flags have
717no effect during actions that do not perform compilation.
718
Richard Smithc5b2e002017-01-27 02:08:37 +0000719.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000720
Richard Smithc5b2e002017-01-27 02:08:37 +0000721Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000722
Richard Smith081ad4d2017-01-24 19:39:46 +0000723.. option:: -Xclang <arg>
724
725Pass <arg> to the clang compiler
726
Boris Kolpackovb150d242017-08-30 09:15:53 +0000727.. option:: -fclang-abi-compat=<version>
728
729Attempt to match the ABI of Clang <version>
730
Richard Smith081ad4d2017-01-24 19:39:46 +0000731.. option:: -fcomment-block-commands=<arg>,<arg2>...
732
733Treat each comma separated argument in <arg> as a documentation comment block command
734
Vedant Kumar368540f2018-08-23 17:55:03 +0000735.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
736
737Require member pointer base types to be complete if they would be significant under the Microsoft ABI
738
739.. option:: -fcrash-diagnostics-dir=<arg>
740
Richard Smith081ad4d2017-01-24 19:39:46 +0000741.. option:: -fdeclspec, -fno-declspec
742
743Allow \_\_declspec as a keyword
744
Richard Smith081ad4d2017-01-24 19:39:46 +0000745.. option:: -fdepfile-entry=<arg>
746
Richard Smith081ad4d2017-01-24 19:39:46 +0000747.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
748
Richard Smith081ad4d2017-01-24 19:39:46 +0000749.. option:: -fdiagnostics-format=<arg>
750
Richard Smith081ad4d2017-01-24 19:39:46 +0000751.. option:: -fdiagnostics-parseable-fixits
752
753Print fix-its in machine parseable form
754
Richard Smith081ad4d2017-01-24 19:39:46 +0000755.. option:: -fdiagnostics-print-source-range-info
756
757Print source range spans in numeric form
758
Richard Smith081ad4d2017-01-24 19:39:46 +0000759.. option:: -fdiagnostics-show-category=<arg>
760
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000761.. option:: -fdiscard-value-names, -fno-discard-value-names
762
763Discard value names in LLVM IR
764
765.. option:: -fexperimental-isel, -fno-experimental-isel
766
767Enables the experimental global instruction selector
768
Richard Smith081ad4d2017-01-24 19:39:46 +0000769.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
770
771Enables an experimental new pass manager in LLVM.
772
Craig Topper16418662017-11-20 18:07:43 +0000773.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
774
Vedant Kumar368540f2018-08-23 17:55:03 +0000775Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Craig Topper16418662017-11-20 18:07:43 +0000776
Richard Smith081ad4d2017-01-24 19:39:46 +0000777.. option:: -finline-functions, -fno-inline-functions
778
779Inline suitable functions
780
Richard Smith081ad4d2017-01-24 19:39:46 +0000781.. option:: -finline-hint-functions
782
783Inline functions which are (explicitly or implicitly) marked inline
784
Richard Smith081ad4d2017-01-24 19:39:46 +0000785.. option:: -fno-crash-diagnostics
786
Richard Smith78e23fd2017-04-13 22:39:49 +0000787Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
788
Richard Smith081ad4d2017-01-24 19:39:46 +0000789.. option:: -fno-sanitize-blacklist
790
791Don't use blacklist file for sanitizers
792
Richard Smith081ad4d2017-01-24 19:39:46 +0000793.. option:: -fparse-all-comments
794
Richard Smith081ad4d2017-01-24 19:39:46 +0000795.. option:: -fsanitize-address-field-padding=<arg>
796
797Level of field padding for AddressSanitizer
798
Craig Topperd23254a2017-07-20 17:52:48 +0000799.. option:: -fsanitize-address-globals-dead-stripping
800
801Enable linker dead stripping of globals in AddressSanitizer
802
Vitaly Buka8076c572018-12-05 01:44:31 +0000803.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
804
805Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
806
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000807.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000808
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000809Enable "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.
810
811An 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 +0000812
Richard Smith081ad4d2017-01-24 19:39:46 +0000813.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
814
815Enable use-after-scope detection in AddressSanitizer
816
Richard Smith081ad4d2017-01-24 19:39:46 +0000817.. option:: -fsanitize-blacklist=<arg>
818
819Path to blacklist file for sanitizers
820
Richard Smith081ad4d2017-01-24 19:39:46 +0000821.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
822
823Enable control flow integrity (CFI) checks for cross-DSO calls.
824
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000825.. option:: -fsanitize-cfi-icall-generalize-pointers
826
Craig Topper16418662017-11-20 18:07:43 +0000827Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000828
Richard Smith081ad4d2017-01-24 19:39:46 +0000829.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
830
831Specify the type of coverage instrumentation for Sanitizers
832
Richard Smith081ad4d2017-01-24 19:39:46 +0000833.. option:: -fsanitize-link-c++-runtime
834
Richard Smith081ad4d2017-01-24 19:39:46 +0000835.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
836
837Enable origins tracking in MemorySanitizer
838
Richard Smithb2c82a62017-01-27 01:54:42 +0000839.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000840.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000841.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000842
843Enable origins tracking in MemorySanitizer
844
Craig Topper16418662017-11-20 18:07:43 +0000845.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000846
847Enable use-after-destroy detection in MemorySanitizer
848
Boris Kolpackovb150d242017-08-30 09:15:53 +0000849.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
850
Richard Smith081ad4d2017-01-24 19:39:46 +0000851.. option:: -fsanitize-recover, -fno-sanitize-recover
852
Richard Smithb2c82a62017-01-27 01:54:42 +0000853.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000854.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +0000855.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000856
857Enable recovery for specified sanitizers
858
Richard Smith081ad4d2017-01-24 19:39:46 +0000859.. option:: -fsanitize-stats, -fno-sanitize-stats
860
861Enable sanitizer statistics gathering.
862
Richard Smith081ad4d2017-01-24 19:39:46 +0000863.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
864
865Enable atomic operations instrumentation in ThreadSanitizer (default)
866
Richard Smith081ad4d2017-01-24 19:39:46 +0000867.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
868
869Enable function entry/exit instrumentation in ThreadSanitizer (default)
870
Richard Smith081ad4d2017-01-24 19:39:46 +0000871.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
872
873Enable memory access instrumentation in ThreadSanitizer (default)
874
Richard Smith081ad4d2017-01-24 19:39:46 +0000875.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
876
877Enable trapping for specified sanitizers
878
Richard Smith081ad4d2017-01-24 19:39:46 +0000879.. option:: -fsanitize-undefined-strip-path-components=<number>
880
881Strip (or keep only, if negative) a given number of path components when emitting check metadata.
882
Richard Smith081ad4d2017-01-24 19:39:46 +0000883.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
884
Richard Smith081ad4d2017-01-24 19:39:46 +0000885.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
886
887Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
888
Vedant Kumar368540f2018-08-23 17:55:03 +0000889.. option:: -moutline, -mno-outline
890
891Enable function outlining (AArch64 only)
892
Richard Smith081ad4d2017-01-24 19:39:46 +0000893.. option:: --param <arg>, --param=<arg>
894
Richard Smith081ad4d2017-01-24 19:39:46 +0000895.. option:: -std=<arg>, --std=<arg>, --std <arg>
896
897Language standard to compile for
898
Richard Smithc5b2e002017-01-27 02:08:37 +0000899Preprocessor flags
900~~~~~~~~~~~~~~~~~~
901
902Flags controlling the behavior of the Clang preprocessor.
903
904.. option:: -C, --comments
905
906Include comments in preprocessed output
907
908.. option:: -CC, --comments-in-macros
909
910Include comments from within macros in preprocessed output
911
912.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
913
914Define <macro> to <value> (or 1 if <value> omitted)
915
916.. option:: -H, --trace-includes
917
918Show header includes and nesting depth
919
920.. option:: -P, --no-line-commands
921
922Disable linemarker output in -E mode
923
924.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
925
926Undefine macro <macro>
927
928.. option:: -Wp,<arg>,<arg2>...
929
930Pass the comma separated arguments in <arg> to the preprocessor
931
932.. option:: -Xpreprocessor <arg>
933
934Pass <arg> to the preprocessor
935
Richard Smith081ad4d2017-01-24 19:39:46 +0000936Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +0000937-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +0000938
939Flags controlling how ``#include``\s are resolved to files.
940
Richard Smithc5b2e002017-01-27 02:08:37 +0000941.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000942
943Add directory to include search path
944
Richard Smith081ad4d2017-01-24 19:39:46 +0000945.. option:: -I-, --include-barrier
946
Richard Smithc5b2e002017-01-27 02:08:37 +0000947Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
948
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000949.. option:: --cuda-path-ignore-env
950
951Ignore environment variables to detect CUDA installation
952
Richard Smith081ad4d2017-01-24 19:39:46 +0000953.. option:: --cuda-path=<arg>
954
955CUDA installation path
956
Richard Smith081ad4d2017-01-24 19:39:46 +0000957.. option:: -cxx-isystem<directory>
958
959Add directory to the C++ SYSTEM include search path
960
Richard Smith081ad4d2017-01-24 19:39:46 +0000961.. option:: -fbuild-session-file=<file>
962
963Use the last modification time of <file> as the build session timestamp
964
Richard Smith081ad4d2017-01-24 19:39:46 +0000965.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
966
967Time when the current build session started
968
Boris Kolpackovb150d242017-08-30 09:15:53 +0000969.. option:: -fmodule-file=\[<name>=\]<file>
970
971Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
972
Richard Smith081ad4d2017-01-24 19:39:46 +0000973.. option:: -fmodules-cache-path=<directory>
974
975Specify the module cache path
976
Richard Smith081ad4d2017-01-24 19:39:46 +0000977.. option:: -fmodules-disable-diagnostic-validation
978
979Disable validation of the diagnostic options when loading the module
980
Richard Smith081ad4d2017-01-24 19:39:46 +0000981.. option:: -fmodules-prune-after=<seconds>
982
983Specify the interval (in seconds) after which a module file will be considered unused
984
Richard Smith081ad4d2017-01-24 19:39:46 +0000985.. option:: -fmodules-prune-interval=<seconds>
986
987Specify the interval (in seconds) between attempts to prune the module cache
988
Richard Smith081ad4d2017-01-24 19:39:46 +0000989.. option:: -fmodules-user-build-path <directory>
990
991Specify the module user build path
992
Richard Smith081ad4d2017-01-24 19:39:46 +0000993.. option:: -fmodules-validate-once-per-build-session
994
995Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
996
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000997.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
Richard Smith081ad4d2017-01-24 19:39:46 +0000998
999Validate the system headers that a module depends on when loading the module
1000
Richard Smith081ad4d2017-01-24 19:39:46 +00001001.. option:: -fprebuilt-module-path=<directory>
1002
1003Specify the prebuilt module path
1004
Richard Smith081ad4d2017-01-24 19:39:46 +00001005.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1006
1007Add directory to AFTER include search path
1008
Richard Smith081ad4d2017-01-24 19:39:46 +00001009.. option:: -iframework<arg>
1010
1011Add directory to SYSTEM framework search path
1012
Richard Smith78e23fd2017-04-13 22:39:49 +00001013.. option:: -iframeworkwithsysroot<directory>
1014
1015Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1016
Richard Smith081ad4d2017-01-24 19:39:46 +00001017.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1018
1019Include macros from file before parsing
1020
Richard Smith081ad4d2017-01-24 19:39:46 +00001021.. option:: -include<file>, --include<file>, --include=<arg>
1022
1023Include file before parsing
1024
Richard Smith081ad4d2017-01-24 19:39:46 +00001025.. option:: -include-pch <file>
1026
1027Include precompiled header file
1028
Richard Smith081ad4d2017-01-24 19:39:46 +00001029.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1030
1031Set the -iwithprefix/-iwithprefixbefore prefix
1032
Richard Smith081ad4d2017-01-24 19:39:46 +00001033.. option:: -iquote<directory>
1034
1035Add directory to QUOTE include search path
1036
Richard Smith081ad4d2017-01-24 19:39:46 +00001037.. option:: -isysroot<dir>
1038
1039Set the system root directory (usually /)
1040
Richard Smith081ad4d2017-01-24 19:39:46 +00001041.. option:: -isystem<directory>
1042
1043Add directory to SYSTEM include search path
1044
Richard Smith081ad4d2017-01-24 19:39:46 +00001045.. option:: -isystem-after<directory>
1046
1047Add directory to end of the SYSTEM include search path
1048
Richard Smith081ad4d2017-01-24 19:39:46 +00001049.. option:: -ivfsoverlay<arg>
1050
1051Overlay the virtual filesystem described by file over the real file system
1052
Richard Smith081ad4d2017-01-24 19:39:46 +00001053.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1054
1055Set directory to SYSTEM include search path with prefix
1056
Richard Smith081ad4d2017-01-24 19:39:46 +00001057.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1058
1059Set directory to include search path with prefix
1060
Richard Smith081ad4d2017-01-24 19:39:46 +00001061.. option:: -iwithsysroot<directory>
1062
1063Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1064
Richard Smith081ad4d2017-01-24 19:39:46 +00001065.. option:: --ptxas-path=<arg>
1066
1067Path to ptxas (used for compiling CUDA code)
1068
Richard Smith081ad4d2017-01-24 19:39:46 +00001069.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1070
1071Treat all #include paths starting with <prefix> as including a system header.
1072
1073Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +00001074--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001075
1076Flags controlling generation of a dependency file for ``make``-like build
1077systems.
1078
Richard Smith081ad4d2017-01-24 19:39:46 +00001079.. option:: -M, --dependencies
1080
1081Like -MD, but also implies -E and writes to stdout by default
1082
Richard Smith081ad4d2017-01-24 19:39:46 +00001083.. option:: -MD, --write-dependencies
1084
1085Write a depfile containing user and system headers
1086
Richard Smith081ad4d2017-01-24 19:39:46 +00001087.. option:: -MF<file>
1088
1089Write depfile output from -MMD, -MD, -MM, or -M to <file>
1090
Richard Smith081ad4d2017-01-24 19:39:46 +00001091.. option:: -MG, --print-missing-file-dependencies
1092
1093Add missing headers to depfile
1094
Richard Smith081ad4d2017-01-24 19:39:46 +00001095.. option:: -MJ<arg>
1096
1097Write a compilation database entry per input
1098
Richard Smith081ad4d2017-01-24 19:39:46 +00001099.. option:: -MM, --user-dependencies
1100
1101Like -MMD, but also implies -E and writes to stdout by default
1102
Richard Smith081ad4d2017-01-24 19:39:46 +00001103.. option:: -MMD, --write-user-dependencies
1104
1105Write a depfile containing user headers
1106
Richard Smith081ad4d2017-01-24 19:39:46 +00001107.. option:: -MP
1108
1109Create phony target for each dependency (other than main file)
1110
Richard Smith081ad4d2017-01-24 19:39:46 +00001111.. option:: -MQ<arg>
1112
1113Specify name of main file output to quote in depfile
1114
Richard Smith081ad4d2017-01-24 19:39:46 +00001115.. option:: -MT<arg>
1116
1117Specify name of main file output in depfile
1118
Richard Smith081ad4d2017-01-24 19:39:46 +00001119.. option:: -MV
1120
1121Use NMake/Jom format for the depfile
1122
1123Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001124--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001125
1126Flags allowing the state of the preprocessor to be dumped in various ways.
1127
Richard Smith081ad4d2017-01-24 19:39:46 +00001128.. option:: -d
1129
Richard Smithb2c82a62017-01-27 01:54:42 +00001130.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001131.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001132.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001133
Richard Smith081ad4d2017-01-24 19:39:46 +00001134.. option:: -dA
1135
Richard Smith081ad4d2017-01-24 19:39:46 +00001136.. option:: -dD
1137
1138Print macro definitions in -E mode in addition to normal output
1139
Richard Smith081ad4d2017-01-24 19:39:46 +00001140.. option:: -dI
1141
1142Print include directives in -E mode in addition to normal output
1143
Richard Smith081ad4d2017-01-24 19:39:46 +00001144.. option:: -dM
1145
1146Print macro definitions in -E mode instead of normal output
1147
1148Diagnostic flags
1149~~~~~~~~~~~~~~~~
1150
1151Flags controlling which warnings, errors, and remarks Clang will generate.
1152See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1153
Richard Smith081ad4d2017-01-24 19:39:46 +00001154.. option:: -R<remark>
1155
1156Enable the specified remark
1157
Richard Smith081ad4d2017-01-24 19:39:46 +00001158.. option:: -Rpass-analysis=<arg>
1159
1160Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1161
Richard Smith081ad4d2017-01-24 19:39:46 +00001162.. option:: -Rpass-missed=<arg>
1163
1164Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1165
Richard Smith081ad4d2017-01-24 19:39:46 +00001166.. option:: -Rpass=<arg>
1167
1168Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1169
Richard Smith081ad4d2017-01-24 19:39:46 +00001170.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1171
1172Enable the specified warning
1173
Richard Smith081ad4d2017-01-24 19:39:46 +00001174.. option:: -Wdeprecated, -Wno-deprecated
1175
Richard Smithc5b2e002017-01-27 02:08:37 +00001176Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001177
Richard Smith081ad4d2017-01-24 19:39:46 +00001178.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1179
Richard Smith081ad4d2017-01-24 19:39:46 +00001180Target-independent compilation options
1181~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001182.. option:: -Wframe-larger-than=<arg>
1183
Richard Smith081ad4d2017-01-24 19:39:46 +00001184.. option:: -fPIC, -fno-PIC
1185
Richard Smith081ad4d2017-01-24 19:39:46 +00001186.. option:: -fPIE, -fno-PIE
1187
Richard Smith081ad4d2017-01-24 19:39:46 +00001188.. option:: -faccess-control, -fno-access-control
1189
Vedant Kumar368540f2018-08-23 17:55:03 +00001190.. option:: -faddrsig, -fno-addrsig
1191
1192Emit an address-significance table
1193
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001194.. option:: -falign-functions, -fno-align-functions
1195
1196.. program:: clang1
1197.. option:: -falign-functions=<arg>
1198.. program:: clang
1199
Richard Smithb2c82a62017-01-27 01:54:42 +00001200.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001201.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001202.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001203
1204Enable C++17 aligned allocation functions
1205
Craig Topperd23254a2017-07-20 17:52:48 +00001206.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1207
1208Treat editor placeholders as valid source code
1209
Richard Smith081ad4d2017-01-24 19:39:46 +00001210.. option:: -fallow-unsupported
1211
Richard Smith78e23fd2017-04-13 22:39:49 +00001212.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001213
Richard Smith081ad4d2017-01-24 19:39:46 +00001214.. option:: -fansi-escape-codes
1215
1216Use ANSI escape codes for diagnostics
1217
Richard Smith081ad4d2017-01-24 19:39:46 +00001218.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1219
1220Use Apple's kernel extensions ABI
1221
Richard Smith081ad4d2017-01-24 19:39:46 +00001222.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1223
1224Enable Apple gcc-compatible #pragma pack handling
1225
Richard Smith081ad4d2017-01-24 19:39:46 +00001226.. option:: -fapplication-extension, -fno-application-extension
1227
1228Restrict code to those available for App Extensions
1229
Richard Smith081ad4d2017-01-24 19:39:46 +00001230.. option:: -fasm, -fno-asm
1231
Richard Smith081ad4d2017-01-24 19:39:46 +00001232.. option:: -fasm-blocks, -fno-asm-blocks
1233
Richard Smith081ad4d2017-01-24 19:39:46 +00001234.. option:: -fassociative-math, -fno-associative-math
1235
Richard Smith081ad4d2017-01-24 19:39:46 +00001236.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1237
Richard Smith081ad4d2017-01-24 19:39:46 +00001238.. option:: -fast
1239
Richard Smith081ad4d2017-01-24 19:39:46 +00001240.. option:: -fastcp
1241
Richard Smith081ad4d2017-01-24 19:39:46 +00001242.. option:: -fastf
1243
Richard Smith081ad4d2017-01-24 19:39:46 +00001244.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1245
Richard Smith081ad4d2017-01-24 19:39:46 +00001246.. option:: -fautolink, -fno-autolink
1247
Richard Smith081ad4d2017-01-24 19:39:46 +00001248.. option:: -fblocks, -fno-blocks
1249
1250Enable the 'blocks' language feature
1251
Richard Smith081ad4d2017-01-24 19:39:46 +00001252.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1253
Richard Smith081ad4d2017-01-24 19:39:46 +00001254.. option:: -fborland-extensions, -fno-borland-extensions
1255
1256Accept non-standard constructs supported by the Borland compiler
1257
Richard Smith081ad4d2017-01-24 19:39:46 +00001258.. option:: -fbracket-depth=<arg>
1259
Richard Smith081ad4d2017-01-24 19:39:46 +00001260.. option:: -fbuiltin, -fno-builtin
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262.. option:: -fbuiltin-module-map
1263
1264Load the clang builtins module map file.
1265
Vedant Kumar368540f2018-08-23 17:55:03 +00001266.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1267
1268Enable C++ static destructor registration (the default)
1269
Richard Smith081ad4d2017-01-24 19:39:46 +00001270.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1271
Craig Topper596527b2018-01-23 18:40:15 +00001272.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1273
1274Instrument control-flow architecture protection. Options: return, branch, full, none.
1275
Vedant Kumar368540f2018-08-23 17:55:03 +00001276.. option:: -fchar8\_t, -fno-char8\_t
1277
1278Enable C++ builtin type char8\_t
1279
Richard Smith081ad4d2017-01-24 19:39:46 +00001280.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1281
Richard Smith081ad4d2017-01-24 19:39:46 +00001282.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1283
1284Use colors in diagnostics
1285
Richard Smith081ad4d2017-01-24 19:39:46 +00001286.. option:: -fcommon, -fno-common
1287
Richard Smith081ad4d2017-01-24 19:39:46 +00001288.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1289
Richard Smith081ad4d2017-01-24 19:39:46 +00001290.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1291
Richard Smith081ad4d2017-01-24 19:39:46 +00001292.. option:: -fconstant-string-class=<arg>
1293
Richard Smith081ad4d2017-01-24 19:39:46 +00001294.. option:: -fconstexpr-backtrace-limit=<arg>
1295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -fconstexpr-depth=<arg>
1297
Richard Smith081ad4d2017-01-24 19:39:46 +00001298.. option:: -fconstexpr-steps=<arg>
1299
Richard Smith081ad4d2017-01-24 19:39:46 +00001300.. option:: -fcoroutines-ts, -fno-coroutines-ts
1301
1302Enable support for the C++ Coroutines TS
1303
Richard Smith081ad4d2017-01-24 19:39:46 +00001304.. option:: -fcoverage-mapping, -fno-coverage-mapping
1305
1306Generate coverage mapping to enable code coverage analysis
1307
Richard Smith081ad4d2017-01-24 19:39:46 +00001308.. option:: -fcreate-profile
1309
Richard Smith081ad4d2017-01-24 19:39:46 +00001310.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1311
1312Enable C++ exceptions
1313
Richard Smith081ad4d2017-01-24 19:39:46 +00001314.. option:: -fcxx-modules, -fno-cxx-modules
1315
Richard Smith081ad4d2017-01-24 19:39:46 +00001316.. option:: -fdata-sections, -fno-data-sections
1317
1318Place each data in its own section (ELF Only)
1319
Richard Smith081ad4d2017-01-24 19:39:46 +00001320.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1321
1322Emit extra debug info to make sample profile more accurate.
1323
Richard Smith78e23fd2017-04-13 22:39:49 +00001324.. option:: -fdebug-macro, -fno-debug-macro
1325
1326Emit macro debug information
1327
Richard Smith081ad4d2017-01-24 19:39:46 +00001328.. option:: -fdebug-pass-arguments
1329
Richard Smith081ad4d2017-01-24 19:39:46 +00001330.. option:: -fdebug-pass-structure
1331
Richard Smith081ad4d2017-01-24 19:39:46 +00001332.. option:: -fdebug-prefix-map=<arg>
1333
1334remap file source paths in debug info
1335
Richard Smith081ad4d2017-01-24 19:39:46 +00001336.. option:: -fdebug-types-section, -fno-debug-types-section
1337
1338Place debug types in their own section (ELF Only)
1339
Richard Smith081ad4d2017-01-24 19:39:46 +00001340.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1341
1342Parse templated function definitions at the end of the translation unit
1343
Vedant Kumar368540f2018-08-23 17:55:03 +00001344.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1345
1346Treat usage of null pointers as undefined behavior.
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fdenormal-fp-math=<arg>
1349
Richard Smith081ad4d2017-01-24 19:39:46 +00001350.. option:: -fdiagnostics-absolute-paths
1351
1352Print absolute paths in diagnostics
1353
Richard Smith081ad4d2017-01-24 19:39:46 +00001354.. option:: -fdiagnostics-color, -fno-diagnostics-color
1355
Richard Smithb2c82a62017-01-27 01:54:42 +00001356.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001357.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001358.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001359
Craig Topperd23254a2017-07-20 17:52:48 +00001360.. option:: -fdiagnostics-hotness-threshold=<number>
1361
1362Prevent optimization remarks from being output if they do not have at least this profile count
1363
Richard Smith081ad4d2017-01-24 19:39:46 +00001364.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1365
1366Enable profile hotness information in diagnostic line
1367
Richard Smith081ad4d2017-01-24 19:39:46 +00001368.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1369
1370Display include stacks for diagnostic notes
1371
Richard Smith081ad4d2017-01-24 19:39:46 +00001372.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1373
1374Print option name with mappable diagnostics
1375
Richard Smith081ad4d2017-01-24 19:39:46 +00001376.. option:: -fdiagnostics-show-template-tree
1377
1378Print a template comparison tree for differing templates
1379
Vedant Kumar368540f2018-08-23 17:55:03 +00001380.. option:: -fdigraphs, -fno-digraphs
1381
1382Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1383
Richard Smith081ad4d2017-01-24 19:39:46 +00001384.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1385
1386Allow '$' in identifiers
1387
Craig Topper16418662017-11-20 18:07:43 +00001388.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1389
1390Enable '\[\[\]\]' attributes in all C and C++ language modes
1391
Richard Smith081ad4d2017-01-24 19:39:46 +00001392.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1393
Craig Topper188252d2017-12-11 21:09:16 +00001394.. option:: -fdwarf-exceptions
1395
1396Use DWARF style exceptions
1397
Richard Smith081ad4d2017-01-24 19:39:46 +00001398.. option:: -felide-constructors, -fno-elide-constructors
1399
Richard Smith081ad4d2017-01-24 19:39:46 +00001400.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1401
Richard Smith081ad4d2017-01-24 19:39:46 +00001402.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1403
1404Embed LLVM bitcode (option: off, all, bitcode, marker)
1405
Richard Smith081ad4d2017-01-24 19:39:46 +00001406.. option:: -femit-all-decls
1407
1408Emit all declarations, even if unused
1409
Richard Smith081ad4d2017-01-24 19:39:46 +00001410.. option:: -femulated-tls, -fno-emulated-tls
1411
1412Use emutls functions to access thread\_local variables
1413
Richard Smith081ad4d2017-01-24 19:39:46 +00001414.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1415
Richard Smith081ad4d2017-01-24 19:39:46 +00001416.. option:: -ferror-limit=<arg>
1417
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001418.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1419
Richard Smith081ad4d2017-01-24 19:39:46 +00001420.. option:: -fexceptions, -fno-exceptions
1421
1422Enable support for exception handling
1423
Richard Smith081ad4d2017-01-24 19:39:46 +00001424.. option:: -fexec-charset=<arg>
1425
Richard Smith081ad4d2017-01-24 19:39:46 +00001426.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1427
Richard Smith081ad4d2017-01-24 19:39:46 +00001428.. option:: -ffast-math, -fno-fast-math
1429
1430Allow aggressive, lossy floating-point optimizations
1431
Richard Smith081ad4d2017-01-24 19:39:46 +00001432.. option:: -ffinite-math-only, -fno-finite-math-only
1433
Vedant Kumar368540f2018-08-23 17:55:03 +00001434.. option:: -ffixed-point, -fno-fixed-point
1435
1436Enable fixed point types
1437
Richard Smith081ad4d2017-01-24 19:39:46 +00001438.. option:: -ffor-scope, -fno-for-scope
1439
Vedant Kumar368540f2018-08-23 17:55:03 +00001440.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1441
1442Emits more virtual tables to improve devirtualization
1443
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001444.. option:: -fforce-enable-int128, -fno-force-enable-int128
1445
1446Enable support for int128\_t type
1447
Richard Smith081ad4d2017-01-24 19:39:46 +00001448.. option:: -ffp-contract=<arg>
1449
1450Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1451
Richard Smith081ad4d2017-01-24 19:39:46 +00001452.. option:: -ffreestanding
1453
1454Assert that the compilation takes place in a freestanding environment
1455
Richard Smith081ad4d2017-01-24 19:39:46 +00001456.. option:: -ffunction-sections, -fno-function-sections
1457
1458Place each function in its own section (ELF Only)
1459
Richard Smith081ad4d2017-01-24 19:39:46 +00001460.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1461
Richard Smith081ad4d2017-01-24 19:39:46 +00001462.. option:: -fgnu-keywords, -fno-gnu-keywords
1463
1464Allow GNU-extension keywords regardless of language standard
1465
Richard Smith081ad4d2017-01-24 19:39:46 +00001466.. option:: -fgnu-runtime
1467
1468Generate output compatible with the standard GNU Objective-C runtime
1469
Richard Smith081ad4d2017-01-24 19:39:46 +00001470.. option:: -fgnu89-inline, -fno-gnu89-inline
1471
1472Use the gnu89 inline semantics
1473
Richard Smith081ad4d2017-01-24 19:39:46 +00001474.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1475
Richard Smith081ad4d2017-01-24 19:39:46 +00001476.. option:: -fhonor-nans, -fno-honor-nans
1477
Richard Smith081ad4d2017-01-24 19:39:46 +00001478.. option:: -fhosted
1479
Richard Smith081ad4d2017-01-24 19:39:46 +00001480.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1481
1482Implicitly search the file system for module map files.
1483
Richard Smith081ad4d2017-01-24 19:39:46 +00001484.. option:: -fimplicit-modules, -fno-implicit-modules
1485
Richard Smith081ad4d2017-01-24 19:39:46 +00001486.. option:: -finput-charset=<arg>
1487
Craig Topper188252d2017-12-11 21:09:16 +00001488.. option:: -finstrument-function-entry-bare
1489
1490Instrument function entry only, after inlining, without arguments to the instrumentation call
1491
Richard Smith081ad4d2017-01-24 19:39:46 +00001492.. option:: -finstrument-functions
1493
1494Generate calls to instrument function entry and exit
1495
Craig Topper16418662017-11-20 18:07:43 +00001496.. option:: -finstrument-functions-after-inlining
1497
1498Like -finstrument-functions, but insert the calls after inlining
1499
Richard Smith081ad4d2017-01-24 19:39:46 +00001500.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1501
1502Enable the integrated assembler
1503
Richard Smith081ad4d2017-01-24 19:39:46 +00001504.. option:: -fjump-tables, -fno-jump-tables
1505
Vedant Kumar368540f2018-08-23 17:55:03 +00001506.. option:: -fkeep-static-consts
1507
1508Keep static const variables even if unused
1509
Richard Smith081ad4d2017-01-24 19:39:46 +00001510.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1511
Richard Smith081ad4d2017-01-24 19:39:46 +00001512.. option:: -flimited-precision=<arg>
1513
Richard Smith081ad4d2017-01-24 19:39:46 +00001514.. option:: -flto, -fno-lto
1515
1516Enable LTO in 'full' mode
1517
Richard Smith081ad4d2017-01-24 19:39:46 +00001518.. option:: -flto-jobs=<arg>
1519
1520Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1521
Richard Smithb2c82a62017-01-27 01:54:42 +00001522.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001523.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001524.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001525
1526Set LTO mode to either 'full' or 'thin'
1527
Richard Smith081ad4d2017-01-24 19:39:46 +00001528.. option:: -fmacro-backtrace-limit=<arg>
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -fmath-errno, -fno-math-errno
1531
1532Require math functions to indicate errors by setting errno
1533
Richard Smith081ad4d2017-01-24 19:39:46 +00001534.. option:: -fmax-type-align=<arg>
1535
1536Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1537
Richard Smith081ad4d2017-01-24 19:39:46 +00001538.. option:: -fmerge-all-constants, -fno-merge-all-constants
1539
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001540Allow merging of constants
1541
Richard Smith081ad4d2017-01-24 19:39:46 +00001542.. option:: -fmessage-length=<arg>
1543
Richard Smith081ad4d2017-01-24 19:39:46 +00001544.. option:: -fmodule-file-deps, -fno-module-file-deps
1545
Richard Smith081ad4d2017-01-24 19:39:46 +00001546.. option:: -fmodule-map-file=<file>
1547
1548Load this module map file
1549
Richard Smith081ad4d2017-01-24 19:39:46 +00001550.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1551
1552Specify the name of the module to build
1553
Richard Smith081ad4d2017-01-24 19:39:46 +00001554.. option:: -fmodules, -fno-modules
1555
1556Enable the 'modules' language feature
1557
Richard Smith081ad4d2017-01-24 19:39:46 +00001558.. option:: -fmodules-decluse, -fno-modules-decluse
1559
1560Require declaration of modules used within a module
1561
Richard Smith081ad4d2017-01-24 19:39:46 +00001562.. option:: -fmodules-ignore-macro=<arg>
1563
1564Ignore the definition of the given macro when building and loading modules
1565
Richard Smith081ad4d2017-01-24 19:39:46 +00001566.. option:: -fmodules-search-all, -fno-modules-search-all
1567
1568Search even non-imported modules to resolve references
1569
Richard Smith081ad4d2017-01-24 19:39:46 +00001570.. option:: -fmodules-strict-decluse
1571
1572Like -fmodules-decluse but requires all headers to be in modules
1573
Richard Smith081ad4d2017-01-24 19:39:46 +00001574.. option:: -fmodules-ts
1575
1576Enable support for the C++ Modules TS
1577
Richard Smith081ad4d2017-01-24 19:39:46 +00001578.. option:: -fms-compatibility, -fno-ms-compatibility
1579
1580Enable full Microsoft Visual C++ compatibility
1581
Richard Smith081ad4d2017-01-24 19:39:46 +00001582.. option:: -fms-compatibility-version=<arg>
1583
1584Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1585
Richard Smith081ad4d2017-01-24 19:39:46 +00001586.. option:: -fms-extensions, -fno-ms-extensions
1587
1588Accept some non-standard constructs supported by the Microsoft compiler
1589
Richard Smith081ad4d2017-01-24 19:39:46 +00001590.. option:: -fms-memptr-rep=<arg>
1591
Richard Smith081ad4d2017-01-24 19:39:46 +00001592.. option:: -fms-volatile<arg>
1593
Richard Smith081ad4d2017-01-24 19:39:46 +00001594.. option:: -fmsc-version=<arg>
1595
1596Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1597
Richard Smith081ad4d2017-01-24 19:39:46 +00001598.. option:: -fmudflap
1599
Richard Smith081ad4d2017-01-24 19:39:46 +00001600.. option:: -fmudflapth
1601
Richard Smith081ad4d2017-01-24 19:39:46 +00001602.. option:: -fnested-functions
1603
Richard Smith081ad4d2017-01-24 19:39:46 +00001604.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1605
1606Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1607
Richard Smith081ad4d2017-01-24 19:39:46 +00001608.. option:: -fnext-runtime
1609
Richard Smith081ad4d2017-01-24 19:39:46 +00001610.. option:: -fno-builtin-<arg>
1611
1612Disable implicit builtin knowledge of a specific function
1613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -fno-elide-type
1615
1616Do not elide types when printing diagnostics
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -fno-max-type-align
1619
Richard Smith081ad4d2017-01-24 19:39:46 +00001620.. option:: -fno-operator-names
1621
1622Do not treat C++ operator name keywords as synonyms for operators
1623
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001624.. option:: -fno-rtti-data
1625
1626Control emission of RTTI data
1627
Richard Smith081ad4d2017-01-24 19:39:46 +00001628.. option:: -fno-strict-modules-decluse
1629
Richard Smith081ad4d2017-01-24 19:39:46 +00001630.. option:: -fno-working-directory
1631
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001632.. option:: -fnoxray-link-deps
1633
Richard Smith081ad4d2017-01-24 19:39:46 +00001634.. option:: -fobjc-abi-version=<arg>
1635
Richard Smith081ad4d2017-01-24 19:39:46 +00001636.. option:: -fobjc-arc, -fno-objc-arc
1637
1638Synthesize retain and release calls for Objective-C pointers
1639
Richard Smith081ad4d2017-01-24 19:39:46 +00001640.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1641
1642Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1643
Richard Smith081ad4d2017-01-24 19:39:46 +00001644.. option:: -fobjc-exceptions, -fno-objc-exceptions
1645
1646Enable Objective-C exceptions
1647
Richard Smith081ad4d2017-01-24 19:39:46 +00001648.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1649
Richard Smith081ad4d2017-01-24 19:39:46 +00001650.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1651
Richard Smith081ad4d2017-01-24 19:39:46 +00001652.. option:: -fobjc-link-runtime
1653
Richard Smith081ad4d2017-01-24 19:39:46 +00001654.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1655
Richard Smith081ad4d2017-01-24 19:39:46 +00001656.. option:: -fobjc-nonfragile-abi-version=<arg>
1657
Richard Smith081ad4d2017-01-24 19:39:46 +00001658.. option:: -fobjc-runtime=<arg>
1659
1660Specify the target Objective-C runtime kind and version
1661
Richard Smith081ad4d2017-01-24 19:39:46 +00001662.. option:: -fobjc-sender-dependent-dispatch
1663
Richard Smith081ad4d2017-01-24 19:39:46 +00001664.. option:: -fobjc-weak, -fno-objc-weak
1665
1666Enable ARC-style weak references in Objective-C
1667
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1669
Richard Smith081ad4d2017-01-24 19:39:46 +00001670.. option:: -fopenmp, -fno-openmp
1671
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001672Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001673
Craig Topper287c8012018-01-03 18:29:12 +00001674.. option:: -fopenmp-simd, -fno-openmp-simd
1675
1676Emit OpenMP code only for SIMD-based constructs.
1677
Richard Smith081ad4d2017-01-24 19:39:46 +00001678.. option:: -fopenmp-version=<arg>
1679
Richard Smithb2c82a62017-01-27 01:54:42 +00001680.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001681.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001682.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001683
Richard Smith081ad4d2017-01-24 19:39:46 +00001684.. option:: -foperator-arrow-depth=<arg>
1685
Richard Smith081ad4d2017-01-24 19:39:46 +00001686.. option:: -foptimization-record-file=<arg>
1687
1688Specify the file name of any generated YAML optimization record
1689
Richard Smith081ad4d2017-01-24 19:39:46 +00001690.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1691
Richard Smith081ad4d2017-01-24 19:39:46 +00001692.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1693
Richard Smith081ad4d2017-01-24 19:39:46 +00001694.. option:: -fpack-struct, -fno-pack-struct
1695
Richard Smithb2c82a62017-01-27 01:54:42 +00001696.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001697.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001698.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001699
1700Specify the default maximum struct packing alignment
1701
Richard Smith081ad4d2017-01-24 19:39:46 +00001702.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1703
1704Recognize and construct Pascal-style string literals
1705
Richard Smith081ad4d2017-01-24 19:39:46 +00001706.. option:: -fpcc-struct-return
1707
1708Override the default ABI to return all structs on the stack
1709
Richard Smith081ad4d2017-01-24 19:39:46 +00001710.. option:: -fpch-preprocess
1711
Richard Smith081ad4d2017-01-24 19:39:46 +00001712.. option:: -fpic, -fno-pic
1713
Richard Smith081ad4d2017-01-24 19:39:46 +00001714.. option:: -fpie, -fno-pie
1715
Craig Topper16418662017-11-20 18:07:43 +00001716.. option:: -fplt, -fno-plt
1717
1718Use the PLT to make function calls
1719
Richard Smith081ad4d2017-01-24 19:39:46 +00001720.. option:: -fplugin=<dsopath>
1721
1722Load the named plugin (dynamic shared object)
1723
Richard Smith081ad4d2017-01-24 19:39:46 +00001724.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1725
Richard Smith081ad4d2017-01-24 19:39:46 +00001726.. option:: -fprofile-arcs, -fno-profile-arcs
1727
Richard Smith081ad4d2017-01-24 19:39:46 +00001728.. option:: -fprofile-dir=<arg>
1729
Richard Smith081ad4d2017-01-24 19:39:46 +00001730.. option:: -fprofile-generate, -fno-profile-generate
1731
1732Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1733
Richard Smithb2c82a62017-01-27 01:54:42 +00001734.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001735.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001736.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001737
1738Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1739
Richard Smith081ad4d2017-01-24 19:39:46 +00001740.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1741
1742Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1743
Richard Smithb2c82a62017-01-27 01:54:42 +00001744.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001745.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001746.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001747
1748Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1749
Richard Smith081ad4d2017-01-24 19:39:46 +00001750.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1751
Richard Smithb2c82a62017-01-27 01:54:42 +00001752.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001753.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001754.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001755
1756Use instrumentation data for profile-guided optimization
1757
Boris Kolpackovb150d242017-08-30 09:15:53 +00001758.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1759
1760Specifies that the sample profile is accurate. If the sample
1761 profile is accurate, callsites without profile samples are marked
1762 as cold. Otherwise, treat callsites without profile samples as if
1763 we have no profile
1764
Richard Smith78e23fd2017-04-13 22:39:49 +00001765.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1766
1767.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001768.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001769.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001770
1771Enable sample-based profile guided optimizations
1772
Richard Smithb2c82a62017-01-27 01:54:42 +00001773.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001774.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001775.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001776
1777Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1778
Richard Smith081ad4d2017-01-24 19:39:46 +00001779.. option:: -freciprocal-math, -fno-reciprocal-math
1780
1781Allow division operations to be reassociated
1782
Richard Smith081ad4d2017-01-24 19:39:46 +00001783.. option:: -freg-struct-return
1784
1785Override the default ABI to return small structs in registers
1786
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001787.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1788
1789Use atexit or \_\_cxa\_atexit to register global destructors
1790
Richard Smith081ad4d2017-01-24 19:39:46 +00001791.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1792
1793Enable C++17 relaxed template template argument matching
1794
Richard Smith081ad4d2017-01-24 19:39:46 +00001795.. option:: -freroll-loops, -fno-reroll-loops
1796
1797Turn on loop reroller
1798
Richard Smith081ad4d2017-01-24 19:39:46 +00001799.. option:: -fretain-comments-from-system-headers
1800
Craig Topperd23254a2017-07-20 17:52:48 +00001801.. option:: -frewrite-imports, -fno-rewrite-imports
1802
Richard Smith081ad4d2017-01-24 19:39:46 +00001803.. option:: -frewrite-includes, -fno-rewrite-includes
1804
Richard Smith081ad4d2017-01-24 19:39:46 +00001805.. option:: -frewrite-map-file <arg>
1806
Richard Smithb2c82a62017-01-27 01:54:42 +00001807.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001808.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001809.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001810
Richard Smith081ad4d2017-01-24 19:39:46 +00001811.. option:: -fropi, -fno-ropi
1812
Richard Smith081ad4d2017-01-24 19:39:46 +00001813.. option:: -frtti, -fno-rtti
1814
Richard Smith081ad4d2017-01-24 19:39:46 +00001815.. option:: -frwpi, -fno-rwpi
1816
Richard Smith081ad4d2017-01-24 19:39:46 +00001817.. option:: -fsave-optimization-record, -fno-save-optimization-record
1818
1819Generate a YAML optimization record file
1820
Craig Topper188252d2017-12-11 21:09:16 +00001821.. option:: -fseh-exceptions
1822
1823Use SEH style exceptions
1824
Richard Smith081ad4d2017-01-24 19:39:46 +00001825.. option:: -fshort-enums, -fno-short-enums
1826
1827Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1828
Richard Smith081ad4d2017-01-24 19:39:46 +00001829.. option:: -fshort-wchar, -fno-short-wchar
1830
1831Force wchar\_t to be a short unsigned int
1832
Richard Smith081ad4d2017-01-24 19:39:46 +00001833.. option:: -fshow-column, -fno-show-column
1834
Richard Smith081ad4d2017-01-24 19:39:46 +00001835.. option:: -fshow-overloads=<arg>
1836
1837Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1838
Richard Smith081ad4d2017-01-24 19:39:46 +00001839.. option:: -fshow-source-location, -fno-show-source-location
1840
Richard Smith081ad4d2017-01-24 19:39:46 +00001841.. option:: -fsignaling-math, -fno-signaling-math
1842
Richard Smith081ad4d2017-01-24 19:39:46 +00001843.. option:: -fsigned-bitfields
1844
Richard Smith081ad4d2017-01-24 19:39:46 +00001845.. option:: -fsigned-char, -fno-signed-char, --signed-char
1846
Richard Smith081ad4d2017-01-24 19:39:46 +00001847.. option:: -fsigned-zeros, -fno-signed-zeros
1848
Richard Smith081ad4d2017-01-24 19:39:46 +00001849.. option:: -fsized-deallocation, -fno-sized-deallocation
1850
1851Enable C++14 sized global deallocation functions
1852
Richard Smith081ad4d2017-01-24 19:39:46 +00001853.. option:: -fsjlj-exceptions
1854
1855Use SjLj style exceptions
1856
Richard Smith081ad4d2017-01-24 19:39:46 +00001857.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1858
1859Enable the superword-level parallelism vectorization passes
1860
Richard Smith081ad4d2017-01-24 19:39:46 +00001861.. option:: -fspell-checking, -fno-spell-checking
1862
Richard Smith081ad4d2017-01-24 19:39:46 +00001863.. option:: -fspell-checking-limit=<arg>
1864
Richard Smith081ad4d2017-01-24 19:39:46 +00001865.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1866
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001867Provide 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 +00001868
Richard Smith081ad4d2017-01-24 19:39:46 +00001869.. option:: -fsplit-stack
1870
Richard Smith081ad4d2017-01-24 19:39:46 +00001871.. option:: -fstack-protector, -fno-stack-protector
1872
1873Enable stack protectors for functions potentially vulnerable to stack smashing
1874
Richard Smith081ad4d2017-01-24 19:39:46 +00001875.. option:: -fstack-protector-all
1876
1877Force the usage of stack protectors for all functions
1878
Richard Smith081ad4d2017-01-24 19:39:46 +00001879.. option:: -fstack-protector-strong
1880
1881Use a strong heuristic to apply stack protectors to functions
1882
Craig Topper596527b2018-01-23 18:40:15 +00001883.. option:: -fstack-size-section, -fno-stack-size-section
1884
1885Emit section containing metadata on function stack sizes
1886
Richard Smith081ad4d2017-01-24 19:39:46 +00001887.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1888
1889Emit full debug info for all types used by the program
1890
Richard Smith081ad4d2017-01-24 19:39:46 +00001891.. option:: -fstrict-aliasing, -fno-strict-aliasing
1892
Richard Smith081ad4d2017-01-24 19:39:46 +00001893.. option:: -fstrict-enums, -fno-strict-enums
1894
1895Enable optimizations based on the strict definition of an enum's value range
1896
Vedant Kumar368540f2018-08-23 17:55:03 +00001897.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
1898
1899Assume that overflowing float-to-int casts are undefined (default)
1900
Richard Smith081ad4d2017-01-24 19:39:46 +00001901.. option:: -fstrict-overflow, -fno-strict-overflow
1902
Richard Smith081ad4d2017-01-24 19:39:46 +00001903.. option:: -fstrict-return, -fno-strict-return
1904
Richard Smith78e23fd2017-04-13 22:39:49 +00001905Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00001906
Richard Smith081ad4d2017-01-24 19:39:46 +00001907.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1908
1909Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1910
Richard Smith081ad4d2017-01-24 19:39:46 +00001911.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1912
Richard Smith081ad4d2017-01-24 19:39:46 +00001913.. option:: -ftabstop=<arg>
1914
Richard Smith081ad4d2017-01-24 19:39:46 +00001915.. option:: -ftemplate-backtrace-limit=<arg>
1916
Richard Smith081ad4d2017-01-24 19:39:46 +00001917.. option:: -ftemplate-depth-<arg>
1918
Richard Smith081ad4d2017-01-24 19:39:46 +00001919.. option:: -ftemplate-depth=<arg>
1920
Richard Smith081ad4d2017-01-24 19:39:46 +00001921.. option:: -ftest-coverage
1922
Richard Smith081ad4d2017-01-24 19:39:46 +00001923.. option:: -fthinlto-index=<arg>
1924
1925Perform ThinLTO importing using provided function summary index
1926
Richard Smith081ad4d2017-01-24 19:39:46 +00001927.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1928
Richard Smith081ad4d2017-01-24 19:39:46 +00001929.. option:: -ftime-report
1930
Richard Smith081ad4d2017-01-24 19:39:46 +00001931.. option:: -ftls-model=<arg>
1932
Richard Smith081ad4d2017-01-24 19:39:46 +00001933.. option:: -ftrap-function=<arg>
1934
1935Issue call to specified function rather than a trap instruction
1936
Richard Smith081ad4d2017-01-24 19:39:46 +00001937.. option:: -ftrapping-math, -fno-trapping-math
1938
Richard Smith081ad4d2017-01-24 19:39:46 +00001939.. option:: -ftrapv
1940
1941Trap on integer overflow
1942
Richard Smith081ad4d2017-01-24 19:39:46 +00001943.. option:: -ftrapv-handler <arg>
1944
Richard Smithb2c82a62017-01-27 01:54:42 +00001945.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001946.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00001947.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001948
1949Specify the function to be called on overflow
1950
Richard Smith081ad4d2017-01-24 19:39:46 +00001951.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1952
1953Process trigraph sequences
1954
Richard Smith081ad4d2017-01-24 19:39:46 +00001955.. option:: -funique-section-names, -fno-unique-section-names
1956
1957Use unique names for text and data sections (ELF Only)
1958
Richard Smith081ad4d2017-01-24 19:39:46 +00001959.. option:: -funit-at-a-time, -fno-unit-at-a-time
1960
Richard Smith081ad4d2017-01-24 19:39:46 +00001961.. option:: -funroll-loops, -fno-unroll-loops
1962
1963Turn on loop unroller
1964
Richard Smith081ad4d2017-01-24 19:39:46 +00001965.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
1966
Richard Smith081ad4d2017-01-24 19:39:46 +00001967.. option:: -funsigned-bitfields
1968
Richard Smith081ad4d2017-01-24 19:39:46 +00001969.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
1970
Richard Smith081ad4d2017-01-24 19:39:46 +00001971.. option:: -funwind-tables, -fno-unwind-tables
1972
Richard Smith081ad4d2017-01-24 19:39:46 +00001973.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
1974
Richard Smith081ad4d2017-01-24 19:39:46 +00001975.. option:: -fuse-init-array, -fno-use-init-array
1976
1977Use .init\_array instead of .ctors
1978
Richard Smith081ad4d2017-01-24 19:39:46 +00001979.. option:: -fuse-ld=<arg>
1980
Richard Smith081ad4d2017-01-24 19:39:46 +00001981.. option:: -fuse-line-directives, -fno-use-line-directives
1982
Richard Smith081ad4d2017-01-24 19:39:46 +00001983.. option:: -fveclib=<arg>
1984
1985Use the given vector functions library
1986
Richard Smith081ad4d2017-01-24 19:39:46 +00001987.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
1988
1989Enable the loop vectorization passes
1990
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -fverbose-asm, -fno-verbose-asm
1992
Richard Smith081ad4d2017-01-24 19:39:46 +00001993.. option:: -fvisibility-inlines-hidden
1994
Fangrui Songdf81b972018-07-19 22:45:41 +00001995Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00001996
Richard Smith081ad4d2017-01-24 19:39:46 +00001997.. option:: -fvisibility-ms-compat
1998
1999Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2000
Richard Smith081ad4d2017-01-24 19:39:46 +00002001.. option:: -fvisibility=<arg>
2002
2003Set the default symbol visibility for all global declarations
2004
Richard Smith081ad4d2017-01-24 19:39:46 +00002005.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2006
2007Enables whole-program vtable optimization. Requires -flto
2008
Richard Smith081ad4d2017-01-24 19:39:46 +00002009.. option:: -fwrapv, -fno-wrapv
2010
2011Treat signed integer overflow as two's complement
2012
Richard Smith081ad4d2017-01-24 19:39:46 +00002013.. option:: -fwritable-strings
2014
2015Store string literals as writable data
2016
Craig Topper188252d2017-12-11 21:09:16 +00002017.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2018
2019Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2020
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002021.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2022
2023Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2024
Richard Smith78e23fd2017-04-13 22:39:49 +00002025.. option:: -fxray-always-instrument=<arg>
2026
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002027DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2028
2029.. option:: -fxray-attr-list=<arg>
2030
2031Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002032
Richard Smith081ad4d2017-01-24 19:39:46 +00002033.. option:: -fxray-instruction-threshold<arg>
2034
Richard Smithb2c82a62017-01-27 01:54:42 +00002035.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002036.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002037.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002038
2039Sets the minimum function size to instrument with XRay
2040
Richard Smith081ad4d2017-01-24 19:39:46 +00002041.. option:: -fxray-instrument, -fno-xray-instrument
2042
2043Generate XRay instrumentation sleds on function entry and exit
2044
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002045.. option:: -fxray-instrumentation-bundle=<arg>
2046
2047Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'.
2048
2049.. option:: -fxray-link-deps
2050
2051Tells clang to add the link dependencies for XRay.
2052
2053.. option:: -fxray-modes=<arg>
2054
2055List of modes to link in by default into XRay instrumented binaries.
2056
Richard Smith78e23fd2017-04-13 22:39:49 +00002057.. option:: -fxray-never-instrument=<arg>
2058
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002059DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002060
Richard Smith081ad4d2017-01-24 19:39:46 +00002061.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2062
Richard Smith081ad4d2017-01-24 19:39:46 +00002063.. option:: -fzvector, -fno-zvector, -mzvector
2064
2065Enable System z vector language extension
2066
Richard Smith081ad4d2017-01-24 19:39:46 +00002067.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2068
Richard Smith081ad4d2017-01-24 19:39:46 +00002069.. option:: -pedantic-errors, --pedantic-errors
2070
2071OpenCL flags
2072------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002073.. option:: -cl-denorms-are-zero
2074
2075OpenCL only. Allow denormals to be flushed to zero.
2076
Richard Smith081ad4d2017-01-24 19:39:46 +00002077.. option:: -cl-fast-relaxed-math
2078
2079OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2080
Richard Smith081ad4d2017-01-24 19:39:46 +00002081.. option:: -cl-finite-math-only
2082
2083OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2084
Richard Smith081ad4d2017-01-24 19:39:46 +00002085.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2086
2087OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2088
Richard Smith081ad4d2017-01-24 19:39:46 +00002089.. option:: -cl-kernel-arg-info
2090
2091OpenCL only. Generate kernel argument metadata.
2092
Richard Smith081ad4d2017-01-24 19:39:46 +00002093.. option:: -cl-mad-enable
2094
2095OpenCL only. Allow use of less precise MAD computations in the generated binary.
2096
Richard Smith081ad4d2017-01-24 19:39:46 +00002097.. option:: -cl-no-signed-zeros
2098
2099OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2100
Richard Smith081ad4d2017-01-24 19:39:46 +00002101.. option:: -cl-opt-disable
2102
2103OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2104
Richard Smith081ad4d2017-01-24 19:39:46 +00002105.. option:: -cl-single-precision-constant
2106
2107OpenCL only. Treat double precision floating-point constant as single precision constant.
2108
Richard Smith081ad4d2017-01-24 19:39:46 +00002109.. option:: -cl-std=<arg>
2110
2111OpenCL language standard to compile for.
2112
Richard Smith081ad4d2017-01-24 19:39:46 +00002113.. option:: -cl-strict-aliasing
2114
2115OpenCL only. This option is added for compatibility with OpenCL 1.0.
2116
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002117.. option:: -cl-uniform-work-group-size
2118
2119OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2120
Richard Smith081ad4d2017-01-24 19:39:46 +00002121.. option:: -cl-unsafe-math-optimizations
2122
2123OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2124
2125Target-dependent compilation options
2126~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00002127.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2128
2129Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2130
Richard Smith081ad4d2017-01-24 19:39:46 +00002131.. option:: -m16
2132
Richard Smith081ad4d2017-01-24 19:39:46 +00002133.. option:: -m32
2134
Richard Smith081ad4d2017-01-24 19:39:46 +00002135.. option:: -m64
2136
Richard Smith081ad4d2017-01-24 19:39:46 +00002137.. option:: -mabi=<arg>
2138
Richard Smith081ad4d2017-01-24 19:39:46 +00002139.. option:: -malign-double
2140
2141Align doubles to two words in structs (x86 only)
2142
Richard Smith081ad4d2017-01-24 19:39:46 +00002143.. option:: -march=<arg>
2144
Richard Smith081ad4d2017-01-24 19:39:46 +00002145.. option:: -masm=<arg>
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -mbackchain, -mno-backchain
2148
2149Link stack frames through backchain on System Z
2150
Richard Smith081ad4d2017-01-24 19:39:46 +00002151.. option:: -mcmodel=<arg>
2152
Richard Smith081ad4d2017-01-24 19:39:46 +00002153.. option:: -mconsole<arg>
2154
Krzysztof Parzyszek57e67062018-10-19 15:36:45 +00002155.. 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 +00002156
Vedant Kumar368540f2018-08-23 17:55:03 +00002157.. option:: -mcrc, -mno-crc
2158
2159Allow use of CRC instructions (ARM/Mips only)
2160
Craig Topperd23254a2017-07-20 17:52:48 +00002161.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2162
Richard Smith081ad4d2017-01-24 19:39:46 +00002163.. option:: -mdll<arg>
2164
Richard Smith081ad4d2017-01-24 19:39:46 +00002165.. option:: -mdynamic-no-pic<arg>
2166
Richard Smith081ad4d2017-01-24 19:39:46 +00002167.. option:: -meabi <arg>
2168
2169Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2170
Richard Smith78e23fd2017-04-13 22:39:49 +00002171.. option:: -mfentry
2172
2173Insert calls to fentry at function entry (x86 only)
2174
Richard Smith081ad4d2017-01-24 19:39:46 +00002175.. option:: -mfloat-abi=<arg>
2176
Richard Smith081ad4d2017-01-24 19:39:46 +00002177.. option:: -mfpmath=<arg>
2178
Richard Smith081ad4d2017-01-24 19:39:46 +00002179.. option:: -mfpu=<arg>
2180
Richard Smith081ad4d2017-01-24 19:39:46 +00002181.. option:: -mglobal-merge, -mno-global-merge
2182
2183Enable merging of globals
2184
Richard Smith081ad4d2017-01-24 19:39:46 +00002185.. option:: -mhard-float
2186
Richard Smith081ad4d2017-01-24 19:39:46 +00002187.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2188
Richard Smith081ad4d2017-01-24 19:39:46 +00002189.. option:: -miamcu, -mno-iamcu
2190
2191Use Intel MCU ABI
2192
Richard Smith081ad4d2017-01-24 19:39:46 +00002193.. option:: -mimplicit-float, -mno-implicit-float
2194
Richard Smith081ad4d2017-01-24 19:39:46 +00002195.. option:: -mimplicit-it=<arg>
2196
Richard Smith081ad4d2017-01-24 19:39:46 +00002197.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2198
2199(integrated-as) Emit an object file which can be used with an incremental linker
2200
Richard Smith78e23fd2017-04-13 22:39:49 +00002201.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002202
Richard Smith081ad4d2017-01-24 19:39:46 +00002203.. option:: -mkernel
2204
Richard Smith081ad4d2017-01-24 19:39:46 +00002205.. option:: -mlong-calls, -mno-long-calls
2206
2207Generate branches with extended addressability, usually via indirect jumps.
2208
Craig Topperd23254a2017-07-20 17:52:48 +00002209.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002210
2211Set Mac OS X deployment target
2212
Craig Topperd23254a2017-07-20 17:52:48 +00002213.. option:: -mmcu=<arg>
2214
Richard Smith081ad4d2017-01-24 19:39:46 +00002215.. option:: -mms-bitfields, -mno-ms-bitfields
2216
2217Set the default structure layout to be compatible with the Microsoft compiler standard
2218
Richard Smith081ad4d2017-01-24 19:39:46 +00002219.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2220
2221Omit frame pointer setup for leaf functions
2222
Richard Smith081ad4d2017-01-24 19:39:46 +00002223.. option:: -moslib=<arg>
2224
Richard Smith081ad4d2017-01-24 19:39:46 +00002225.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2226
2227Use copy relocations support for PIE builds
2228
Craig Topper9a724aa2017-12-11 21:09:19 +00002229.. option:: -mprefer-vector-width=<arg>
2230
2231Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2232
Richard Smith081ad4d2017-01-24 19:39:46 +00002233.. option:: -mqdsp6-compat
2234
2235Enable hexagon-qdsp6 backward compatibility
2236
Richard Smith081ad4d2017-01-24 19:39:46 +00002237.. option:: -mrecip
2238
Richard Smithb2c82a62017-01-27 01:54:42 +00002239.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002240.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002241.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002242
Richard Smith081ad4d2017-01-24 19:39:46 +00002243.. option:: -mred-zone, -mno-red-zone
2244
Richard Smith081ad4d2017-01-24 19:39:46 +00002245.. option:: -mregparm=<arg>
2246
Richard Smith081ad4d2017-01-24 19:39:46 +00002247.. option:: -mrelax-all, -mno-relax-all
2248
2249(integrated-as) Relax all machine instructions
2250
Vedant Kumar368540f2018-08-23 17:55:03 +00002251.. option:: -mretpoline, -mno-retpoline
2252
Richard Smith081ad4d2017-01-24 19:39:46 +00002253.. option:: -mrtd, -mno-rtd
2254
2255Make StdCall calling convention the default
2256
Vedant Kumar368540f2018-08-23 17:55:03 +00002257.. option:: -msign-return-address=<arg>
2258
2259Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002260
Richard Smith081ad4d2017-01-24 19:39:46 +00002261.. option:: -msoft-float, -mno-soft-float
2262
2263Use software floating point
2264
Richard Smith081ad4d2017-01-24 19:39:46 +00002265.. option:: -mstack-alignment=<arg>
2266
2267Set the stack alignment
2268
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002269.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2270
2271Enable stack probes
2272
Richard Smith081ad4d2017-01-24 19:39:46 +00002273.. option:: -mstack-probe-size=<arg>
2274
2275Set the stack probe size
2276
Richard Smith081ad4d2017-01-24 19:39:46 +00002277.. option:: -mstackrealign, -mno-stackrealign
2278
2279Force realign the stack at entry to every function
2280
Richard Smith081ad4d2017-01-24 19:39:46 +00002281.. option:: -mthread-model <arg>
2282
2283The thread model to use, e.g. posix, single (posix by default)
2284
Richard Smith081ad4d2017-01-24 19:39:46 +00002285.. option:: -mthreads<arg>
2286
Richard Smith081ad4d2017-01-24 19:39:46 +00002287.. option:: -mthumb, -mno-thumb
2288
Richard Smith081ad4d2017-01-24 19:39:46 +00002289.. option:: -mtune=<arg>
2290
Richard Smith78e23fd2017-04-13 22:39:49 +00002291.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002292
Richard Smith081ad4d2017-01-24 19:39:46 +00002293.. option:: -municode<arg>
2294
Richard Smith081ad4d2017-01-24 19:39:46 +00002295.. option:: -mvx, -mno-vx
2296
Richard Smith081ad4d2017-01-24 19:39:46 +00002297.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2298
Richard Smith78e23fd2017-04-13 22:39:49 +00002299.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002300
Richard Smith081ad4d2017-01-24 19:39:46 +00002301.. option:: -mwindows<arg>
2302
Richard Smith081ad4d2017-01-24 19:39:46 +00002303.. option:: -mx32
2304
Richard Smith081ad4d2017-01-24 19:39:46 +00002305AARCH64
2306-------
Tri Vo6e8abbc2018-09-12 23:45:04 +00002307.. option:: -ffixed-x1
2308
2309Reserve the x1 register (AArch64 only)
2310
2311.. option:: -ffixed-x2
2312
2313Reserve the x2 register (AArch64 only)
2314
2315.. option:: -ffixed-x3
2316
2317Reserve the x3 register (AArch64 only)
2318
2319.. option:: -ffixed-x4
2320
2321Reserve the x4 register (AArch64 only)
2322
2323.. option:: -ffixed-x5
2324
2325Reserve the x5 register (AArch64 only)
2326
2327.. option:: -ffixed-x6
2328
2329Reserve the x6 register (AArch64 only)
2330
2331.. option:: -ffixed-x7
2332
2333Reserve the x7 register (AArch64 only)
2334
Richard Smith081ad4d2017-01-24 19:39:46 +00002335.. option:: -ffixed-x18
2336
2337Reserve the x18 register (AArch64 only)
2338
Petr Hosek72509082018-06-12 20:00:50 +00002339.. option:: -ffixed-x20
2340
2341Reserve the x20 register (AArch64 only)
2342
Tri Vo28e7e602018-09-25 16:48:40 +00002343.. option:: -fcall-saved-x8
2344
2345Make the x8 register call-saved (AArch64 only)
2346
2347.. option:: -fcall-saved-x9
2348
2349Make the x9 register call-saved (AArch64 only)
2350
2351.. option:: -fcall-saved-x10
2352
2353Make the x10 register call-saved (AArch64 only)
2354
2355.. option:: -fcall-saved-x11
2356
2357Make the x11 register call-saved (AArch64 only)
2358
2359.. option:: -fcall-saved-x12
2360
2361Make the x12 register call-saved (AArch64 only)
2362
2363.. option:: -fcall-saved-x13
2364
2365Make the x13 register call-saved (AArch64 only)
2366
2367.. option:: -fcall-saved-x14
2368
2369Make the x14 register call-saved (AArch64 only)
2370
2371.. option:: -fcall-saved-x15
2372
2373Make the x15 register call-saved (AArch64 only)
2374
2375.. option:: -fcall-saved-x18
2376
2377Make the x18 register call-saved (AArch64 only)
2378
Richard Smith081ad4d2017-01-24 19:39:46 +00002379.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2380
2381Workaround Cortex-A53 erratum 835769 (AArch64 only)
2382
Richard Smith081ad4d2017-01-24 19:39:46 +00002383.. option:: -mgeneral-regs-only
2384
2385Generate code which only uses the general purpose registers (AArch64 only)
2386
2387AMDGPU
2388------
Craig Topper16418662017-11-20 18:07:43 +00002389.. option:: -mxnack, -mno-xnack
2390
2391Enable XNACK (AMDGPU only)
2392
Richard Smith081ad4d2017-01-24 19:39:46 +00002393ARM
2394---
Richard Smith081ad4d2017-01-24 19:39:46 +00002395.. option:: -ffixed-r9
2396
2397Reserve the r9 register (ARM only)
2398
Richard Smith081ad4d2017-01-24 19:39:46 +00002399.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2400
2401Disallow generation of data access to code sections (ARM only)
2402
Richard Smith081ad4d2017-01-24 19:39:46 +00002403.. option:: -mno-movt
2404
2405Disallow use of movt/movw pairs (ARM only)
2406
Richard Smith78e23fd2017-04-13 22:39:49 +00002407.. option:: -mno-neg-immediates
2408
2409Disallow converting instructions with negative immediates to their negation or inversion.
2410
Richard Smith081ad4d2017-01-24 19:39:46 +00002411.. option:: -mnocrc
2412
2413Disallow use of CRC instructions (ARM only)
2414
Richard Smith081ad4d2017-01-24 19:39:46 +00002415.. option:: -mrestrict-it, -mno-restrict-it
2416
2417Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2418
Craig Topper16418662017-11-20 18:07:43 +00002419.. option:: -mtp=<arg>
2420
2421Read thread pointer from coprocessor register (ARM only)
2422
Richard Smith081ad4d2017-01-24 19:39:46 +00002423.. option:: -munaligned-access, -mno-unaligned-access
2424
2425Allow memory accesses to be unaligned (AArch32/AArch64 only)
2426
2427Hexagon
2428-------
Craig Topper16418662017-11-20 18:07:43 +00002429.. option:: -mieee-rnd-near
2430
Vedant Kumar368540f2018-08-23 17:55:03 +00002431.. option:: -mmemops, -mno-memops
2432
2433Enable generation of memop instructions
2434
2435.. option:: -mnvj, -mno-nvj
2436
2437Enable generation of new-value jumps
2438
2439.. option:: -mnvs, -mno-nvs
2440
2441Enable generation of new-value stores
2442
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002443.. option:: -mpackets, -mno-packets
2444
2445Enable generation of instruction packets
2446
Craig Topper16418662017-11-20 18:07:43 +00002447Hexagon
2448-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002449.. option:: -mhvx, -mno-hvx
2450
2451Enable Hexagon Vector eXtensions
2452
Craig Topper16418662017-11-20 18:07:43 +00002453.. option:: -mhvx-length=<arg>
2454
2455Set Hexagon Vector Length
2456
2457.. program:: clang1
2458.. option:: -mhvx=<arg>
2459.. program:: clang
2460
2461Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002462
Vedant Kumar368540f2018-08-23 17:55:03 +00002463MIPS
2464----
2465.. option:: -mabicalls, -mno-abicalls
2466
2467Enable SVR4-style position-independent code (Mips only)
2468
2469.. option:: -mabs=<arg>
2470
2471.. option:: -mcheck-zero-division, -mno-check-zero-division
2472
2473.. option:: -mcompact-branches=<arg>
2474
2475.. option:: -mdouble-float
2476
2477.. option:: -mdsp, -mno-dsp
2478
2479.. option:: -mdspr2, -mno-dspr2
2480
2481.. option:: -membedded-data, -mno-embedded-data
2482
2483Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2484
2485.. option:: -mextern-sdata, -mno-extern-sdata
2486
2487Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2488
2489.. option:: -mfp32
2490
2491Use 32-bit floating point registers (MIPS only)
2492
2493.. option:: -mfp64
2494
2495Use 64-bit floating point registers (MIPS only)
2496
2497.. option:: -mginv, -mno-ginv
2498
2499.. option:: -mgpopt, -mno-gpopt
2500
2501Use GP relative accesses for symbols known to be in a small data section (MIPS)
2502
2503.. option:: -mindirect-jump=<arg>
2504
2505Change indirect jump instructions to inhibit speculation
2506
2507.. option:: -mips16
2508
2509.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2510
2511.. option:: -mlocal-sdata, -mno-local-sdata
2512
2513Extend the -G behaviour to object local data (MIPS)
2514
2515.. option:: -mmadd4, -mno-madd4
2516
2517Enable the generation of 4-operand madd.s, madd.d and related instructions.
2518
2519.. option:: -mmicromips, -mno-micromips
2520
2521.. option:: -mmsa, -mno-msa
2522
2523Enable MSA ASE (MIPS only)
2524
2525.. option:: -mmt, -mno-mt
2526
2527Enable MT ASE (MIPS only)
2528
2529.. option:: -mnan=<arg>
2530
2531.. option:: -mno-mips16
2532
2533.. option:: -msingle-float
2534
2535.. option:: -mvirt, -mno-virt
2536
2537.. option:: -mxgot, -mno-xgot
2538
Richard Smith081ad4d2017-01-24 19:39:46 +00002539PowerPC
2540-------
Richard Smith78e23fd2017-04-13 22:39:49 +00002541.. option:: -maltivec, -mno-altivec
2542
Richard Smith081ad4d2017-01-24 19:39:46 +00002543.. option:: -mcmpb, -mno-cmpb
2544
Richard Smith081ad4d2017-01-24 19:39:46 +00002545.. option:: -mcrbits, -mno-crbits
2546
Richard Smith081ad4d2017-01-24 19:39:46 +00002547.. option:: -mcrypto, -mno-crypto
2548
Richard Smith081ad4d2017-01-24 19:39:46 +00002549.. option:: -mdirect-move, -mno-direct-move
2550
Richard Smith081ad4d2017-01-24 19:39:46 +00002551.. option:: -mfloat128, -mno-float128
2552
Richard Smith081ad4d2017-01-24 19:39:46 +00002553.. option:: -mfprnd, -mno-fprnd
2554
Richard Smith081ad4d2017-01-24 19:39:46 +00002555.. option:: -mhtm, -mno-htm
2556
Richard Smith081ad4d2017-01-24 19:39:46 +00002557.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2558
Richard Smith081ad4d2017-01-24 19:39:46 +00002559.. option:: -misel, -mno-isel
2560
Richard Smith081ad4d2017-01-24 19:39:46 +00002561.. option:: -mlongcall, -mno-longcall
2562
Richard Smith081ad4d2017-01-24 19:39:46 +00002563.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2564
Richard Smith081ad4d2017-01-24 19:39:46 +00002565.. option:: -mpopcntd, -mno-popcntd
2566
Richard Smith081ad4d2017-01-24 19:39:46 +00002567.. option:: -mpower8-vector, -mno-power8-vector
2568
Richard Smith081ad4d2017-01-24 19:39:46 +00002569.. option:: -mpower9-vector, -mno-power9-vector
2570
Richard Smith081ad4d2017-01-24 19:39:46 +00002571.. option:: -mqpx, -mno-qpx
2572
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002573.. option:: -msecure-plt
2574
Richard Smith081ad4d2017-01-24 19:39:46 +00002575.. option:: -mvsx, -mno-vsx
2576
2577WebAssembly
2578-----------
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002579.. option:: -mexception-handling, -mno-exception-handling
2580
Craig Topper188252d2017-12-11 21:09:16 +00002581.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
2582
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00002583.. option:: -msign-ext, -mno-sign-ext
2584
Richard Smith081ad4d2017-01-24 19:39:46 +00002585.. option:: -msimd128, -mno-simd128
2586
2587X86
2588---
Richard Smith081ad4d2017-01-24 19:39:46 +00002589.. option:: -m3dnow, -mno-3dnow
2590
Richard Smith081ad4d2017-01-24 19:39:46 +00002591.. option:: -m3dnowa, -mno-3dnowa
2592
Richard Smith081ad4d2017-01-24 19:39:46 +00002593.. option:: -madx, -mno-adx
2594
Richard Smith081ad4d2017-01-24 19:39:46 +00002595.. option:: -maes, -mno-aes
2596
Richard Smith081ad4d2017-01-24 19:39:46 +00002597.. option:: -mavx, -mno-avx
2598
Richard Smith081ad4d2017-01-24 19:39:46 +00002599.. option:: -mavx2, -mno-avx2
2600
Craig Topper287c8012018-01-03 18:29:12 +00002601.. option:: -mavx512bitalg, -mno-avx512bitalg
2602
Richard Smith081ad4d2017-01-24 19:39:46 +00002603.. option:: -mavx512bw, -mno-avx512bw
2604
Richard Smith081ad4d2017-01-24 19:39:46 +00002605.. option:: -mavx512cd, -mno-avx512cd
2606
Richard Smith081ad4d2017-01-24 19:39:46 +00002607.. option:: -mavx512dq, -mno-avx512dq
2608
Richard Smith081ad4d2017-01-24 19:39:46 +00002609.. option:: -mavx512er, -mno-avx512er
2610
Richard Smith081ad4d2017-01-24 19:39:46 +00002611.. option:: -mavx512f, -mno-avx512f
2612
Richard Smith081ad4d2017-01-24 19:39:46 +00002613.. option:: -mavx512ifma, -mno-avx512ifma
2614
Richard Smith081ad4d2017-01-24 19:39:46 +00002615.. option:: -mavx512pf, -mno-avx512pf
2616
Richard Smith081ad4d2017-01-24 19:39:46 +00002617.. option:: -mavx512vbmi, -mno-avx512vbmi
2618
Craig Topper287c8012018-01-03 18:29:12 +00002619.. option:: -mavx512vbmi2, -mno-avx512vbmi2
2620
Richard Smith081ad4d2017-01-24 19:39:46 +00002621.. option:: -mavx512vl, -mno-avx512vl
2622
Craig Topper287c8012018-01-03 18:29:12 +00002623.. option:: -mavx512vnni, -mno-avx512vnni
2624
Craig Topperd23254a2017-07-20 17:52:48 +00002625.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2626
Richard Smith081ad4d2017-01-24 19:39:46 +00002627.. option:: -mbmi, -mno-bmi
2628
Richard Smith081ad4d2017-01-24 19:39:46 +00002629.. option:: -mbmi2, -mno-bmi2
2630
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002631.. option:: -mcldemote, -mno-cldemote
2632
Craig Topper78b47872017-02-08 06:48:58 +00002633.. option:: -mclflushopt, -mno-clflushopt
2634
Craig Topper177a57c2017-02-08 07:57:01 +00002635.. option:: -mclwb, -mno-clwb
2636
Richard Smith78e23fd2017-04-13 22:39:49 +00002637.. option:: -mclzero, -mno-clzero
2638
Richard Smith081ad4d2017-01-24 19:39:46 +00002639.. option:: -mcx16, -mno-cx16
2640
Richard Smith081ad4d2017-01-24 19:39:46 +00002641.. option:: -mf16c, -mno-f16c
2642
Richard Smith081ad4d2017-01-24 19:39:46 +00002643.. option:: -mfma, -mno-fma
2644
Richard Smith081ad4d2017-01-24 19:39:46 +00002645.. option:: -mfma4, -mno-fma4
2646
Richard Smith081ad4d2017-01-24 19:39:46 +00002647.. option:: -mfsgsbase, -mno-fsgsbase
2648
Richard Smith081ad4d2017-01-24 19:39:46 +00002649.. option:: -mfxsr, -mno-fxsr
2650
Craig Topper287c8012018-01-03 18:29:12 +00002651.. option:: -mgfni, -mno-gfni
2652
Vedant Kumar368540f2018-08-23 17:55:03 +00002653.. option:: -minvpcid, -mno-invpcid
2654
Craig Topperd23254a2017-07-20 17:52:48 +00002655.. option:: -mlwp, -mno-lwp
2656
Richard Smith081ad4d2017-01-24 19:39:46 +00002657.. option:: -mlzcnt, -mno-lzcnt
2658
Richard Smith081ad4d2017-01-24 19:39:46 +00002659.. option:: -mmmx, -mno-mmx
2660
Craig Topper177a57c2017-02-08 07:57:01 +00002661.. option:: -mmovbe, -mno-movbe
2662
Gabor Buellaa51e0c22018-05-01 10:05:42 +00002663.. option:: -mmovdir64b, -mno-movdir64b
2664
Vedant Kumar368540f2018-08-23 17:55:03 +00002665.. option:: -mmovdiri, -mno-movdiri
2666
Craig Topperb16cb822017-02-08 07:56:42 +00002667.. option:: -mmpx, -mno-mpx
2668
Richard Smith081ad4d2017-01-24 19:39:46 +00002669.. option:: -mmwaitx, -mno-mwaitx
2670
Richard Smith081ad4d2017-01-24 19:39:46 +00002671.. option:: -mpclmul, -mno-pclmul
2672
Vedant Kumar368540f2018-08-23 17:55:03 +00002673.. option:: -mpconfig, -mno-pconfig
2674
Richard Smith081ad4d2017-01-24 19:39:46 +00002675.. option:: -mpku, -mno-pku
2676
Richard Smith081ad4d2017-01-24 19:39:46 +00002677.. option:: -mpopcnt, -mno-popcnt
2678
Craig Topperd2bf7b02017-02-08 08:23:40 +00002679.. option:: -mprefetchwt1, -mno-prefetchwt1
2680
Richard Smith081ad4d2017-01-24 19:39:46 +00002681.. option:: -mprfchw, -mno-prfchw
2682
Vedant Kumar368540f2018-08-23 17:55:03 +00002683.. option:: -mptwrite, -mno-ptwrite
2684
Craig Topper596527b2018-01-23 18:40:15 +00002685.. option:: -mrdpid, -mno-rdpid
2686
Richard Smith081ad4d2017-01-24 19:39:46 +00002687.. option:: -mrdrnd, -mno-rdrnd
2688
Richard Smith081ad4d2017-01-24 19:39:46 +00002689.. option:: -mrdseed, -mno-rdseed
2690
Craig Topper596527b2018-01-23 18:40:15 +00002691.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
2692
Richard Smith081ad4d2017-01-24 19:39:46 +00002693.. option:: -mrtm, -mno-rtm
2694
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002695.. option:: -msahf, -mno-sahf
2696
Craig Topper204ecff2017-02-08 08:23:17 +00002697.. option:: -msgx, -mno-sgx
2698
Richard Smith081ad4d2017-01-24 19:39:46 +00002699.. option:: -msha, -mno-sha
2700
Craig Topper188252d2017-12-11 21:09:16 +00002701.. option:: -mshstk, -mno-shstk
2702
Richard Smith081ad4d2017-01-24 19:39:46 +00002703.. option:: -msse, -mno-sse
2704
Richard Smith081ad4d2017-01-24 19:39:46 +00002705.. option:: -msse2, -mno-sse2
2706
Richard Smith081ad4d2017-01-24 19:39:46 +00002707.. option:: -msse3, -mno-sse3
2708
Richard Smith081ad4d2017-01-24 19:39:46 +00002709.. option:: -msse4.1, -mno-sse4.1
2710
Richard Smithb2c82a62017-01-27 01:54:42 +00002711.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002712.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00002713.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002714
Richard Smith081ad4d2017-01-24 19:39:46 +00002715.. option:: -msse4a, -mno-sse4a
2716
Richard Smith081ad4d2017-01-24 19:39:46 +00002717.. option:: -mssse3, -mno-ssse3
2718
Richard Smith081ad4d2017-01-24 19:39:46 +00002719.. option:: -mtbm, -mno-tbm
2720
Craig Topper287c8012018-01-03 18:29:12 +00002721.. option:: -mvaes, -mno-vaes
2722
2723.. option:: -mvpclmulqdq, -mno-vpclmulqdq
2724
Craig Topper42da9cb2018-04-23 21:41:06 +00002725.. option:: -mwaitpkg, -mno-waitpkg
2726
Gabor Buellaa0520162018-04-11 20:09:09 +00002727.. option:: -mwbnoinvd, -mno-wbnoinvd
2728
Richard Smith081ad4d2017-01-24 19:39:46 +00002729.. option:: -mx87, -m80387, -mno-x87
2730
Richard Smith081ad4d2017-01-24 19:39:46 +00002731.. option:: -mxop, -mno-xop
2732
Richard Smith081ad4d2017-01-24 19:39:46 +00002733.. option:: -mxsave, -mno-xsave
2734
Richard Smith081ad4d2017-01-24 19:39:46 +00002735.. option:: -mxsavec, -mno-xsavec
2736
Richard Smith081ad4d2017-01-24 19:39:46 +00002737.. option:: -mxsaveopt, -mno-xsaveopt
2738
Richard Smith081ad4d2017-01-24 19:39:46 +00002739.. option:: -mxsaves, -mno-xsaves
2740
Vedant Kumar368540f2018-08-23 17:55:03 +00002741RISCV
2742-----
2743.. option:: -mrelax, -mno-relax
2744
2745Enable linker relaxation
2746
Richard Smith081ad4d2017-01-24 19:39:46 +00002747Optimization level
2748~~~~~~~~~~~~~~~~~~
2749
2750Flags controlling how much optimization should be performed.
2751
Richard Smith081ad4d2017-01-24 19:39:46 +00002752.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2753
Richard Smith081ad4d2017-01-24 19:39:46 +00002754.. option:: -Ofast<arg>
2755
2756Debug information generation
2757~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2758
2759Flags controlling how much and what kind of debug information should be
2760generated.
2761
2762Kind and level of debug information
2763-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002764.. option:: -g, --debug, --debug=<arg>
2765
2766Generate source-level debug information
2767
Richard Smith081ad4d2017-01-24 19:39:46 +00002768.. option:: -gdwarf-2
2769
2770Generate source-level debug information with dwarf version 2
2771
Richard Smith081ad4d2017-01-24 19:39:46 +00002772.. option:: -gdwarf-3
2773
2774Generate source-level debug information with dwarf version 3
2775
Richard Smith081ad4d2017-01-24 19:39:46 +00002776.. option:: -gdwarf-4, -gdwarf
2777
2778Generate source-level debug information with dwarf version 4
2779
Richard Smith081ad4d2017-01-24 19:39:46 +00002780.. option:: -gdwarf-5
2781
2782Generate source-level debug information with dwarf version 5
2783
Richard Smith081ad4d2017-01-24 19:39:46 +00002784.. option:: -gfull
2785
Richard Smith081ad4d2017-01-24 19:39:46 +00002786.. option:: -gused
2787
2788Debug level
2789___________
Richard Smith081ad4d2017-01-24 19:39:46 +00002790.. option:: -g0
2791
Richard Smith081ad4d2017-01-24 19:39:46 +00002792.. option:: -g2
2793
Richard Smith081ad4d2017-01-24 19:39:46 +00002794.. option:: -g3
2795
Richard Smith081ad4d2017-01-24 19:39:46 +00002796.. option:: -ggdb0
2797
Richard Smith081ad4d2017-01-24 19:39:46 +00002798.. option:: -ggdb1
2799
Richard Smith081ad4d2017-01-24 19:39:46 +00002800.. option:: -ggdb2
2801
Richard Smith081ad4d2017-01-24 19:39:46 +00002802.. option:: -ggdb3
2803
Richard Smith081ad4d2017-01-24 19:39:46 +00002804.. option:: -gline-tables-only, -g1, -gmlt
2805
2806Emit debug line number tables only
2807
Richard Smith081ad4d2017-01-24 19:39:46 +00002808.. option:: -gmodules
2809
2810Generate debug info with external references to clang modules or precompiled headers
2811
2812Debugger to tune debug information for
2813______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00002814.. option:: -ggdb
2815
Richard Smith081ad4d2017-01-24 19:39:46 +00002816.. option:: -glldb
2817
Richard Smith081ad4d2017-01-24 19:39:46 +00002818.. option:: -gsce
2819
2820Debug information flags
2821-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002822.. option:: -gcolumn-info, -gno-column-info
2823
Richard Smith081ad4d2017-01-24 19:39:46 +00002824.. option:: -gdwarf-aranges
2825
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002826.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00002827
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002828Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00002829
Vedant Kumar368540f2018-08-23 17:55:03 +00002830.. option:: -ggnu-pubnames, -gno-gnu-pubnames
2831
2832.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00002833
Richard Smith081ad4d2017-01-24 19:39:46 +00002834.. option:: -grecord-gcc-switches, -gno-record-gcc-switches
2835
Richard Smith081ad4d2017-01-24 19:39:46 +00002836.. option:: -gsplit-dwarf
2837
Richard Smith081ad4d2017-01-24 19:39:46 +00002838.. option:: -gstrict-dwarf, -gno-strict-dwarf
2839
Craig Topperd23254a2017-07-20 17:52:48 +00002840.. option:: -gz
2841
2842DWARF debug sections compression type
2843
2844.. program:: clang1
2845.. option:: -gz=<arg>
2846.. program:: clang
2847
2848DWARF debug sections compression type
2849
Richard Smithc5b2e002017-01-27 02:08:37 +00002850Static analyzer flags
2851=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00002852
Richard Smithc5b2e002017-01-27 02:08:37 +00002853Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00002854
Richard Smithc5b2e002017-01-27 02:08:37 +00002855.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002856
Richard Smithc5b2e002017-01-27 02:08:37 +00002857Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00002858
2859Fortran compilation flags
2860=========================
2861
2862Flags that will be passed onto the ``gfortran`` compiler when Clang is given
2863a Fortran input.
2864
Richard Smithc5b2e002017-01-27 02:08:37 +00002865.. option:: -A<arg>, --assert <arg>, --assert=<arg>
2866
Richard Smith081ad4d2017-01-24 19:39:46 +00002867.. option:: -A-<arg>
2868
Richard Smith081ad4d2017-01-24 19:39:46 +00002869.. option:: -J<arg>
2870
Richard Smith081ad4d2017-01-24 19:39:46 +00002871.. option:: -cpp
2872
Richard Smith081ad4d2017-01-24 19:39:46 +00002873.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
2874
Richard Smith081ad4d2017-01-24 19:39:46 +00002875.. option:: -falign-commons, -fno-align-commons
2876
Richard Smith081ad4d2017-01-24 19:39:46 +00002877.. option:: -fall-intrinsics, -fno-all-intrinsics
2878
Richard Smith081ad4d2017-01-24 19:39:46 +00002879.. option:: -fautomatic, -fno-automatic
2880
Richard Smith081ad4d2017-01-24 19:39:46 +00002881.. option:: -fbackslash, -fno-backslash
2882
Richard Smith081ad4d2017-01-24 19:39:46 +00002883.. option:: -fbacktrace, -fno-backtrace
2884
Richard Smith081ad4d2017-01-24 19:39:46 +00002885.. option:: -fblas-matmul-limit=<arg>
2886
Richard Smith081ad4d2017-01-24 19:39:46 +00002887.. option:: -fbounds-check, -fno-bounds-check
2888
Richard Smith081ad4d2017-01-24 19:39:46 +00002889.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
2890
Richard Smith081ad4d2017-01-24 19:39:46 +00002891.. option:: -fcheck=<arg>
2892
Richard Smith081ad4d2017-01-24 19:39:46 +00002893.. option:: -fcoarray=<arg>
2894
Richard Smith081ad4d2017-01-24 19:39:46 +00002895.. option:: -fconvert=<arg>
2896
Richard Smith081ad4d2017-01-24 19:39:46 +00002897.. option:: -fcray-pointer, -fno-cray-pointer
2898
Richard Smith081ad4d2017-01-24 19:39:46 +00002899.. option:: -fd-lines-as-code, -fno-d-lines-as-code
2900
Richard Smith081ad4d2017-01-24 19:39:46 +00002901.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
2902
Richard Smith081ad4d2017-01-24 19:39:46 +00002903.. option:: -fdefault-double-8, -fno-default-double-8
2904
Richard Smith081ad4d2017-01-24 19:39:46 +00002905.. option:: -fdefault-integer-8, -fno-default-integer-8
2906
Richard Smith081ad4d2017-01-24 19:39:46 +00002907.. option:: -fdefault-real-8, -fno-default-real-8
2908
Richard Smith081ad4d2017-01-24 19:39:46 +00002909.. option:: -fdollar-ok, -fno-dollar-ok
2910
Richard Smith081ad4d2017-01-24 19:39:46 +00002911.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
2912
Richard Smith081ad4d2017-01-24 19:39:46 +00002913.. option:: -fdump-fortran-original, -fno-dump-fortran-original
2914
Richard Smith081ad4d2017-01-24 19:39:46 +00002915.. option:: -fdump-parse-tree, -fno-dump-parse-tree
2916
Richard Smith081ad4d2017-01-24 19:39:46 +00002917.. option:: -fexternal-blas, -fno-external-blas
2918
Richard Smith081ad4d2017-01-24 19:39:46 +00002919.. option:: -ff2c, -fno-f2c
2920
Richard Smith081ad4d2017-01-24 19:39:46 +00002921.. option:: -ffixed-form, -fno-fixed-form
2922
Richard Smith081ad4d2017-01-24 19:39:46 +00002923.. option:: -ffixed-line-length-<arg>
2924
Richard Smith081ad4d2017-01-24 19:39:46 +00002925.. option:: -ffpe-trap=<arg>
2926
Richard Smith081ad4d2017-01-24 19:39:46 +00002927.. option:: -ffree-form, -fno-free-form
2928
Richard Smith081ad4d2017-01-24 19:39:46 +00002929.. option:: -ffree-line-length-<arg>
2930
Richard Smith081ad4d2017-01-24 19:39:46 +00002931.. option:: -ffrontend-optimize, -fno-frontend-optimize
2932
Richard Smith081ad4d2017-01-24 19:39:46 +00002933.. option:: -fimplicit-none, -fno-implicit-none
2934
Richard Smith081ad4d2017-01-24 19:39:46 +00002935.. option:: -finit-character=<arg>
2936
Richard Smith081ad4d2017-01-24 19:39:46 +00002937.. option:: -finit-integer=<arg>
2938
Richard Smith081ad4d2017-01-24 19:39:46 +00002939.. option:: -finit-local-zero, -fno-init-local-zero
2940
Richard Smith081ad4d2017-01-24 19:39:46 +00002941.. option:: -finit-logical=<arg>
2942
Richard Smith081ad4d2017-01-24 19:39:46 +00002943.. option:: -finit-real=<arg>
2944
Richard Smith081ad4d2017-01-24 19:39:46 +00002945.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
2946
Richard Smith081ad4d2017-01-24 19:39:46 +00002947.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
2948
Richard Smith081ad4d2017-01-24 19:39:46 +00002949.. option:: -fmax-array-constructor=<arg>
2950
Richard Smith081ad4d2017-01-24 19:39:46 +00002951.. option:: -fmax-errors=<arg>
2952
Richard Smith081ad4d2017-01-24 19:39:46 +00002953.. option:: -fmax-identifier-length, -fno-max-identifier-length
2954
Richard Smith081ad4d2017-01-24 19:39:46 +00002955.. option:: -fmax-stack-var-size=<arg>
2956
Richard Smith081ad4d2017-01-24 19:39:46 +00002957.. option:: -fmax-subrecord-length=<arg>
2958
Richard Smith081ad4d2017-01-24 19:39:46 +00002959.. option:: -fmodule-private, -fno-module-private
2960
Richard Smith081ad4d2017-01-24 19:39:46 +00002961.. option:: -fpack-derived, -fno-pack-derived
2962
Richard Smith081ad4d2017-01-24 19:39:46 +00002963.. option:: -fprotect-parens, -fno-protect-parens
2964
Richard Smith081ad4d2017-01-24 19:39:46 +00002965.. option:: -frange-check, -fno-range-check
2966
Richard Smith081ad4d2017-01-24 19:39:46 +00002967.. option:: -freal-4-real-10, -fno-real-4-real-10
2968
Richard Smith081ad4d2017-01-24 19:39:46 +00002969.. option:: -freal-4-real-16, -fno-real-4-real-16
2970
Richard Smith081ad4d2017-01-24 19:39:46 +00002971.. option:: -freal-4-real-8, -fno-real-4-real-8
2972
Richard Smith081ad4d2017-01-24 19:39:46 +00002973.. option:: -freal-8-real-10, -fno-real-8-real-10
2974
Richard Smith081ad4d2017-01-24 19:39:46 +00002975.. option:: -freal-8-real-16, -fno-real-8-real-16
2976
Richard Smith081ad4d2017-01-24 19:39:46 +00002977.. option:: -freal-8-real-4, -fno-real-8-real-4
2978
Richard Smith081ad4d2017-01-24 19:39:46 +00002979.. option:: -frealloc-lhs, -fno-realloc-lhs
2980
Richard Smith081ad4d2017-01-24 19:39:46 +00002981.. option:: -frecord-marker=<arg>
2982
Richard Smith081ad4d2017-01-24 19:39:46 +00002983.. option:: -frecursive, -fno-recursive
2984
Richard Smith081ad4d2017-01-24 19:39:46 +00002985.. option:: -frepack-arrays, -fno-repack-arrays
2986
Richard Smith081ad4d2017-01-24 19:39:46 +00002987.. option:: -fsecond-underscore, -fno-second-underscore
2988
Richard Smith081ad4d2017-01-24 19:39:46 +00002989.. option:: -fsign-zero, -fno-sign-zero
2990
Richard Smith081ad4d2017-01-24 19:39:46 +00002991.. option:: -fstack-arrays, -fno-stack-arrays
2992
Richard Smith081ad4d2017-01-24 19:39:46 +00002993.. option:: -funderscoring, -fno-underscoring
2994
Richard Smith081ad4d2017-01-24 19:39:46 +00002995.. option:: -fwhole-file, -fno-whole-file
2996
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002997.. option:: -imultilib <arg>
2998
Richard Smith081ad4d2017-01-24 19:39:46 +00002999.. option:: -nocpp
3000
Richard Smith081ad4d2017-01-24 19:39:46 +00003001.. option:: -static-libgfortran
3002
Richard Smithc5b2e002017-01-27 02:08:37 +00003003Linker flags
3004============
3005Flags that are passed on to the linker
3006
3007.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3008
3009Add directory to library search path
3010
3011.. option:: -Mach
3012
3013.. option:: -T<script>
3014
3015Specify <script> as linker script
3016
Richard Smith78e23fd2017-04-13 22:39:49 +00003017.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003018
3019Set starting address of BSS to <addr>
3020
Richard Smith78e23fd2017-04-13 22:39:49 +00003021.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003022
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003023Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003024
Richard Smith78e23fd2017-04-13 22:39:49 +00003025.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003026
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003027Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003028
3029.. option:: -Wl,<arg>,<arg2>...
3030
3031Pass the comma separated arguments in <arg> to the linker
3032
3033.. option:: -X
3034
3035.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3036
3037Pass <arg> to the linker
3038
3039.. program:: clang1
3040.. option:: -Z
3041.. program:: clang
3042
3043.. option:: -e<arg>, --entry
3044
3045.. option:: -filelist <arg>
3046
Vedant Kumar368540f2018-08-23 17:55:03 +00003047.. option:: --hip-device-lib-path=<arg>
3048
3049HIP device library path
3050
3051.. option:: --hip-device-lib=<arg>
3052
3053HIP device library
3054
Richard Smithc5b2e002017-01-27 02:08:37 +00003055.. option:: -l<arg>
3056
3057.. option:: -r
3058
3059.. option:: -rpath <arg>
3060
3061.. option:: -s
3062
3063.. option:: -t
3064
3065.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3066
3067.. option:: -undef
3068
3069undef all system defines
3070
3071.. option:: -undefined<arg>, --no-undefined
3072
3073.. option:: -z <arg>
3074
3075Pass -z <arg> to the linker
3076