blob: 4fde6034975e1872b9f23f15df61a20c050520f5 [file] [log] [blame]
Richard Smith081ad4d2017-01-24 19:39:46 +00001..
2 -------------------------------------------------------------------
3 NOTE: This file is automatically generated by running clang-tblgen
4 -gen-opt-docs. Do not edit this file by hand!!
5 -------------------------------------------------------------------
6
7=====================================
8Clang command line argument reference
9=====================================
10.. contents::
11 :local:
12
13Introduction
14============
15
16This page lists the command line arguments currently supported by the
17GCC-compatible ``clang`` and ``clang++`` drivers.
18
19
20.. program:: clang
Richard Smithc5b2e002017-01-27 02:08:37 +000021.. option:: -B<dir>, --prefix <arg>, --prefix=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +000022
Richard Smithc5b2e002017-01-27 02:08:37 +000023Add <dir> to search path for binaries and object files used implicitly
Richard Smith081ad4d2017-01-24 19:39:46 +000024
Richard Smith081ad4d2017-01-24 19:39:46 +000025.. option:: -F<arg>
26
27Add directory to framework include search path
28
Richard Smith081ad4d2017-01-24 19:39:46 +000029.. option:: -ObjC
30
31Treat source input files as Objective-C inputs
32
Richard Smithb2c82a62017-01-27 01:54:42 +000033.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +000034.. option:: -ObjC++
Richard Smithb2c82a62017-01-27 01:54:42 +000035.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +000036
37Treat source input files as Objective-C++ inputs
38
Vedant Kumar368540f2018-08-23 17:55:03 +000039.. option:: -Qn, -fno-ident
Craig Topper42da9cb2018-04-23 21:41:06 +000040
41Do not emit metadata containing compiler name and version
42
Richard Smith081ad4d2017-01-24 19:39:46 +000043.. option:: -Qunused-arguments
44
45Don't emit warning for unused driver arguments
46
Vedant Kumar368540f2018-08-23 17:55:03 +000047.. option:: -Qy, -fident
Craig Topper42da9cb2018-04-23 21:41:06 +000048
49Emit metadata containing compiler name and version
50
Richard Smith081ad4d2017-01-24 19:39:46 +000051.. option:: -Wa,<arg>,<arg2>...
52
53Pass the comma separated arguments in <arg> to the assembler
54
Richard Smith081ad4d2017-01-24 19:39:46 +000055.. option:: -Wlarge-by-value-copy=<arg>
56
Richard Smith081ad4d2017-01-24 19:39:46 +000057.. option:: -Xarch\_<arg1> <arg2>
58
Richard Smith081ad4d2017-01-24 19:39:46 +000059.. option:: -Xcuda-fatbinary <arg>
60
61Pass <arg> to fatbinary invocation
62
Richard Smith081ad4d2017-01-24 19:39:46 +000063.. option:: -Xcuda-ptxas <arg>
64
65Pass <arg> to the ptxas assembler
66
Boris Kolpackovb150d242017-08-30 09:15:53 +000067.. option:: -Xopenmp-target <arg>
68
69Pass <arg> to the target offloading toolchain.
70
71.. program:: clang1
Jonas Hahnfelda180fc42018-02-22 17:10:28 +000072.. option:: -Xopenmp-target=<triple> <arg>
Boris Kolpackovb150d242017-08-30 09:15:53 +000073.. program:: clang
74
Jonas Hahnfelda180fc42018-02-22 17:10:28 +000075Pass <arg> to the target offloading toolchain identified by <triple>.
Boris Kolpackovb150d242017-08-30 09:15:53 +000076
Richard Smith081ad4d2017-01-24 19:39:46 +000077.. option:: -Z<arg>
78
Richard Smith081ad4d2017-01-24 19:39:46 +000079.. option:: -a<arg>, --profile-blocks
80
Richard Smith081ad4d2017-01-24 19:39:46 +000081.. option:: -all\_load
82
Richard Smith081ad4d2017-01-24 19:39:46 +000083.. option:: -allowable\_client <arg>
84
Richard Smith081ad4d2017-01-24 19:39:46 +000085.. option:: --analyze
86
87Run the static analyzer
88
Richard Smith081ad4d2017-01-24 19:39:46 +000089.. option:: --analyzer-no-default-checks
90
Richard Smith081ad4d2017-01-24 19:39:46 +000091.. option:: --analyzer-output<arg>
92
Craig Topper9624beb2020-03-10 11:08:19 -070093Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|sarif\|text).
Richard Smith081ad4d2017-01-24 19:39:46 +000094
Richard Smith081ad4d2017-01-24 19:39:46 +000095.. option:: -ansi, --ansi
96
Richard Smith081ad4d2017-01-24 19:39:46 +000097.. option:: -arch <arg>
98
Richard Smithb2c82a62017-01-27 01:54:42 +000099.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000100.. option:: -arch\_errors\_fatal
Richard Smithb2c82a62017-01-27 01:54:42 +0000101.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000102
Richard Smithb2c82a62017-01-27 01:54:42 +0000103.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000104.. option:: -arch\_only <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000105.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000106
Richard Smith081ad4d2017-01-24 19:39:46 +0000107.. option:: -arcmt-migrate-emit-errors
108
109Emit ARC errors even if the migrator can fix them
110
Richard Smith081ad4d2017-01-24 19:39:46 +0000111.. option:: -arcmt-migrate-report-output <arg>
112
113Output path for the plist report
114
Craig Topperd23254a2017-07-20 17:52:48 +0000115.. option:: --autocomplete=<arg>
116
Richard Smith081ad4d2017-01-24 19:39:46 +0000117.. option:: -bind\_at\_load
118
Richard Smith081ad4d2017-01-24 19:39:46 +0000119.. option:: -bundle
120
Richard Smithb2c82a62017-01-27 01:54:42 +0000121.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000122.. option:: -bundle\_loader <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000123.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000124
Richard Smith081ad4d2017-01-24 19:39:46 +0000125.. option:: -client\_name<arg>
126
Richard Smith081ad4d2017-01-24 19:39:46 +0000127.. option:: -compatibility\_version<arg>
128
Craig Topper287c8012018-01-03 18:29:12 +0000129.. option:: --config <arg>
130
131Specifies configuration file
132
Richard Smith081ad4d2017-01-24 19:39:46 +0000133.. option:: --constant-cfstrings
134
Richard Smith081ad4d2017-01-24 19:39:46 +0000135.. option:: -coverage, --coverage
136
Richard Smith081ad4d2017-01-24 19:39:46 +0000137.. option:: --cuda-compile-host-device
138
139Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations.
140
Richard Smith081ad4d2017-01-24 19:39:46 +0000141.. option:: --cuda-device-only
142
143Compile CUDA code for device only
144
Richard Smith081ad4d2017-01-24 19:39:46 +0000145.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
146
147CUDA GPU architecture (e.g. sm\_35). May be specified more than once.
148
Richard Smith081ad4d2017-01-24 19:39:46 +0000149.. option:: --cuda-host-only
150
151Compile CUDA code for host only. Has no effect on non-CUDA compilations.
152
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000153.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg>
154
Sylvestre Ledru90f1dfb2019-01-01 12:51:14 +0000155Include PTX for the following GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once.
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000156
Richard Smith081ad4d2017-01-24 19:39:46 +0000157.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
158
159Enable device-side debug info generation. Disables ptxas optimizations.
160
Richard Smith081ad4d2017-01-24 19:39:46 +0000161.. option:: -current\_version<arg>
162
Richard Smith081ad4d2017-01-24 19:39:46 +0000163.. option:: -dead\_strip
164
Richard Smith081ad4d2017-01-24 19:39:46 +0000165.. option:: -dependency-dot <arg>
166
167Filename to write DOT-formatted header dependencies to
168
Richard Smith081ad4d2017-01-24 19:39:46 +0000169.. option:: -dependency-file <arg>
170
171Filename (or -) to write dependency output to
172
Richard Smith081ad4d2017-01-24 19:39:46 +0000173.. option:: -dumpmachine
174
Richard Smith081ad4d2017-01-24 19:39:46 +0000175.. option:: -dumpversion
176
Richard Smith081ad4d2017-01-24 19:39:46 +0000177.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
178
Richard Smith081ad4d2017-01-24 19:39:46 +0000179.. option:: -dylib\_file <arg>
180
Richard Smith081ad4d2017-01-24 19:39:46 +0000181.. option:: -dylinker
182
Richard Smithb2c82a62017-01-27 01:54:42 +0000183.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000184.. option:: -dylinker\_install\_name<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000185.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000186
Richard Smith081ad4d2017-01-24 19:39:46 +0000187.. option:: -dynamic
188
Richard Smith081ad4d2017-01-24 19:39:46 +0000189.. option:: -dynamiclib
190
Richard Smith081ad4d2017-01-24 19:39:46 +0000191.. option:: -emit-ast
192
193Emit Clang AST files for source inputs
194
Craig Topper9624beb2020-03-10 11:08:19 -0700195.. option:: -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
196
197Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark
198
Richard Smith081ad4d2017-01-24 19:39:46 +0000199.. option:: -exported\_symbols\_list <arg>
200
Richard Smith081ad4d2017-01-24 19:39:46 +0000201.. option:: -faligned-new=<arg>
202
Richard Smith081ad4d2017-01-24 19:39:46 +0000203.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
204
205Use approximate transcendental functions
206
Richard Smith081ad4d2017-01-24 19:39:46 +0000207.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
208
209Flush denormal floating point values to zero in CUDA device mode.
210
Vedant Kumar368540f2018-08-23 17:55:03 +0000211.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
212
213Use 32-bit pointers for accessing const/local/shared address spaces.
214
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000215.. option:: -ffixed-r19
216
Vedant Kumar368540f2018-08-23 17:55:03 +0000217Reserve register r19 (Hexagon only)
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000218
Craig Topper9624beb2020-03-10 11:08:19 -0700219.. option:: -fgpu-allow-device-init, -fno-gpu-allow-device-init
220
221Allow device side init function in HIP
222
223.. option:: -fgpu-rdc, -fcuda-rdc, -fno-gpu-rdc
224
225Generate relocatable device code, also known as separate compilation mode.
226
Richard Smith081ad4d2017-01-24 19:39:46 +0000227.. option:: -fheinous-gnu-extensions
228
Craig Topper9624beb2020-03-10 11:08:19 -0700229.. option:: -fhip-new-launch-api, -fno-hip-new-launch-api
230
231Use new kernel launching API for HIP.
232
Richard Smith081ad4d2017-01-24 19:39:46 +0000233.. option:: -flat\_namespace
234
Richard Smith081ad4d2017-01-24 19:39:46 +0000235.. option:: -fopenmp-targets=<arg1>,<arg2>...
236
237Specify comma-separated list of triples OpenMP offloading targets to be supported
238
Richard Smith081ad4d2017-01-24 19:39:46 +0000239.. option:: -force\_cpusubtype\_ALL
240
Richard Smithb2c82a62017-01-27 01:54:42 +0000241.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000242.. option:: -force\_flat\_namespace
Richard Smithb2c82a62017-01-27 01:54:42 +0000243.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000244
Richard Smithb2c82a62017-01-27 01:54:42 +0000245.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000246.. option:: -force\_load <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000247.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000248
Richard Smith081ad4d2017-01-24 19:39:46 +0000249.. option:: -framework <arg>
250
Richard Smith78e23fd2017-04-13 22:39:49 +0000251.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
252
253Add -rpath with architecture-specific resource directory to the linker flags
254
Craig Topper9624beb2020-03-10 11:08:19 -0700255.. option:: -fsanitize-system-blacklist=<arg>
256
257Path to system blacklist file for sanitizers
258
259.. option:: -fsystem-module
260
261Build this module as a system module. Only used with -emit-module
262
Richard Smith081ad4d2017-01-24 19:39:46 +0000263.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
264
265Use the gcc toolchain at the given directory
266
Richard Smith081ad4d2017-01-24 19:39:46 +0000267.. option:: -gcodeview
268
269Generate CodeView debug information
270
Craig Topper9624beb2020-03-10 11:08:19 -0700271.. option:: -gcodeview-ghash, -gno-codeview-ghash
272
273Emit type record hashes in a .debug$H section
274
275.. option:: -ginline-line-tables, -gno-inline-line-tables
276
277.. option:: --gpu-max-threads-per-block=<arg>
278
279Default max threads per block for kernel launch bounds for HIP
280
Richard Smith081ad4d2017-01-24 19:39:46 +0000281.. option:: -headerpad\_max\_install\_names<arg>
282
Richard Smith081ad4d2017-01-24 19:39:46 +0000283.. option:: -help, --help
284
285Display available options
286
Richard Smith081ad4d2017-01-24 19:39:46 +0000287.. option:: --help-hidden
288
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000289Display help for hidden options
290
Vedant Kumar368540f2018-08-23 17:55:03 +0000291.. option:: --hip-link
292
293Link clang-offload-bundler bundles for HIP
294
Craig Topper9624beb2020-03-10 11:08:19 -0700295.. option:: -ibuiltininc
296
297Enable builtin #include directories even when -nostdinc is used before or after -ibuiltininc. Using -nobuiltininc after the option disables it
298
Richard Smith081ad4d2017-01-24 19:39:46 +0000299.. option:: -image\_base <arg>
300
Richard Smith081ad4d2017-01-24 19:39:46 +0000301.. option:: -index-header-map
302
303Make the next included directory (-I or -F) an indexer header map
304
Richard Smith081ad4d2017-01-24 19:39:46 +0000305.. option:: -init <arg>
306
Richard Smith081ad4d2017-01-24 19:39:46 +0000307.. option:: -install\_name <arg>
308
Craig Topper9624beb2020-03-10 11:08:19 -0700309.. option:: -interface-stub-version=<arg>
310
Richard Smith081ad4d2017-01-24 19:39:46 +0000311.. option:: -keep\_private\_externs
312
Richard Smith081ad4d2017-01-24 19:39:46 +0000313.. option:: -lazy\_framework <arg>
314
Richard Smithb2c82a62017-01-27 01:54:42 +0000315.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000316.. option:: -lazy\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000317.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000318
Richard Smith081ad4d2017-01-24 19:39:46 +0000319.. option:: -mbig-endian, -EB
320
Craig Topper9624beb2020-03-10 11:08:19 -0700321.. option:: -mbranch-protection=<arg>
322
323Enforce targets of indirect branches and function returns
324
Richard Smith081ad4d2017-01-24 19:39:46 +0000325.. option:: --migrate
326
327Run the migrator
328
Richard Smith78e23fd2017-04-13 22:39:49 +0000329.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
330
Richard Smith081ad4d2017-01-24 19:39:46 +0000331.. option:: -mlinker-version=<arg>
332
Richard Smith081ad4d2017-01-24 19:39:46 +0000333.. option:: -mlittle-endian, -EL
334
Richard Smith081ad4d2017-01-24 19:39:46 +0000335.. option:: -mllvm <arg>
336
337Additional arguments to forward to LLVM's option processing
338
Richard Smith081ad4d2017-01-24 19:39:46 +0000339.. option:: -module-dependency-dir <arg>
340
341Directory to dump module dependencies to
342
Richard Smith78e23fd2017-04-13 22:39:49 +0000343.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
344
Richard Smith081ad4d2017-01-24 19:39:46 +0000345.. option:: -multi\_module
346
Richard Smith081ad4d2017-01-24 19:39:46 +0000347.. option:: -multiply\_defined <arg>
348
Richard Smithb2c82a62017-01-27 01:54:42 +0000349.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000350.. option:: -multiply\_defined\_unused <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000351.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000352
Richard Smith78e23fd2017-04-13 22:39:49 +0000353.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
354
Richard Smith081ad4d2017-01-24 19:39:46 +0000355.. option:: --no-cuda-version-check
356
357Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
358
Richard Smith081ad4d2017-01-24 19:39:46 +0000359.. option:: -no-integrated-cpp, --no-integrated-cpp
360
Richard Smith081ad4d2017-01-24 19:39:46 +0000361.. option:: -no\_dead\_strip\_inits\_and\_terms
362
Richard Smith081ad4d2017-01-24 19:39:46 +0000363.. option:: -nobuiltininc
364
365Disable builtin #include directories
366
Richard Smith081ad4d2017-01-24 19:39:46 +0000367.. option:: -nocudainc
368
Richard Smith081ad4d2017-01-24 19:39:46 +0000369.. option:: -nodefaultlibs
370
Richard Smith081ad4d2017-01-24 19:39:46 +0000371.. option:: -nofixprebinding
372
Craig Topper9624beb2020-03-10 11:08:19 -0700373.. option:: -nogpulib, -nocudalib
374
375Do not link device library for CUDA/HIP device compilation
376
Richard Smith081ad4d2017-01-24 19:39:46 +0000377.. option:: -nolibc
378
Richard Smith081ad4d2017-01-24 19:39:46 +0000379.. option:: -nomultidefs
380
Craig Topperd23254a2017-07-20 17:52:48 +0000381.. option:: -nopie, -no-pie
Richard Smith081ad4d2017-01-24 19:39:46 +0000382
Richard Smith081ad4d2017-01-24 19:39:46 +0000383.. option:: -noprebind
384
Petr Hosek08cb3422019-07-11 19:06:38 +0000385.. option:: -noprofilelib
386
Richard Smith081ad4d2017-01-24 19:39:46 +0000387.. option:: -noseglinkedit
388
Richard Smith081ad4d2017-01-24 19:39:46 +0000389.. option:: -nostartfiles
390
Richard Smith081ad4d2017-01-24 19:39:46 +0000391.. option:: -nostdinc, --no-standard-includes
392
Richard Smithb2c82a62017-01-27 01:54:42 +0000393.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000394.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000395.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000396
397Disable standard #include directories for the C++ standard library
398
Richard Smith081ad4d2017-01-24 19:39:46 +0000399.. option:: -nostdlib, --no-standard-libraries
400
Boris Kolpackovb150d242017-08-30 09:15:53 +0000401.. program:: clang1
402.. option:: -nostdlib++
403.. program:: clang
404
Richard Smith081ad4d2017-01-24 19:39:46 +0000405.. option:: -nostdlibinc
406
Richard Smith081ad4d2017-01-24 19:39:46 +0000407.. option:: -o<file>, --output <arg>, --output=<arg>
408
409Write output to <file>
410
Richard Smith081ad4d2017-01-24 19:39:46 +0000411.. option:: -objcmt-atomic-property
412
413Make migration to 'atomic' properties
414
Richard Smith081ad4d2017-01-24 19:39:46 +0000415.. option:: -objcmt-migrate-all
416
417Enable migration to modern ObjC
418
Richard Smith081ad4d2017-01-24 19:39:46 +0000419.. option:: -objcmt-migrate-annotation
420
421Enable migration to property and method annotations
422
Richard Smith081ad4d2017-01-24 19:39:46 +0000423.. option:: -objcmt-migrate-designated-init
424
425Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
426
Richard Smith081ad4d2017-01-24 19:39:46 +0000427.. option:: -objcmt-migrate-instancetype
428
429Enable migration to infer instancetype for method result type
430
Richard Smith081ad4d2017-01-24 19:39:46 +0000431.. option:: -objcmt-migrate-literals
432
433Enable migration to modern ObjC literals
434
Richard Smith081ad4d2017-01-24 19:39:46 +0000435.. option:: -objcmt-migrate-ns-macros
436
437Enable migration to NS\_ENUM/NS\_OPTIONS macros
438
Richard Smith081ad4d2017-01-24 19:39:46 +0000439.. option:: -objcmt-migrate-property
440
441Enable migration to modern ObjC property
442
Richard Smith081ad4d2017-01-24 19:39:46 +0000443.. option:: -objcmt-migrate-property-dot-syntax
444
445Enable migration of setter/getter messages to property-dot syntax
446
Richard Smith081ad4d2017-01-24 19:39:46 +0000447.. option:: -objcmt-migrate-protocol-conformance
448
449Enable migration to add protocol conformance on classes
450
Richard Smith081ad4d2017-01-24 19:39:46 +0000451.. option:: -objcmt-migrate-readonly-property
452
453Enable migration to modern ObjC readonly property
454
Richard Smith081ad4d2017-01-24 19:39:46 +0000455.. option:: -objcmt-migrate-readwrite-property
456
457Enable migration to modern ObjC readwrite property
458
Richard Smith081ad4d2017-01-24 19:39:46 +0000459.. option:: -objcmt-migrate-subscripting
460
461Enable migration to modern ObjC subscripting
462
Richard Smith081ad4d2017-01-24 19:39:46 +0000463.. option:: -objcmt-ns-nonatomic-iosonly
464
465Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
466
Richard Smith081ad4d2017-01-24 19:39:46 +0000467.. option:: -objcmt-returns-innerpointer-property
468
469Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
470
Richard Smith081ad4d2017-01-24 19:39:46 +0000471.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
472
473Only modify files with a filename contained in the provided directory path
474
Richard Smith081ad4d2017-01-24 19:39:46 +0000475.. option:: -object
476
Richard Smith081ad4d2017-01-24 19:39:46 +0000477.. option:: -p, --profile
478
Richard Smith081ad4d2017-01-24 19:39:46 +0000479.. option:: -pagezero\_size<arg>
480
Richard Smith081ad4d2017-01-24 19:39:46 +0000481.. option:: -pg
482
483Enable mcount instrumentation
484
Richard Smith081ad4d2017-01-24 19:39:46 +0000485.. option:: -pie
486
Richard Smith081ad4d2017-01-24 19:39:46 +0000487.. option:: -pipe, --pipe
488
489Use pipes between commands, when possible
490
Richard Smith081ad4d2017-01-24 19:39:46 +0000491.. option:: -prebind
492
Richard Smithb2c82a62017-01-27 01:54:42 +0000493.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000494.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000495.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000496
Richard Smith081ad4d2017-01-24 19:39:46 +0000497.. option:: -preload
498
Richard Smith081ad4d2017-01-24 19:39:46 +0000499.. option:: --print-diagnostic-categories
500
Vedant Kumar368540f2018-08-23 17:55:03 +0000501.. option:: -print-effective-triple, --print-effective-triple
502
503Print the effective target triple
504
Richard Smith081ad4d2017-01-24 19:39:46 +0000505.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
506
507Print the full library path of <file>
508
Richard Smith081ad4d2017-01-24 19:39:46 +0000509.. option:: -print-ivar-layout
510
511Enable Objective-C Ivar layout bitmap print trace
512
Richard Smith081ad4d2017-01-24 19:39:46 +0000513.. option:: -print-libgcc-file-name, --print-libgcc-file-name
514
515Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
516
Richard Smith081ad4d2017-01-24 19:39:46 +0000517.. option:: -print-multi-directory, --print-multi-directory
518
Richard Smith081ad4d2017-01-24 19:39:46 +0000519.. option:: -print-multi-lib, --print-multi-lib
520
Richard Smith081ad4d2017-01-24 19:39:46 +0000521.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
522
523Print the full program path of <name>
524
Richard Smith78e23fd2017-04-13 22:39:49 +0000525.. option:: -print-resource-dir, --print-resource-dir
526
527Print the resource directory pathname
528
Richard Smith081ad4d2017-01-24 19:39:46 +0000529.. option:: -print-search-dirs, --print-search-dirs
530
531Print the paths used for finding libraries and programs
532
Vedant Kumar368540f2018-08-23 17:55:03 +0000533.. option:: -print-target-triple, --print-target-triple
534
535Print the normalized target triple
536
Richard Smith081ad4d2017-01-24 19:39:46 +0000537.. option:: -private\_bundle
538
Richard Smith081ad4d2017-01-24 19:39:46 +0000539.. option:: -pthread, -no-pthread
540
541Support POSIX threads in generated code
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -pthreads
544
Richard Smith081ad4d2017-01-24 19:39:46 +0000545.. option:: -rdynamic
546
Richard Smith081ad4d2017-01-24 19:39:46 +0000547.. option:: -read\_only\_relocs <arg>
548
Richard Smith081ad4d2017-01-24 19:39:46 +0000549.. option:: -relocatable-pch, --relocatable-pch
550
551Whether to build a relocatable precompiled header
552
Richard Smith081ad4d2017-01-24 19:39:46 +0000553.. option:: -remap
554
Richard Smith081ad4d2017-01-24 19:39:46 +0000555.. option:: -rewrite-legacy-objc
556
557Rewrite Legacy Objective-C source to C++
558
Richard Smith081ad4d2017-01-24 19:39:46 +0000559.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
560
561Compiler runtime library to use
562
Richard Smith081ad4d2017-01-24 19:39:46 +0000563.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
564
565Save llvm statistics.
566
Richard Smith081ad4d2017-01-24 19:39:46 +0000567.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
568
569Save intermediate compilation results.
570
Richard Smith081ad4d2017-01-24 19:39:46 +0000571.. option:: -sectalign <arg1> <arg2> <arg3>
572
Richard Smith081ad4d2017-01-24 19:39:46 +0000573.. option:: -sectcreate <arg1> <arg2> <arg3>
574
Richard Smith081ad4d2017-01-24 19:39:46 +0000575.. option:: -sectobjectsymbols <arg1> <arg2>
576
Richard Smith081ad4d2017-01-24 19:39:46 +0000577.. option:: -sectorder <arg1> <arg2> <arg3>
578
Richard Smith081ad4d2017-01-24 19:39:46 +0000579.. option:: -seg1addr<arg>
580
Richard Smith081ad4d2017-01-24 19:39:46 +0000581.. option:: -seg\_addr\_table <arg>
582
Richard Smithb2c82a62017-01-27 01:54:42 +0000583.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000584.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000585.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000586
Richard Smith081ad4d2017-01-24 19:39:46 +0000587.. option:: -segaddr <arg1> <arg2>
588
Richard Smith081ad4d2017-01-24 19:39:46 +0000589.. option:: -segcreate <arg1> <arg2> <arg3>
590
Richard Smith081ad4d2017-01-24 19:39:46 +0000591.. option:: -seglinkedit
592
Richard Smith081ad4d2017-01-24 19:39:46 +0000593.. option:: -segprot <arg1> <arg2> <arg3>
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -segs\_read\_<arg>
596
Richard Smithb2c82a62017-01-27 01:54:42 +0000597.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000598.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000599.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000600
Richard Smithb2c82a62017-01-27 01:54:42 +0000601.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000602.. option:: -segs\_read\_write\_addr <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:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
606
607Serialize compiler diagnostics to a file
608
Richard Smith081ad4d2017-01-24 19:39:46 +0000609.. option:: -shared, --shared
610
Richard Smith081ad4d2017-01-24 19:39:46 +0000611.. option:: -shared-libgcc
612
Craig Topper16418662017-11-20 18:07:43 +0000613.. option:: -shared-libsan, -shared-libasan
614
Vedant Kumar368540f2018-08-23 17:55:03 +0000615Dynamically link the sanitizer runtime
616
Richard Smith081ad4d2017-01-24 19:39:46 +0000617.. option:: -single\_module
618
Richard Smith081ad4d2017-01-24 19:39:46 +0000619.. option:: -specs=<arg>, --specs=<arg>
620
Richard Smith081ad4d2017-01-24 19:39:46 +0000621.. option:: -static, --static
622
Richard Smith081ad4d2017-01-24 19:39:46 +0000623.. option:: -static-libgcc
624
Craig Topper16418662017-11-20 18:07:43 +0000625.. option:: -static-libsan
626
Vedant Kumar368540f2018-08-23 17:55:03 +0000627Statically link the sanitizer runtime
628
Richard Smith081ad4d2017-01-24 19:39:46 +0000629.. option:: -static-libstdc++
630
Craig Topper9624beb2020-03-10 11:08:19 -0700631.. option:: -static-openmp
632
633Use the static host OpenMP runtime while linking.
634
635.. option:: -static-pie
636
Richard Smith081ad4d2017-01-24 19:39:46 +0000637.. option:: -std-default=<arg>
638
Richard Smith081ad4d2017-01-24 19:39:46 +0000639.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
640
641C++ standard library to use
642
Richard Smith081ad4d2017-01-24 19:39:46 +0000643.. option:: -sub\_library<arg>
644
Richard Smithb2c82a62017-01-27 01:54:42 +0000645.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000646.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000647.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000648
Richard Smith081ad4d2017-01-24 19:39:46 +0000649.. option:: --sysroot=<arg>, --sysroot <arg>
650
Richard Smith081ad4d2017-01-24 19:39:46 +0000651.. option:: --target-help
652
Richard Smith081ad4d2017-01-24 19:39:46 +0000653.. option:: --target=<arg>, -target <arg>
654
655Generate code for the given target
656
Richard Smith081ad4d2017-01-24 19:39:46 +0000657.. option:: -time
658
659Time individual commands
660
Richard Smith081ad4d2017-01-24 19:39:46 +0000661.. option:: -traditional, --traditional
662
Richard Smith081ad4d2017-01-24 19:39:46 +0000663.. option:: -traditional-cpp, --traditional-cpp
664
665Enable some traditional CPP emulation
666
Richard Smith081ad4d2017-01-24 19:39:46 +0000667.. option:: -twolevel\_namespace
668
Richard Smithb2c82a62017-01-27 01:54:42 +0000669.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000670.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000671.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000672
Richard Smith081ad4d2017-01-24 19:39:46 +0000673.. option:: -umbrella <arg>
674
Richard Smith081ad4d2017-01-24 19:39:46 +0000675.. option:: -unexported\_symbols\_list <arg>
676
Craig Topper9624beb2020-03-10 11:08:19 -0700677.. option:: -unwindlib=<arg>, --unwindlib=<arg>
678
679Unwind library to use
680
Richard Smith081ad4d2017-01-24 19:39:46 +0000681.. option:: -v, --verbose
682
683Show commands to run and use verbose output
684
Richard Smith081ad4d2017-01-24 19:39:46 +0000685.. option:: --verify-debug-info
686
687Verify the binary representation of debug output
688
Richard Smith081ad4d2017-01-24 19:39:46 +0000689.. option:: --version
690
Craig Topper16418662017-11-20 18:07:43 +0000691Print version information
692
Richard Smith081ad4d2017-01-24 19:39:46 +0000693.. option:: -w, --no-warnings
694
695Suppress all warnings
696
Richard Smith081ad4d2017-01-24 19:39:46 +0000697.. option:: -weak-l<arg>
698
Richard Smith081ad4d2017-01-24 19:39:46 +0000699.. option:: -weak\_framework <arg>
700
Richard Smithb2c82a62017-01-27 01:54:42 +0000701.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000702.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000703.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000704
Richard Smithb2c82a62017-01-27 01:54:42 +0000705.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000706.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000707.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000708
Richard Smith081ad4d2017-01-24 19:39:46 +0000709.. option:: -whatsloaded
710
Richard Smith081ad4d2017-01-24 19:39:46 +0000711.. option:: -whyload
712
Richard Smith081ad4d2017-01-24 19:39:46 +0000713.. option:: -working-directory<arg>, -working-directory=<arg>
714
715Resolve file paths relative to the specified directory
716
Richard Smith081ad4d2017-01-24 19:39:46 +0000717.. option:: -x<language>, --language <arg>, --language=<arg>
718
719Treat subsequent input files as having type <language>
720
Richard Smith081ad4d2017-01-24 19:39:46 +0000721.. option:: -y<arg>
722
723Actions
724=======
725The action to perform on the input.
726
Richard Smith081ad4d2017-01-24 19:39:46 +0000727.. option:: -E, --preprocess
728
729Only run the preprocessor
730
Richard Smith081ad4d2017-01-24 19:39:46 +0000731.. option:: -S, --assemble
732
733Only run preprocess and compilation steps
734
Richard Smithc5b2e002017-01-27 02:08:37 +0000735.. option:: -c, --compile
736
737Only run preprocess, compile, and assemble steps
738
Craig Topper9624beb2020-03-10 11:08:19 -0700739.. option:: -emit-interface-stubs
740
741Generate Inteface Stub Files.
742
Richard Smith081ad4d2017-01-24 19:39:46 +0000743.. option:: -emit-llvm
744
745Use the LLVM representation for assembler and object files
746
Craig Topper9624beb2020-03-10 11:08:19 -0700747.. option:: -emit-merged-ifs
748
749Generate Interface Stub Files, emit merged text not binary.
750
Richard Smith081ad4d2017-01-24 19:39:46 +0000751.. option:: -fsyntax-only
752
Richard Smith081ad4d2017-01-24 19:39:46 +0000753.. option:: -module-file-info
754
755Provide information about a particular module file
756
Richard Smith081ad4d2017-01-24 19:39:46 +0000757.. option:: --precompile
758
759Only precompile the input
760
Richard Smith081ad4d2017-01-24 19:39:46 +0000761.. option:: -rewrite-objc
762
763Rewrite Objective-C source to C++
764
Richard Smith081ad4d2017-01-24 19:39:46 +0000765.. option:: -verify-pch
766
767Load and verify that a pre-compiled header file is not stale
768
769Compilation flags
770=================
771
772Flags controlling the behavior of Clang during compilation. These flags have
773no effect during actions that do not perform compilation.
774
Richard Smithc5b2e002017-01-27 02:08:37 +0000775.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000776
Richard Smithc5b2e002017-01-27 02:08:37 +0000777Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000778
Richard Smith081ad4d2017-01-24 19:39:46 +0000779.. option:: -Xclang <arg>
780
781Pass <arg> to the clang compiler
782
Boris Kolpackovb150d242017-08-30 09:15:53 +0000783.. option:: -fclang-abi-compat=<version>
784
785Attempt to match the ABI of Clang <version>
786
Richard Smith081ad4d2017-01-24 19:39:46 +0000787.. option:: -fcomment-block-commands=<arg>,<arg2>...
788
789Treat each comma separated argument in <arg> as a documentation comment block command
790
Vedant Kumar368540f2018-08-23 17:55:03 +0000791.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
792
793Require member pointer base types to be complete if they would be significant under the Microsoft ABI
794
795.. option:: -fcrash-diagnostics-dir=<arg>
796
Richard Smith081ad4d2017-01-24 19:39:46 +0000797.. option:: -fdeclspec, -fno-declspec
798
799Allow \_\_declspec as a keyword
800
Richard Smith081ad4d2017-01-24 19:39:46 +0000801.. option:: -fdepfile-entry=<arg>
802
Richard Smith081ad4d2017-01-24 19:39:46 +0000803.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
804
Richard Smith081ad4d2017-01-24 19:39:46 +0000805.. option:: -fdiagnostics-format=<arg>
806
Richard Smith081ad4d2017-01-24 19:39:46 +0000807.. option:: -fdiagnostics-parseable-fixits
808
809Print fix-its in machine parseable form
810
Richard Smith081ad4d2017-01-24 19:39:46 +0000811.. option:: -fdiagnostics-print-source-range-info
812
813Print source range spans in numeric form
814
Richard Smith081ad4d2017-01-24 19:39:46 +0000815.. option:: -fdiagnostics-show-category=<arg>
816
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000817.. option:: -fdiscard-value-names, -fno-discard-value-names
818
819Discard value names in LLVM IR
820
821.. option:: -fexperimental-isel, -fno-experimental-isel
822
823Enables the experimental global instruction selector
824
Richard Smith081ad4d2017-01-24 19:39:46 +0000825.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
826
827Enables an experimental new pass manager in LLVM.
828
Craig Topper16418662017-11-20 18:07:43 +0000829.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
830
Vedant Kumar368540f2018-08-23 17:55:03 +0000831Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Craig Topper16418662017-11-20 18:07:43 +0000832
Richard Smith081ad4d2017-01-24 19:39:46 +0000833.. option:: -finline-functions, -fno-inline-functions
834
835Inline suitable functions
836
Richard Smith081ad4d2017-01-24 19:39:46 +0000837.. option:: -finline-hint-functions
838
839Inline functions which are (explicitly or implicitly) marked inline
840
Richard Smith081ad4d2017-01-24 19:39:46 +0000841.. option:: -fno-crash-diagnostics
842
Richard Smith78e23fd2017-04-13 22:39:49 +0000843Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
844
Richard Smith081ad4d2017-01-24 19:39:46 +0000845.. option:: -fno-sanitize-blacklist
846
847Don't use blacklist file for sanitizers
848
Richard Smith081ad4d2017-01-24 19:39:46 +0000849.. option:: -fparse-all-comments
850
Craig Topper9624beb2020-03-10 11:08:19 -0700851.. option:: -frecord-command-line, -fno-record-command-line, -frecord-gcc-switches
Scott Linderde6beb02018-12-14 15:38:15 +0000852
Richard Smith081ad4d2017-01-24 19:39:46 +0000853.. option:: -fsanitize-address-field-padding=<arg>
854
855Level of field padding for AddressSanitizer
856
Craig Topperd23254a2017-07-20 17:52:48 +0000857.. option:: -fsanitize-address-globals-dead-stripping
858
859Enable linker dead stripping of globals in AddressSanitizer
860
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000861.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000862
Craig Topper9624beb2020-03-10 11:08:19 -0700863Enable poisoning array cookies when using custom operator new\[\] in AddressSanitizer
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000864
Richard Smith081ad4d2017-01-24 19:39:46 +0000865.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
866
867Enable use-after-scope detection in AddressSanitizer
868
Craig Topper9624beb2020-03-10 11:08:19 -0700869.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
870
871Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
872
Richard Smith081ad4d2017-01-24 19:39:46 +0000873.. option:: -fsanitize-blacklist=<arg>
874
875Path to blacklist file for sanitizers
876
Craig Topper9624beb2020-03-10 11:08:19 -0700877.. option:: -fsanitize-cfi-canonical-jump-tables, -fno-sanitize-cfi-canonical-jump-tables
878
879Make the jump table addresses canonical in the symbol table
880
Richard Smith081ad4d2017-01-24 19:39:46 +0000881.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
882
883Enable control flow integrity (CFI) checks for cross-DSO calls.
884
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000885.. option:: -fsanitize-cfi-icall-generalize-pointers
886
Craig Topper16418662017-11-20 18:07:43 +0000887Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000888
Richard Smith081ad4d2017-01-24 19:39:46 +0000889.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
890
891Specify the type of coverage instrumentation for Sanitizers
892
Craig Topper9624beb2020-03-10 11:08:19 -0700893.. option:: -fsanitize-hwaddress-abi=<arg>
894
895Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.
896
897.. option:: -fsanitize-link-c++-runtime, -fno-sanitize-link-c++-runtime
898
899.. option:: -fsanitize-link-runtime, -fno-sanitize-link-runtime
Richard Smith081ad4d2017-01-24 19:39:46 +0000900
Richard Smith081ad4d2017-01-24 19:39:46 +0000901.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
902
903Enable origins tracking in MemorySanitizer
904
Richard Smithb2c82a62017-01-27 01:54:42 +0000905.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000906.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000907.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000908
909Enable origins tracking in MemorySanitizer
910
Craig Topper16418662017-11-20 18:07:43 +0000911.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000912
913Enable use-after-destroy detection in MemorySanitizer
914
Boris Kolpackovb150d242017-08-30 09:15:53 +0000915.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
916
Richard Smith081ad4d2017-01-24 19:39:46 +0000917.. option:: -fsanitize-recover, -fno-sanitize-recover
918
Richard Smithb2c82a62017-01-27 01:54:42 +0000919.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000920.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +0000921.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000922
923Enable recovery for specified sanitizers
924
Richard Smith081ad4d2017-01-24 19:39:46 +0000925.. option:: -fsanitize-stats, -fno-sanitize-stats
926
927Enable sanitizer statistics gathering.
928
Richard Smith081ad4d2017-01-24 19:39:46 +0000929.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
930
931Enable atomic operations instrumentation in ThreadSanitizer (default)
932
Richard Smith081ad4d2017-01-24 19:39:46 +0000933.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
934
935Enable function entry/exit instrumentation in ThreadSanitizer (default)
936
Richard Smith081ad4d2017-01-24 19:39:46 +0000937.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
938
939Enable memory access instrumentation in ThreadSanitizer (default)
940
Richard Smith081ad4d2017-01-24 19:39:46 +0000941.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
942
943Enable trapping for specified sanitizers
944
Richard Smith081ad4d2017-01-24 19:39:46 +0000945.. option:: -fsanitize-undefined-strip-path-components=<number>
946
947Strip (or keep only, if negative) a given number of path components when emitting check metadata.
948
Richard Smith081ad4d2017-01-24 19:39:46 +0000949.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
950
Richard Smith081ad4d2017-01-24 19:39:46 +0000951.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
952
953Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
954
Vedant Kumar368540f2018-08-23 17:55:03 +0000955.. option:: -moutline, -mno-outline
956
957Enable function outlining (AArch64 only)
958
Richard Smith081ad4d2017-01-24 19:39:46 +0000959.. option:: --param <arg>, --param=<arg>
960
Craig Topper9624beb2020-03-10 11:08:19 -0700961.. option:: -print-supported-cpus, --print-supported-cpus, -mcpu=?, -mtune=?
962
963Print supported cpu models for the given target (if target is not specified, it will print the supported cpus for the default target)
964
Richard Smith081ad4d2017-01-24 19:39:46 +0000965.. option:: -std=<arg>, --std=<arg>, --std <arg>
966
967Language standard to compile for
968
Richard Smithc5b2e002017-01-27 02:08:37 +0000969Preprocessor flags
970~~~~~~~~~~~~~~~~~~
971
972Flags controlling the behavior of the Clang preprocessor.
973
974.. option:: -C, --comments
975
976Include comments in preprocessed output
977
978.. option:: -CC, --comments-in-macros
979
980Include comments from within macros in preprocessed output
981
982.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
983
984Define <macro> to <value> (or 1 if <value> omitted)
985
986.. option:: -H, --trace-includes
987
988Show header includes and nesting depth
989
990.. option:: -P, --no-line-commands
991
992Disable linemarker output in -E mode
993
994.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
995
996Undefine macro <macro>
997
998.. option:: -Wp,<arg>,<arg2>...
999
1000Pass the comma separated arguments in <arg> to the preprocessor
1001
1002.. option:: -Xpreprocessor <arg>
1003
1004Pass <arg> to the preprocessor
1005
Craig Topper9624beb2020-03-10 11:08:19 -07001006.. option:: -fmacro-prefix-map=<arg>
1007
1008remap file source paths in predefined preprocessor macros
1009
Richard Smith081ad4d2017-01-24 19:39:46 +00001010Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +00001011-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001012
1013Flags controlling how ``#include``\s are resolved to files.
1014
Richard Smithc5b2e002017-01-27 02:08:37 +00001015.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00001016
1017Add directory to include search path
1018
Richard Smith081ad4d2017-01-24 19:39:46 +00001019.. option:: -I-, --include-barrier
1020
Richard Smithc5b2e002017-01-27 02:08:37 +00001021Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
1022
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001023.. option:: --cuda-path-ignore-env
1024
1025Ignore environment variables to detect CUDA installation
1026
Richard Smith081ad4d2017-01-24 19:39:46 +00001027.. option:: --cuda-path=<arg>
1028
1029CUDA installation path
1030
Richard Smith081ad4d2017-01-24 19:39:46 +00001031.. option:: -cxx-isystem<directory>
1032
1033Add directory to the C++ SYSTEM include search path
1034
Richard Smith081ad4d2017-01-24 19:39:46 +00001035.. option:: -fbuild-session-file=<file>
1036
1037Use the last modification time of <file> as the build session timestamp
1038
Richard Smith081ad4d2017-01-24 19:39:46 +00001039.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
1040
1041Time when the current build session started
1042
Boris Kolpackovb150d242017-08-30 09:15:53 +00001043.. option:: -fmodule-file=\[<name>=\]<file>
1044
1045Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
1046
Richard Smith081ad4d2017-01-24 19:39:46 +00001047.. option:: -fmodules-cache-path=<directory>
1048
1049Specify the module cache path
1050
Richard Smith081ad4d2017-01-24 19:39:46 +00001051.. option:: -fmodules-disable-diagnostic-validation
1052
1053Disable validation of the diagnostic options when loading the module
1054
Richard Smith081ad4d2017-01-24 19:39:46 +00001055.. option:: -fmodules-prune-after=<seconds>
1056
1057Specify the interval (in seconds) after which a module file will be considered unused
1058
Richard Smith081ad4d2017-01-24 19:39:46 +00001059.. option:: -fmodules-prune-interval=<seconds>
1060
1061Specify the interval (in seconds) between attempts to prune the module cache
1062
Richard Smith081ad4d2017-01-24 19:39:46 +00001063.. option:: -fmodules-user-build-path <directory>
1064
1065Specify the module user build path
1066
Richard Smith081ad4d2017-01-24 19:39:46 +00001067.. option:: -fmodules-validate-once-per-build-session
1068
1069Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1070
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001071.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
Richard Smith081ad4d2017-01-24 19:39:46 +00001072
1073Validate the system headers that a module depends on when loading the module
1074
Richard Smith081ad4d2017-01-24 19:39:46 +00001075.. option:: -fprebuilt-module-path=<directory>
1076
1077Specify the prebuilt module path
1078
Richard Smith081ad4d2017-01-24 19:39:46 +00001079.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1080
1081Add directory to AFTER include search path
1082
Richard Smith081ad4d2017-01-24 19:39:46 +00001083.. option:: -iframework<arg>
1084
1085Add directory to SYSTEM framework search path
1086
Richard Smith78e23fd2017-04-13 22:39:49 +00001087.. option:: -iframeworkwithsysroot<directory>
1088
1089Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1090
Richard Smith081ad4d2017-01-24 19:39:46 +00001091.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1092
1093Include macros from file before parsing
1094
Richard Smith081ad4d2017-01-24 19:39:46 +00001095.. option:: -include<file>, --include<file>, --include=<arg>
1096
1097Include file before parsing
1098
Richard Smith081ad4d2017-01-24 19:39:46 +00001099.. option:: -include-pch <file>
1100
1101Include precompiled header file
1102
Richard Smith081ad4d2017-01-24 19:39:46 +00001103.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1104
1105Set the -iwithprefix/-iwithprefixbefore prefix
1106
Richard Smith081ad4d2017-01-24 19:39:46 +00001107.. option:: -iquote<directory>
1108
1109Add directory to QUOTE include search path
1110
Richard Smith081ad4d2017-01-24 19:39:46 +00001111.. option:: -isysroot<dir>
1112
1113Set the system root directory (usually /)
1114
Richard Smith081ad4d2017-01-24 19:39:46 +00001115.. option:: -isystem<directory>
1116
1117Add directory to SYSTEM include search path
1118
Richard Smith081ad4d2017-01-24 19:39:46 +00001119.. option:: -isystem-after<directory>
1120
1121Add directory to end of the SYSTEM include search path
1122
Richard Smith081ad4d2017-01-24 19:39:46 +00001123.. option:: -ivfsoverlay<arg>
1124
1125Overlay the virtual filesystem described by file over the real file system
1126
Richard Smith081ad4d2017-01-24 19:39:46 +00001127.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1128
1129Set directory to SYSTEM include search path with prefix
1130
Richard Smith081ad4d2017-01-24 19:39:46 +00001131.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1132
1133Set directory to include search path with prefix
1134
Richard Smith081ad4d2017-01-24 19:39:46 +00001135.. option:: -iwithsysroot<directory>
1136
1137Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1138
Craig Topper9624beb2020-03-10 11:08:19 -07001139.. option:: --libomptarget-nvptx-path=<arg>
1140
1141Path to libomptarget-nvptx libraries
1142
Richard Smith081ad4d2017-01-24 19:39:46 +00001143.. option:: --ptxas-path=<arg>
1144
1145Path to ptxas (used for compiling CUDA code)
1146
Craig Topper9624beb2020-03-10 11:08:19 -07001147.. program:: clang1
1148.. option:: -stdlib++-isystem<directory>
1149.. program:: clang
1150
1151Use directory as the C++ standard library include path
1152
Richard Smith081ad4d2017-01-24 19:39:46 +00001153.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1154
1155Treat all #include paths starting with <prefix> as including a system header.
1156
1157Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +00001158--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001159
1160Flags controlling generation of a dependency file for ``make``-like build
1161systems.
1162
Richard Smith081ad4d2017-01-24 19:39:46 +00001163.. option:: -M, --dependencies
1164
1165Like -MD, but also implies -E and writes to stdout by default
1166
Richard Smith081ad4d2017-01-24 19:39:46 +00001167.. option:: -MD, --write-dependencies
1168
1169Write a depfile containing user and system headers
1170
Richard Smith081ad4d2017-01-24 19:39:46 +00001171.. option:: -MF<file>
1172
1173Write depfile output from -MMD, -MD, -MM, or -M to <file>
1174
Richard Smith081ad4d2017-01-24 19:39:46 +00001175.. option:: -MG, --print-missing-file-dependencies
1176
1177Add missing headers to depfile
1178
Richard Smith081ad4d2017-01-24 19:39:46 +00001179.. option:: -MJ<arg>
1180
1181Write a compilation database entry per input
1182
Richard Smith081ad4d2017-01-24 19:39:46 +00001183.. option:: -MM, --user-dependencies
1184
1185Like -MMD, but also implies -E and writes to stdout by default
1186
Richard Smith081ad4d2017-01-24 19:39:46 +00001187.. option:: -MMD, --write-user-dependencies
1188
1189Write a depfile containing user headers
1190
Richard Smith081ad4d2017-01-24 19:39:46 +00001191.. option:: -MP
1192
1193Create phony target for each dependency (other than main file)
1194
Richard Smith081ad4d2017-01-24 19:39:46 +00001195.. option:: -MQ<arg>
1196
1197Specify name of main file output to quote in depfile
1198
Richard Smith081ad4d2017-01-24 19:39:46 +00001199.. option:: -MT<arg>
1200
1201Specify name of main file output in depfile
1202
Richard Smith081ad4d2017-01-24 19:39:46 +00001203.. option:: -MV
1204
1205Use NMake/Jom format for the depfile
1206
1207Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001208--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001209
1210Flags allowing the state of the preprocessor to be dumped in various ways.
1211
Richard Smith081ad4d2017-01-24 19:39:46 +00001212.. option:: -d
1213
Richard Smithb2c82a62017-01-27 01:54:42 +00001214.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001215.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001216.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001217
Richard Smith081ad4d2017-01-24 19:39:46 +00001218.. option:: -dD
1219
1220Print macro definitions in -E mode in addition to normal output
1221
Richard Smith081ad4d2017-01-24 19:39:46 +00001222.. option:: -dI
1223
1224Print include directives in -E mode in addition to normal output
1225
Richard Smith081ad4d2017-01-24 19:39:46 +00001226.. option:: -dM
1227
1228Print macro definitions in -E mode instead of normal output
1229
1230Diagnostic flags
1231~~~~~~~~~~~~~~~~
1232
1233Flags controlling which warnings, errors, and remarks Clang will generate.
1234See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1235
Richard Smith081ad4d2017-01-24 19:39:46 +00001236.. option:: -R<remark>
1237
1238Enable the specified remark
1239
Richard Smith081ad4d2017-01-24 19:39:46 +00001240.. option:: -Rpass-analysis=<arg>
1241
1242Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1243
Richard Smith081ad4d2017-01-24 19:39:46 +00001244.. option:: -Rpass-missed=<arg>
1245
1246Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1247
Richard Smith081ad4d2017-01-24 19:39:46 +00001248.. option:: -Rpass=<arg>
1249
1250Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1251
Richard Smith081ad4d2017-01-24 19:39:46 +00001252.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1253
1254Enable the specified warning
1255
Richard Smith081ad4d2017-01-24 19:39:46 +00001256.. option:: -Wdeprecated, -Wno-deprecated
1257
Richard Smithc5b2e002017-01-27 02:08:37 +00001258Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001259
Richard Smith081ad4d2017-01-24 19:39:46 +00001260.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262Target-independent compilation options
1263~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001264.. option:: -Wframe-larger-than=<arg>
1265
Richard Smith081ad4d2017-01-24 19:39:46 +00001266.. option:: -fPIC, -fno-PIC
1267
Richard Smith081ad4d2017-01-24 19:39:46 +00001268.. option:: -fPIE, -fno-PIE
1269
Richard Smith081ad4d2017-01-24 19:39:46 +00001270.. option:: -faccess-control, -fno-access-control
1271
Vedant Kumar368540f2018-08-23 17:55:03 +00001272.. option:: -faddrsig, -fno-addrsig
1273
1274Emit an address-significance table
1275
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001276.. option:: -falign-functions, -fno-align-functions
1277
1278.. program:: clang1
1279.. option:: -falign-functions=<arg>
1280.. program:: clang
1281
Richard Smithb2c82a62017-01-27 01:54:42 +00001282.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001283.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001284.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001285
1286Enable C++17 aligned allocation functions
1287
Craig Topperd23254a2017-07-20 17:52:48 +00001288.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1289
1290Treat editor placeholders as valid source code
1291
Richard Smith081ad4d2017-01-24 19:39:46 +00001292.. option:: -fallow-unsupported
1293
Richard Smith78e23fd2017-04-13 22:39:49 +00001294.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -fansi-escape-codes
1297
1298Use ANSI escape codes for diagnostics
1299
Richard Smith081ad4d2017-01-24 19:39:46 +00001300.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1301
1302Use Apple's kernel extensions ABI
1303
Craig Topper9624beb2020-03-10 11:08:19 -07001304.. option:: -fapple-link-rtlib
1305
1306Force linking the clang builtins runtime library
1307
Richard Smith081ad4d2017-01-24 19:39:46 +00001308.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1309
1310Enable Apple gcc-compatible #pragma pack handling
1311
Richard Smith081ad4d2017-01-24 19:39:46 +00001312.. option:: -fapplication-extension, -fno-application-extension
1313
1314Restrict code to those available for App Extensions
1315
Richard Smith081ad4d2017-01-24 19:39:46 +00001316.. option:: -fasm, -fno-asm
1317
Richard Smith081ad4d2017-01-24 19:39:46 +00001318.. option:: -fasm-blocks, -fno-asm-blocks
1319
Richard Smith081ad4d2017-01-24 19:39:46 +00001320.. option:: -fassociative-math, -fno-associative-math
1321
Richard Smith081ad4d2017-01-24 19:39:46 +00001322.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1323
Richard Smith081ad4d2017-01-24 19:39:46 +00001324.. option:: -fast
1325
Richard Smith081ad4d2017-01-24 19:39:46 +00001326.. option:: -fastcp
1327
Richard Smith081ad4d2017-01-24 19:39:46 +00001328.. option:: -fastf
1329
Richard Smith081ad4d2017-01-24 19:39:46 +00001330.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1331
Richard Smith081ad4d2017-01-24 19:39:46 +00001332.. option:: -fautolink, -fno-autolink
1333
Sriraman Tallame0bca462020-06-01 23:17:29 -07001334.. option:: -fbasic-block-sections=labels, -fbasic-block-sections=all, -fbasic-block-sections=list=<arg>, -fbasic-block-sections=none
1335
1336Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.
1337
Richard Smith081ad4d2017-01-24 19:39:46 +00001338.. option:: -fblocks, -fno-blocks
1339
1340Enable the 'blocks' language feature
1341
Richard Smith081ad4d2017-01-24 19:39:46 +00001342.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1343
Richard Smith081ad4d2017-01-24 19:39:46 +00001344.. option:: -fborland-extensions, -fno-borland-extensions
1345
1346Accept non-standard constructs supported by the Borland compiler
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fbracket-depth=<arg>
1349
Richard Smith081ad4d2017-01-24 19:39:46 +00001350.. option:: -fbuiltin, -fno-builtin
1351
Richard Smith081ad4d2017-01-24 19:39:46 +00001352.. option:: -fbuiltin-module-map
1353
1354Load the clang builtins module map file.
1355
Vedant Kumar368540f2018-08-23 17:55:03 +00001356.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1357
1358Enable C++ static destructor registration (the default)
1359
Richard Smith081ad4d2017-01-24 19:39:46 +00001360.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1361
Craig Topper596527b2018-01-23 18:40:15 +00001362.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1363
1364Instrument control-flow architecture protection. Options: return, branch, full, none.
1365
Craig Topper9624beb2020-03-10 11:08:19 -07001366.. option:: -fcf-runtime-abi=<arg>
1367
Vedant Kumar368540f2018-08-23 17:55:03 +00001368.. option:: -fchar8\_t, -fno-char8\_t
1369
1370Enable C++ builtin type char8\_t
1371
Richard Smith081ad4d2017-01-24 19:39:46 +00001372.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1373
Richard Smith081ad4d2017-01-24 19:39:46 +00001374.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1375
1376Use colors in diagnostics
1377
Richard Smith081ad4d2017-01-24 19:39:46 +00001378.. option:: -fcommon, -fno-common
1379
Craig Topper9624beb2020-03-10 11:08:19 -07001380Place uninitialized global variables in a common block
Sjoerd Meijer3d9a0442020-03-09 19:25:24 +00001381
Richard Smith081ad4d2017-01-24 19:39:46 +00001382.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1383
Richard Smith081ad4d2017-01-24 19:39:46 +00001384.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1385
Richard Smith081ad4d2017-01-24 19:39:46 +00001386.. option:: -fconstant-string-class=<arg>
1387
Richard Smith081ad4d2017-01-24 19:39:46 +00001388.. option:: -fconstexpr-backtrace-limit=<arg>
1389
Richard Smith081ad4d2017-01-24 19:39:46 +00001390.. option:: -fconstexpr-depth=<arg>
1391
Richard Smith081ad4d2017-01-24 19:39:46 +00001392.. option:: -fconstexpr-steps=<arg>
1393
Craig Topper9624beb2020-03-10 11:08:19 -07001394.. option:: -fconvergent-functions
1395
1396Assume functions may be convergent
1397
Richard Smith081ad4d2017-01-24 19:39:46 +00001398.. option:: -fcoroutines-ts, -fno-coroutines-ts
1399
1400Enable support for the C++ Coroutines TS
1401
Richard Smith081ad4d2017-01-24 19:39:46 +00001402.. option:: -fcoverage-mapping, -fno-coverage-mapping
1403
1404Generate coverage mapping to enable code coverage analysis
1405
Richard Smith081ad4d2017-01-24 19:39:46 +00001406.. option:: -fcreate-profile
1407
Craig Topper9624beb2020-03-10 11:08:19 -07001408.. option:: -fcs-profile-generate
1409
1410Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1411
1412.. program:: clang1
1413.. option:: -fcs-profile-generate=<directory>
1414.. program:: clang
1415
1416Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1417
Richard Smith081ad4d2017-01-24 19:39:46 +00001418.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1419
1420Enable C++ exceptions
1421
Richard Smith081ad4d2017-01-24 19:39:46 +00001422.. option:: -fcxx-modules, -fno-cxx-modules
1423
Richard Smith081ad4d2017-01-24 19:39:46 +00001424.. option:: -fdata-sections, -fno-data-sections
1425
Craig Topper9624beb2020-03-10 11:08:19 -07001426Place each data in its own section
1427
1428.. option:: -fdebug-compilation-dir <arg>, -fdebug-compilation-dir=<arg>
1429
1430The compilation directory to embed in the debug info.
1431
1432.. option:: -fdebug-default-version=<arg>
1433
1434Default DWARF version to use, if a -g option caused DWARF debug info to be produced
Richard Smith081ad4d2017-01-24 19:39:46 +00001435
Richard Smith081ad4d2017-01-24 19:39:46 +00001436.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1437
1438Emit extra debug info to make sample profile more accurate.
1439
Richard Smith78e23fd2017-04-13 22:39:49 +00001440.. option:: -fdebug-macro, -fno-debug-macro
1441
1442Emit macro debug information
1443
Richard Smith081ad4d2017-01-24 19:39:46 +00001444.. option:: -fdebug-pass-arguments
1445
Richard Smith081ad4d2017-01-24 19:39:46 +00001446.. option:: -fdebug-pass-structure
1447
Richard Smith081ad4d2017-01-24 19:39:46 +00001448.. option:: -fdebug-prefix-map=<arg>
1449
1450remap file source paths in debug info
1451
Craig Topper9624beb2020-03-10 11:08:19 -07001452.. option:: -fdebug-ranges-base-address, -fno-debug-ranges-base-address
1453
1454Use DWARF base address selection entries in debug\_ranges
1455
Richard Smith081ad4d2017-01-24 19:39:46 +00001456.. option:: -fdebug-types-section, -fno-debug-types-section
1457
1458Place debug types in their own section (ELF Only)
1459
Richard Smith081ad4d2017-01-24 19:39:46 +00001460.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1461
1462Parse templated function definitions at the end of the translation unit
1463
Vedant Kumar368540f2018-08-23 17:55:03 +00001464.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1465
1466Treat usage of null pointers as undefined behavior.
1467
Richard Smith081ad4d2017-01-24 19:39:46 +00001468.. option:: -fdenormal-fp-math=<arg>
1469
Richard Smith081ad4d2017-01-24 19:39:46 +00001470.. option:: -fdiagnostics-absolute-paths
1471
1472Print absolute paths in diagnostics
1473
Richard Smith081ad4d2017-01-24 19:39:46 +00001474.. option:: -fdiagnostics-color, -fno-diagnostics-color
1475
Richard Smithb2c82a62017-01-27 01:54:42 +00001476.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001477.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001478.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001479
Craig Topperd23254a2017-07-20 17:52:48 +00001480.. option:: -fdiagnostics-hotness-threshold=<number>
1481
1482Prevent optimization remarks from being output if they do not have at least this profile count
1483
Richard Smith081ad4d2017-01-24 19:39:46 +00001484.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1485
1486Enable profile hotness information in diagnostic line
1487
Richard Smith081ad4d2017-01-24 19:39:46 +00001488.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1489
1490Display include stacks for diagnostic notes
1491
Richard Smith081ad4d2017-01-24 19:39:46 +00001492.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1493
1494Print option name with mappable diagnostics
1495
Richard Smith081ad4d2017-01-24 19:39:46 +00001496.. option:: -fdiagnostics-show-template-tree
1497
1498Print a template comparison tree for differing templates
1499
Vedant Kumar368540f2018-08-23 17:55:03 +00001500.. option:: -fdigraphs, -fno-digraphs
1501
1502Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1503
Richard Smith081ad4d2017-01-24 19:39:46 +00001504.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1505
1506Allow '$' in identifiers
1507
Craig Topper16418662017-11-20 18:07:43 +00001508.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1509
1510Enable '\[\[\]\]' attributes in all C and C++ language modes
1511
Richard Smith081ad4d2017-01-24 19:39:46 +00001512.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1513
Craig Topper188252d2017-12-11 21:09:16 +00001514.. option:: -fdwarf-exceptions
1515
1516Use DWARF style exceptions
1517
Richard Smith081ad4d2017-01-24 19:39:46 +00001518.. option:: -felide-constructors, -fno-elide-constructors
1519
Richard Smith081ad4d2017-01-24 19:39:46 +00001520.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1521
Richard Smith081ad4d2017-01-24 19:39:46 +00001522.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1523
1524Embed LLVM bitcode (option: off, all, bitcode, marker)
1525
Richard Smith081ad4d2017-01-24 19:39:46 +00001526.. option:: -femit-all-decls
1527
1528Emit all declarations, even if unused
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -femulated-tls, -fno-emulated-tls
1531
1532Use emutls functions to access thread\_local variables
1533
Richard Smith081ad4d2017-01-24 19:39:46 +00001534.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1535
Richard Smith081ad4d2017-01-24 19:39:46 +00001536.. option:: -ferror-limit=<arg>
1537
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001538.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1539
Richard Smith081ad4d2017-01-24 19:39:46 +00001540.. option:: -fexceptions, -fno-exceptions
1541
1542Enable support for exception handling
1543
Richard Smith081ad4d2017-01-24 19:39:46 +00001544.. option:: -fexec-charset=<arg>
1545
Craig Topper9624beb2020-03-10 11:08:19 -07001546.. option:: -fexperimental-new-constant-interpreter
1547
1548Enable the experimental new constant interpreter
1549
Richard Smith081ad4d2017-01-24 19:39:46 +00001550.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1551
Richard Smith081ad4d2017-01-24 19:39:46 +00001552.. option:: -ffast-math, -fno-fast-math
1553
1554Allow aggressive, lossy floating-point optimizations
1555
Craig Topper9624beb2020-03-10 11:08:19 -07001556.. option:: -ffile-prefix-map=<arg>
1557
1558remap file source paths in debug info and predefined preprocessor macros
1559
Richard Smith081ad4d2017-01-24 19:39:46 +00001560.. option:: -ffinite-math-only, -fno-finite-math-only
1561
Vedant Kumar368540f2018-08-23 17:55:03 +00001562.. option:: -ffixed-point, -fno-fixed-point
1563
1564Enable fixed point types
1565
Richard Smith081ad4d2017-01-24 19:39:46 +00001566.. option:: -ffor-scope, -fno-for-scope
1567
Craig Topper9624beb2020-03-10 11:08:19 -07001568.. option:: -fforce-dwarf-frame, -fno-force-dwarf-frame
1569
1570Always emit a debug frame section
1571
Vedant Kumar368540f2018-08-23 17:55:03 +00001572.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1573
1574Emits more virtual tables to improve devirtualization
1575
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001576.. option:: -fforce-enable-int128, -fno-force-enable-int128
1577
1578Enable support for int128\_t type
1579
Richard Smith081ad4d2017-01-24 19:39:46 +00001580.. option:: -ffp-contract=<arg>
1581
Craig Topper9624beb2020-03-10 11:08:19 -07001582Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma) \| off (never fuse). Default is 'fast' for CUDA/HIP and 'on' otherwise.
1583
1584.. option:: -ffp-exception-behavior=<arg>
1585
1586Specifies the exception behavior of floating-point operations.
1587
1588.. option:: -ffp-model=<arg>
1589
1590Controls the semantics of floating-point calculations.
Richard Smith081ad4d2017-01-24 19:39:46 +00001591
Richard Smith081ad4d2017-01-24 19:39:46 +00001592.. option:: -ffreestanding
1593
1594Assert that the compilation takes place in a freestanding environment
1595
Richard Smith081ad4d2017-01-24 19:39:46 +00001596.. option:: -ffunction-sections, -fno-function-sections
1597
Craig Topper9624beb2020-03-10 11:08:19 -07001598Place each function in its own section
Richard Smith081ad4d2017-01-24 19:39:46 +00001599
Richard Smith081ad4d2017-01-24 19:39:46 +00001600.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1601
Richard Smith081ad4d2017-01-24 19:39:46 +00001602.. option:: -fgnu-keywords, -fno-gnu-keywords
1603
1604Allow GNU-extension keywords regardless of language standard
1605
Richard Smith081ad4d2017-01-24 19:39:46 +00001606.. option:: -fgnu-runtime
1607
1608Generate output compatible with the standard GNU Objective-C runtime
1609
Richard Smith081ad4d2017-01-24 19:39:46 +00001610.. option:: -fgnu89-inline, -fno-gnu89-inline
1611
1612Use the gnu89 inline semantics
1613
Craig Topper9624beb2020-03-10 11:08:19 -07001614.. option:: -fgnuc-version=<arg>
1615
1616Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1619
Richard Smith081ad4d2017-01-24 19:39:46 +00001620.. option:: -fhonor-nans, -fno-honor-nans
1621
Richard Smith081ad4d2017-01-24 19:39:46 +00001622.. option:: -fhosted
1623
Craig Topper9624beb2020-03-10 11:08:19 -07001624.. option:: -fignore-exceptions
1625
1626Enable support for ignoring exception handling constructs
1627
Richard Smith081ad4d2017-01-24 19:39:46 +00001628.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1629
1630Implicitly search the file system for module map files.
1631
Richard Smith081ad4d2017-01-24 19:39:46 +00001632.. option:: -fimplicit-modules, -fno-implicit-modules
1633
Richard Smith081ad4d2017-01-24 19:39:46 +00001634.. option:: -finput-charset=<arg>
1635
Craig Topper188252d2017-12-11 21:09:16 +00001636.. option:: -finstrument-function-entry-bare
1637
1638Instrument function entry only, after inlining, without arguments to the instrumentation call
1639
Richard Smith081ad4d2017-01-24 19:39:46 +00001640.. option:: -finstrument-functions
1641
1642Generate calls to instrument function entry and exit
1643
Craig Topper16418662017-11-20 18:07:43 +00001644.. option:: -finstrument-functions-after-inlining
1645
1646Like -finstrument-functions, but insert the calls after inlining
1647
Richard Smith081ad4d2017-01-24 19:39:46 +00001648.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1649
1650Enable the integrated assembler
1651
Craig Topper9624beb2020-03-10 11:08:19 -07001652.. option:: -fintegrated-cc1, -fno-integrated-cc1
1653
1654Run cc1 in-process
1655
Richard Smith081ad4d2017-01-24 19:39:46 +00001656.. option:: -fjump-tables, -fno-jump-tables
1657
Vedant Kumar368540f2018-08-23 17:55:03 +00001658.. option:: -fkeep-static-consts
1659
1660Keep static const variables even if unused
1661
Craig Topper9624beb2020-03-10 11:08:19 -07001662.. option:: -flax-vector-conversions=<arg>, -flax-vector-conversions (equivalent to -flax-vector-conversions=integer), -fno-lax-vector-conversions (equivalent to -flax-vector-conversions=none)
1663
1664Enable implicit vector bit-casts
Richard Smith081ad4d2017-01-24 19:39:46 +00001665
Richard Smith081ad4d2017-01-24 19:39:46 +00001666.. option:: -flimited-precision=<arg>
1667
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -flto, -fno-lto
1669
1670Enable LTO in 'full' mode
1671
Richard Smith081ad4d2017-01-24 19:39:46 +00001672.. option:: -flto-jobs=<arg>
1673
1674Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1675
Richard Smithb2c82a62017-01-27 01:54:42 +00001676.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001677.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001678.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001679
1680Set LTO mode to either 'full' or 'thin'
1681
Richard Smith081ad4d2017-01-24 19:39:46 +00001682.. option:: -fmacro-backtrace-limit=<arg>
1683
Richard Smith081ad4d2017-01-24 19:39:46 +00001684.. option:: -fmath-errno, -fno-math-errno
1685
1686Require math functions to indicate errors by setting errno
1687
Craig Topper9624beb2020-03-10 11:08:19 -07001688.. option:: -fmax-tokens=<arg>
1689
1690Max total number of preprocessed tokens for -Wmax-tokens.
1691
Richard Smith081ad4d2017-01-24 19:39:46 +00001692.. option:: -fmax-type-align=<arg>
1693
1694Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1695
Richard Smith081ad4d2017-01-24 19:39:46 +00001696.. option:: -fmerge-all-constants, -fno-merge-all-constants
1697
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001698Allow merging of constants
1699
Richard Smith081ad4d2017-01-24 19:39:46 +00001700.. option:: -fmessage-length=<arg>
1701
Richard Smith081ad4d2017-01-24 19:39:46 +00001702.. option:: -fmodule-file-deps, -fno-module-file-deps
1703
Richard Smith081ad4d2017-01-24 19:39:46 +00001704.. option:: -fmodule-map-file=<file>
1705
1706Load this module map file
1707
Richard Smith081ad4d2017-01-24 19:39:46 +00001708.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1709
1710Specify the name of the module to build
1711
Richard Smith081ad4d2017-01-24 19:39:46 +00001712.. option:: -fmodules, -fno-modules
1713
1714Enable the 'modules' language feature
1715
Richard Smith081ad4d2017-01-24 19:39:46 +00001716.. option:: -fmodules-decluse, -fno-modules-decluse
1717
1718Require declaration of modules used within a module
1719
Richard Smith081ad4d2017-01-24 19:39:46 +00001720.. option:: -fmodules-ignore-macro=<arg>
1721
1722Ignore the definition of the given macro when building and loading modules
1723
Richard Smith081ad4d2017-01-24 19:39:46 +00001724.. option:: -fmodules-search-all, -fno-modules-search-all
1725
1726Search even non-imported modules to resolve references
1727
Richard Smith081ad4d2017-01-24 19:39:46 +00001728.. option:: -fmodules-strict-decluse
1729
1730Like -fmodules-decluse but requires all headers to be in modules
1731
Richard Smith081ad4d2017-01-24 19:39:46 +00001732.. option:: -fmodules-ts
1733
1734Enable support for the C++ Modules TS
1735
Craig Topper9624beb2020-03-10 11:08:19 -07001736.. option:: -fmodules-validate-input-files-content
1737
1738Validate PCM input files based on content if mtime differs
1739
Richard Smith081ad4d2017-01-24 19:39:46 +00001740.. option:: -fms-compatibility, -fno-ms-compatibility
1741
1742Enable full Microsoft Visual C++ compatibility
1743
Richard Smith081ad4d2017-01-24 19:39:46 +00001744.. option:: -fms-compatibility-version=<arg>
1745
1746Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1747
Richard Smith081ad4d2017-01-24 19:39:46 +00001748.. option:: -fms-extensions, -fno-ms-extensions
1749
1750Accept some non-standard constructs supported by the Microsoft compiler
1751
Richard Smith081ad4d2017-01-24 19:39:46 +00001752.. option:: -fms-memptr-rep=<arg>
1753
Craig Topper9624beb2020-03-10 11:08:19 -07001754.. option:: -fms-volatile
Richard Smith081ad4d2017-01-24 19:39:46 +00001755
Richard Smith081ad4d2017-01-24 19:39:46 +00001756.. option:: -fmsc-version=<arg>
1757
1758Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1759
Richard Smith081ad4d2017-01-24 19:39:46 +00001760.. option:: -fmudflap
1761
Richard Smith081ad4d2017-01-24 19:39:46 +00001762.. option:: -fmudflapth
1763
Richard Smith081ad4d2017-01-24 19:39:46 +00001764.. option:: -fnested-functions
1765
Richard Smith081ad4d2017-01-24 19:39:46 +00001766.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1767
1768Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1769
Richard Smith081ad4d2017-01-24 19:39:46 +00001770.. option:: -fnext-runtime
1771
Richard Smith081ad4d2017-01-24 19:39:46 +00001772.. option:: -fno-builtin-<arg>
1773
1774Disable implicit builtin knowledge of a specific function
1775
Richard Smith081ad4d2017-01-24 19:39:46 +00001776.. option:: -fno-elide-type
1777
1778Do not elide types when printing diagnostics
1779
Richard Smith081ad4d2017-01-24 19:39:46 +00001780.. option:: -fno-max-type-align
1781
Richard Smith081ad4d2017-01-24 19:39:46 +00001782.. option:: -fno-operator-names
1783
1784Do not treat C++ operator name keywords as synonyms for operators
1785
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001786.. option:: -fno-rtti-data
1787
1788Control emission of RTTI data
1789
Richard Smith081ad4d2017-01-24 19:39:46 +00001790.. option:: -fno-strict-modules-decluse
1791
Craig Topper9624beb2020-03-10 11:08:19 -07001792.. option:: -fno-temp-file
1793
1794Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes
1795
1796.. option:: -fno-virtual-function\_elimination
1797
Richard Smith081ad4d2017-01-24 19:39:46 +00001798.. option:: -fno-working-directory
1799
Craig Topper9624beb2020-03-10 11:08:19 -07001800.. option:: -fno\_modules-validate-input-files-content
1801
1802.. program:: clang1
1803.. option:: -fno\_pch-validate-input-files-content
1804.. program:: clang
1805
1806.. option:: -fnostack-clash-protection
1807
1808Disable stack clash protection
1809
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001810.. option:: -fnoxray-link-deps
1811
Richard Smith081ad4d2017-01-24 19:39:46 +00001812.. option:: -fobjc-abi-version=<arg>
1813
Richard Smith081ad4d2017-01-24 19:39:46 +00001814.. option:: -fobjc-arc, -fno-objc-arc
1815
1816Synthesize retain and release calls for Objective-C pointers
1817
Richard Smith081ad4d2017-01-24 19:39:46 +00001818.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1819
1820Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1821
Craig Topper9624beb2020-03-10 11:08:19 -07001822.. option:: -fobjc-convert-messages-to-runtime-calls, -fno-objc-convert-messages-to-runtime-calls
1823
Richard Smith081ad4d2017-01-24 19:39:46 +00001824.. option:: -fobjc-exceptions, -fno-objc-exceptions
1825
1826Enable Objective-C exceptions
1827
Richard Smith081ad4d2017-01-24 19:39:46 +00001828.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1829
Richard Smith081ad4d2017-01-24 19:39:46 +00001830.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1831
Richard Smith081ad4d2017-01-24 19:39:46 +00001832.. option:: -fobjc-link-runtime
1833
Richard Smith081ad4d2017-01-24 19:39:46 +00001834.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1835
Richard Smith081ad4d2017-01-24 19:39:46 +00001836.. option:: -fobjc-nonfragile-abi-version=<arg>
1837
Richard Smith081ad4d2017-01-24 19:39:46 +00001838.. option:: -fobjc-runtime=<arg>
1839
1840Specify the target Objective-C runtime kind and version
1841
Richard Smith081ad4d2017-01-24 19:39:46 +00001842.. option:: -fobjc-sender-dependent-dispatch
1843
Richard Smith081ad4d2017-01-24 19:39:46 +00001844.. option:: -fobjc-weak, -fno-objc-weak
1845
1846Enable ARC-style weak references in Objective-C
1847
Richard Smith081ad4d2017-01-24 19:39:46 +00001848.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1849
Richard Smith081ad4d2017-01-24 19:39:46 +00001850.. option:: -fopenmp, -fno-openmp
1851
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001852Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001853
Craig Topper287c8012018-01-03 18:29:12 +00001854.. option:: -fopenmp-simd, -fno-openmp-simd
1855
1856Emit OpenMP code only for SIMD-based constructs.
1857
Richard Smith081ad4d2017-01-24 19:39:46 +00001858.. option:: -fopenmp-version=<arg>
1859
Richard Smithb2c82a62017-01-27 01:54:42 +00001860.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001861.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001862.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001863
Richard Smith081ad4d2017-01-24 19:39:46 +00001864.. option:: -foperator-arrow-depth=<arg>
1865
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001866.. option:: -foptimization-record-file=<file>
Richard Smith081ad4d2017-01-24 19:39:46 +00001867
Craig Topper9624beb2020-03-10 11:08:19 -07001868Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch <arch> options.
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001869
1870.. option:: -foptimization-record-passes=<regex>
1871
1872Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)
Richard Smith081ad4d2017-01-24 19:39:46 +00001873
Richard Smith081ad4d2017-01-24 19:39:46 +00001874.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1875
Craig Topper9624beb2020-03-10 11:08:19 -07001876.. option:: -forder-file-instrumentation
1877
1878Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1879
Richard Smith081ad4d2017-01-24 19:39:46 +00001880.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1881
Richard Smith081ad4d2017-01-24 19:39:46 +00001882.. option:: -fpack-struct, -fno-pack-struct
1883
Richard Smithb2c82a62017-01-27 01:54:42 +00001884.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001885.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001886.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001887
1888Specify the default maximum struct packing alignment
1889
Richard Smith081ad4d2017-01-24 19:39:46 +00001890.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1891
1892Recognize and construct Pascal-style string literals
1893
Craig Topper9624beb2020-03-10 11:08:19 -07001894.. option:: -fpass-plugin=<dsopath>
1895
1896Load pass plugin from a dynamic shared object file (only with new pass manager).
1897
1898.. option:: -fpatchable-function-entry=<N,M>
1899
1900Generate M NOPs before function entry and N-M NOPs after function entry
1901
Richard Smith081ad4d2017-01-24 19:39:46 +00001902.. option:: -fpcc-struct-return
1903
1904Override the default ABI to return all structs on the stack
1905
Richard Smith081ad4d2017-01-24 19:39:46 +00001906.. option:: -fpch-preprocess
1907
Craig Topper9624beb2020-03-10 11:08:19 -07001908.. option:: -fpch-validate-input-files-content
1909
1910Validate PCH input files based on content if mtime differs
1911
Richard Smith081ad4d2017-01-24 19:39:46 +00001912.. option:: -fpic, -fno-pic
1913
Richard Smith081ad4d2017-01-24 19:39:46 +00001914.. option:: -fpie, -fno-pie
1915
Craig Topper16418662017-11-20 18:07:43 +00001916.. option:: -fplt, -fno-plt
1917
1918Use the PLT to make function calls
1919
Richard Smith081ad4d2017-01-24 19:39:46 +00001920.. option:: -fplugin=<dsopath>
1921
1922Load the named plugin (dynamic shared object)
1923
Richard Smith081ad4d2017-01-24 19:39:46 +00001924.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1925
Richard Smith081ad4d2017-01-24 19:39:46 +00001926.. option:: -fprofile-arcs, -fno-profile-arcs
1927
Richard Smith081ad4d2017-01-24 19:39:46 +00001928.. option:: -fprofile-dir=<arg>
1929
Craig Topper9624beb2020-03-10 11:08:19 -07001930.. option:: -fprofile-exclude-files=<arg>
1931
1932Instrument only functions from files where names don't match all the regexes separated by a semi-colon
1933
1934.. option:: -fprofile-filter-files=<arg>
1935
1936Instrument only functions from files where names match any regex separated by a semi-colon
1937
Richard Smith081ad4d2017-01-24 19:39:46 +00001938.. option:: -fprofile-generate, -fno-profile-generate
1939
1940Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1941
Richard Smithb2c82a62017-01-27 01:54:42 +00001942.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001943.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001944.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001945
1946Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1947
Richard Smith081ad4d2017-01-24 19:39:46 +00001948.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1949
1950Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1951
Richard Smithb2c82a62017-01-27 01:54:42 +00001952.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001953.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001954.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001955
1956Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1957
Richard Smith081ad4d2017-01-24 19:39:46 +00001958.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1959
Richard Smithb2c82a62017-01-27 01:54:42 +00001960.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001961.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001962.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001963
1964Use instrumentation data for profile-guided optimization
1965
Craig Topper9624beb2020-03-10 11:08:19 -07001966.. option:: -fprofile-remapping-file=<file>, -fprofile-remapping-file <arg>
1967
1968Use the remappings described in <file> to match the profile data against names in the program
1969
Boris Kolpackovb150d242017-08-30 09:15:53 +00001970.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1971
1972Specifies that the sample profile is accurate. If the sample
1973 profile is accurate, callsites without profile samples are marked
1974 as cold. Otherwise, treat callsites without profile samples as if
1975 we have no profile
1976
Richard Smith78e23fd2017-04-13 22:39:49 +00001977.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1978
1979.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001980.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001981.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001982
1983Enable sample-based profile guided optimizations
1984
Richard Smithb2c82a62017-01-27 01:54:42 +00001985.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001986.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001987.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001988
1989Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1990
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -freciprocal-math, -fno-reciprocal-math
1992
1993Allow division operations to be reassociated
1994
Richard Smith081ad4d2017-01-24 19:39:46 +00001995.. option:: -freg-struct-return
1996
1997Override the default ABI to return small structs in registers
1998
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001999.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
2000
2001Use atexit or \_\_cxa\_atexit to register global destructors
2002
Richard Smith081ad4d2017-01-24 19:39:46 +00002003.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
2004
2005Enable C++17 relaxed template template argument matching
2006
Richard Smith081ad4d2017-01-24 19:39:46 +00002007.. option:: -freroll-loops, -fno-reroll-loops
2008
2009Turn on loop reroller
2010
Richard Smith081ad4d2017-01-24 19:39:46 +00002011.. option:: -fretain-comments-from-system-headers
2012
Craig Topperd23254a2017-07-20 17:52:48 +00002013.. option:: -frewrite-imports, -fno-rewrite-imports
2014
Richard Smith081ad4d2017-01-24 19:39:46 +00002015.. option:: -frewrite-includes, -fno-rewrite-includes
2016
Richard Smith081ad4d2017-01-24 19:39:46 +00002017.. option:: -frewrite-map-file <arg>
2018
Richard Smithb2c82a62017-01-27 01:54:42 +00002019.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002020.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002021.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002022
Richard Smith081ad4d2017-01-24 19:39:46 +00002023.. option:: -fropi, -fno-ropi
2024
Craig Topper9624beb2020-03-10 11:08:19 -07002025.. option:: -frounding-math, -fno-rounding-math
2026
Richard Smith081ad4d2017-01-24 19:39:46 +00002027.. option:: -frtti, -fno-rtti
2028
Richard Smith081ad4d2017-01-24 19:39:46 +00002029.. option:: -frwpi, -fno-rwpi
2030
Richard Smith081ad4d2017-01-24 19:39:46 +00002031.. option:: -fsave-optimization-record, -fno-save-optimization-record
2032
2033Generate a YAML optimization record file
2034
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08002035.. program:: clang1
2036.. option:: -fsave-optimization-record=<format>
2037.. program:: clang
2038
Craig Topper9624beb2020-03-10 11:08:19 -07002039Generate an optimization record file in a specific format
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08002040
Craig Topper188252d2017-12-11 21:09:16 +00002041.. option:: -fseh-exceptions
2042
2043Use SEH style exceptions
2044
Craig Topper9624beb2020-03-10 11:08:19 -07002045.. option:: -fsemantic-interposition, -fno-semantic-interposition
2046
Richard Smith081ad4d2017-01-24 19:39:46 +00002047.. option:: -fshort-enums, -fno-short-enums
2048
2049Allocate to an enum type only as many bytes as it needs for the declared range of possible values
2050
Richard Smith081ad4d2017-01-24 19:39:46 +00002051.. option:: -fshort-wchar, -fno-short-wchar
2052
2053Force wchar\_t to be a short unsigned int
2054
Richard Smith081ad4d2017-01-24 19:39:46 +00002055.. option:: -fshow-column, -fno-show-column
2056
Richard Smith081ad4d2017-01-24 19:39:46 +00002057.. option:: -fshow-overloads=<arg>
2058
2059Which overload candidates to show when overload resolution fails: best\|all; defaults to all
2060
Richard Smith081ad4d2017-01-24 19:39:46 +00002061.. option:: -fshow-source-location, -fno-show-source-location
2062
Richard Smith081ad4d2017-01-24 19:39:46 +00002063.. option:: -fsignaling-math, -fno-signaling-math
2064
Richard Smith081ad4d2017-01-24 19:39:46 +00002065.. option:: -fsigned-bitfields
2066
Richard Smith081ad4d2017-01-24 19:39:46 +00002067.. option:: -fsigned-char, -fno-signed-char, --signed-char
2068
Richard Smith081ad4d2017-01-24 19:39:46 +00002069.. option:: -fsigned-zeros, -fno-signed-zeros
2070
Richard Smith081ad4d2017-01-24 19:39:46 +00002071.. option:: -fsized-deallocation, -fno-sized-deallocation
2072
2073Enable C++14 sized global deallocation functions
2074
Richard Smith081ad4d2017-01-24 19:39:46 +00002075.. option:: -fsjlj-exceptions
2076
2077Use SjLj style exceptions
2078
Richard Smith081ad4d2017-01-24 19:39:46 +00002079.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
2080
2081Enable the superword-level parallelism vectorization passes
2082
Richard Smith081ad4d2017-01-24 19:39:46 +00002083.. option:: -fspell-checking, -fno-spell-checking
2084
Richard Smith081ad4d2017-01-24 19:39:46 +00002085.. option:: -fspell-checking-limit=<arg>
2086
Richard Smith081ad4d2017-01-24 19:39:46 +00002087.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
2088
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002089Provide 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 +00002090
Craig Topper9624beb2020-03-10 11:08:19 -07002091.. option:: -fsplit-lto-unit, -fno-split-lto-unit
2092
2093Enables splitting of the LTO unit.
2094
Richard Smith081ad4d2017-01-24 19:39:46 +00002095.. option:: -fsplit-stack
2096
Craig Topper9624beb2020-03-10 11:08:19 -07002097.. option:: -fstack-clash-protection
2098
2099Enable stack clash protection
2100
Richard Smith081ad4d2017-01-24 19:39:46 +00002101.. option:: -fstack-protector, -fno-stack-protector
2102
Craig Topper9624beb2020-03-10 11:08:19 -07002103Enable stack protectors for some functions vulnerable to stack smashing. This uses a loose heuristic which considers functions vulnerable if they contain a char (or 8bit integer) array or constant sized calls to alloca, which are of greater size than ssp-buffer-size (default: 8 bytes). All variable sized calls to alloca are considered vulnerable
Richard Smith081ad4d2017-01-24 19:39:46 +00002104
Richard Smith081ad4d2017-01-24 19:39:46 +00002105.. option:: -fstack-protector-all
2106
Craig Topper9624beb2020-03-10 11:08:19 -07002107Enable stack protectors for all functions
Richard Smith081ad4d2017-01-24 19:39:46 +00002108
Richard Smith081ad4d2017-01-24 19:39:46 +00002109.. option:: -fstack-protector-strong
2110
Craig Topper9624beb2020-03-10 11:08:19 -07002111Enable stack protectors for some functions vulnerable to stack smashing. Compared to -fstack-protector, this uses a stronger heuristic that includes functions containing arrays of any size (and any type), as well as any calls to alloca or the taking of an address from a local variable
Richard Smith081ad4d2017-01-24 19:39:46 +00002112
Craig Topper596527b2018-01-23 18:40:15 +00002113.. option:: -fstack-size-section, -fno-stack-size-section
2114
2115Emit section containing metadata on function stack sizes
2116
Richard Smith081ad4d2017-01-24 19:39:46 +00002117.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
2118
2119Emit full debug info for all types used by the program
2120
Richard Smith081ad4d2017-01-24 19:39:46 +00002121.. option:: -fstrict-aliasing, -fno-strict-aliasing
2122
Richard Smith081ad4d2017-01-24 19:39:46 +00002123.. option:: -fstrict-enums, -fno-strict-enums
2124
2125Enable optimizations based on the strict definition of an enum's value range
2126
Vedant Kumar368540f2018-08-23 17:55:03 +00002127.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
2128
2129Assume that overflowing float-to-int casts are undefined (default)
2130
Richard Smith081ad4d2017-01-24 19:39:46 +00002131.. option:: -fstrict-overflow, -fno-strict-overflow
2132
Richard Smith081ad4d2017-01-24 19:39:46 +00002133.. option:: -fstrict-return, -fno-strict-return
2134
Richard Smith78e23fd2017-04-13 22:39:49 +00002135Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00002136
Richard Smith081ad4d2017-01-24 19:39:46 +00002137.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
2138
2139Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
2140
Richard Smith081ad4d2017-01-24 19:39:46 +00002141.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
2142
Craig Topper9624beb2020-03-10 11:08:19 -07002143.. option:: -fsymbol-partition=<arg>
2144
Richard Smith081ad4d2017-01-24 19:39:46 +00002145.. option:: -ftabstop=<arg>
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -ftemplate-backtrace-limit=<arg>
2148
Richard Smith081ad4d2017-01-24 19:39:46 +00002149.. option:: -ftemplate-depth-<arg>
2150
Richard Smith081ad4d2017-01-24 19:39:46 +00002151.. option:: -ftemplate-depth=<arg>
2152
Richard Smith081ad4d2017-01-24 19:39:46 +00002153.. option:: -ftest-coverage
2154
Craig Topper9624beb2020-03-10 11:08:19 -07002155.. option:: -fthin-link-bitcode=<arg>
2156
2157Write minimized bitcode to <file> for the ThinLTO thin link only
2158
Richard Smith081ad4d2017-01-24 19:39:46 +00002159.. option:: -fthinlto-index=<arg>
2160
2161Perform ThinLTO importing using provided function summary index
2162
Richard Smith081ad4d2017-01-24 19:39:46 +00002163.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
2164
Richard Smith081ad4d2017-01-24 19:39:46 +00002165.. option:: -ftime-report
2166
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00002167.. option:: -ftime-trace
2168
Craig Topper9624beb2020-03-10 11:08:19 -07002169
2170Turn on time profiler. Generates JSON file based on output filename. Results
2171can be analyzed with chrome://tracing or `Speedscope App
2172<https://www.speedscope.app>`_ for flamegraph visualization.
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00002173
2174.. option:: -ftime-trace-granularity=<arg>
2175
2176Minimum time granularity (in microseconds) traced by time profiler
2177
Richard Smith081ad4d2017-01-24 19:39:46 +00002178.. option:: -ftls-model=<arg>
2179
Richard Smith081ad4d2017-01-24 19:39:46 +00002180.. option:: -ftrap-function=<arg>
2181
2182Issue call to specified function rather than a trap instruction
2183
Richard Smith081ad4d2017-01-24 19:39:46 +00002184.. option:: -ftrapping-math, -fno-trapping-math
2185
Richard Smith081ad4d2017-01-24 19:39:46 +00002186.. option:: -ftrapv
2187
2188Trap on integer overflow
2189
Richard Smith081ad4d2017-01-24 19:39:46 +00002190.. option:: -ftrapv-handler <arg>
2191
Richard Smithb2c82a62017-01-27 01:54:42 +00002192.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002193.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00002194.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002195
2196Specify the function to be called on overflow
2197
Richard Smith081ad4d2017-01-24 19:39:46 +00002198.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
2199
2200Process trigraph sequences
2201
Craig Topper9624beb2020-03-10 11:08:19 -07002202.. option:: -ftrivial-auto-var-init=<arg>
2203
2204Initialize trivial automatic stack variables: uninitialized (default) \| pattern
2205
Richard Smith081ad4d2017-01-24 19:39:46 +00002206.. option:: -funique-section-names, -fno-unique-section-names
2207
Craig Topper9624beb2020-03-10 11:08:19 -07002208Use unique names for text and data sections
Richard Smith081ad4d2017-01-24 19:39:46 +00002209
Richard Smith081ad4d2017-01-24 19:39:46 +00002210.. option:: -funit-at-a-time, -fno-unit-at-a-time
2211
Richard Smith081ad4d2017-01-24 19:39:46 +00002212.. option:: -funroll-loops, -fno-unroll-loops
2213
2214Turn on loop unroller
2215
Richard Smith081ad4d2017-01-24 19:39:46 +00002216.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
2217
Richard Smith081ad4d2017-01-24 19:39:46 +00002218.. option:: -funsigned-bitfields
2219
Richard Smith081ad4d2017-01-24 19:39:46 +00002220.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
2221
Richard Smith081ad4d2017-01-24 19:39:46 +00002222.. option:: -funwind-tables, -fno-unwind-tables
2223
Richard Smith081ad4d2017-01-24 19:39:46 +00002224.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
2225
Richard Smith081ad4d2017-01-24 19:39:46 +00002226.. option:: -fuse-init-array, -fno-use-init-array
2227
2228Use .init\_array instead of .ctors
2229
Richard Smith081ad4d2017-01-24 19:39:46 +00002230.. option:: -fuse-ld=<arg>
2231
Richard Smith081ad4d2017-01-24 19:39:46 +00002232.. option:: -fuse-line-directives, -fno-use-line-directives
2233
Craig Topper9624beb2020-03-10 11:08:19 -07002234.. option:: -fvalidate-ast-input-files-content
2235
2236Compute and store the hash of input files used to build an AST. Files with mismatching mtime's are considered valid if both contents is identical
2237
Richard Smith081ad4d2017-01-24 19:39:46 +00002238.. option:: -fveclib=<arg>
2239
2240Use the given vector functions library
2241
Richard Smith081ad4d2017-01-24 19:39:46 +00002242.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2243
2244Enable the loop vectorization passes
2245
Craig Topper9624beb2020-03-10 11:08:19 -07002246.. option:: -fverbose-asm, -dA, -fno-verbose-asm
2247
2248.. option:: -fvirtual-function-elimination
2249
2250Enables dead virtual function elimination optimization. Requires -flto=full
2251
2252.. option:: -fvisibility-global-new-delete-hidden
2253
2254Give global C++ operator new and delete declarations hidden visibility
Richard Smith081ad4d2017-01-24 19:39:46 +00002255
Richard Smith081ad4d2017-01-24 19:39:46 +00002256.. option:: -fvisibility-inlines-hidden
2257
Fangrui Songdf81b972018-07-19 22:45:41 +00002258Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00002259
Richard Smith081ad4d2017-01-24 19:39:46 +00002260.. option:: -fvisibility-ms-compat
2261
2262Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2263
Richard Smith081ad4d2017-01-24 19:39:46 +00002264.. option:: -fvisibility=<arg>
2265
2266Set the default symbol visibility for all global declarations
2267
Craig Topper9624beb2020-03-10 11:08:19 -07002268.. option:: -fwasm-exceptions
2269
2270Use WebAssembly style exceptions
2271
Richard Smith081ad4d2017-01-24 19:39:46 +00002272.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2273
2274Enables whole-program vtable optimization. Requires -flto
2275
Richard Smith081ad4d2017-01-24 19:39:46 +00002276.. option:: -fwrapv, -fno-wrapv
2277
2278Treat signed integer overflow as two's complement
2279
Richard Smith081ad4d2017-01-24 19:39:46 +00002280.. option:: -fwritable-strings
2281
2282Store string literals as writable data
2283
Craig Topper188252d2017-12-11 21:09:16 +00002284.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2285
2286Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2287
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002288.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2289
2290Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2291
Richard Smith78e23fd2017-04-13 22:39:49 +00002292.. option:: -fxray-always-instrument=<arg>
2293
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002294DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2295
2296.. option:: -fxray-attr-list=<arg>
2297
2298Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002299
Craig Topper9624beb2020-03-10 11:08:19 -07002300.. option:: -fxray-ignore-loops, -fno-xray-ignore-loops
2301
2302Don't instrument functions with loops unless they also meet the minimum function size
2303
Richard Smith081ad4d2017-01-24 19:39:46 +00002304.. option:: -fxray-instruction-threshold<arg>
2305
Richard Smithb2c82a62017-01-27 01:54:42 +00002306.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002307.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002308.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002309
2310Sets the minimum function size to instrument with XRay
2311
Richard Smith081ad4d2017-01-24 19:39:46 +00002312.. option:: -fxray-instrument, -fno-xray-instrument
2313
2314Generate XRay instrumentation sleds on function entry and exit
2315
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002316.. option:: -fxray-instrumentation-bundle=<arg>
2317
Craig Topper9624beb2020-03-10 11:08:19 -07002318Select which XRay instrumentation points to emit. Options: all, none, function-entry, function-exit, function, custom. Default is 'all'. 'function' includes both 'function-entry' and 'function-exit'.
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002319
2320.. option:: -fxray-link-deps
2321
2322Tells clang to add the link dependencies for XRay.
2323
2324.. option:: -fxray-modes=<arg>
2325
2326List of modes to link in by default into XRay instrumented binaries.
2327
Richard Smith78e23fd2017-04-13 22:39:49 +00002328.. option:: -fxray-never-instrument=<arg>
2329
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002330DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002331
Richard Smith081ad4d2017-01-24 19:39:46 +00002332.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2333
Richard Smith081ad4d2017-01-24 19:39:46 +00002334.. option:: -fzvector, -fno-zvector, -mzvector
2335
2336Enable System z vector language extension
2337
Richard Smith081ad4d2017-01-24 19:39:46 +00002338.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2339
Richard Smith081ad4d2017-01-24 19:39:46 +00002340.. option:: -pedantic-errors, --pedantic-errors
2341
2342OpenCL flags
2343------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002344.. option:: -cl-denorms-are-zero
2345
2346OpenCL only. Allow denormals to be flushed to zero.
2347
Richard Smith081ad4d2017-01-24 19:39:46 +00002348.. option:: -cl-fast-relaxed-math
2349
2350OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2351
Richard Smith081ad4d2017-01-24 19:39:46 +00002352.. option:: -cl-finite-math-only
2353
2354OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2355
Richard Smith081ad4d2017-01-24 19:39:46 +00002356.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2357
2358OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2359
Richard Smith081ad4d2017-01-24 19:39:46 +00002360.. option:: -cl-kernel-arg-info
2361
2362OpenCL only. Generate kernel argument metadata.
2363
Richard Smith081ad4d2017-01-24 19:39:46 +00002364.. option:: -cl-mad-enable
2365
2366OpenCL only. Allow use of less precise MAD computations in the generated binary.
2367
Richard Smith081ad4d2017-01-24 19:39:46 +00002368.. option:: -cl-no-signed-zeros
2369
2370OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2371
Richard Smith081ad4d2017-01-24 19:39:46 +00002372.. option:: -cl-opt-disable
2373
2374OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2375
Richard Smith081ad4d2017-01-24 19:39:46 +00002376.. option:: -cl-single-precision-constant
2377
2378OpenCL only. Treat double precision floating-point constant as single precision constant.
2379
Richard Smith081ad4d2017-01-24 19:39:46 +00002380.. option:: -cl-std=<arg>
2381
2382OpenCL language standard to compile for.
2383
Richard Smith081ad4d2017-01-24 19:39:46 +00002384.. option:: -cl-strict-aliasing
2385
2386OpenCL only. This option is added for compatibility with OpenCL 1.0.
2387
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002388.. option:: -cl-uniform-work-group-size
2389
2390OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2391
Richard Smith081ad4d2017-01-24 19:39:46 +00002392.. option:: -cl-unsafe-math-optimizations
2393
2394OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2395
Craig Topper9624beb2020-03-10 11:08:19 -07002396SYCL flags
2397----------
2398.. option:: -fsycl, -fno-sycl
2399
2400Enable SYCL kernels compilation for device
2401
2402.. option:: -sycl-std=<arg>
2403
2404SYCL language standard to compile for.
2405
Richard Smith081ad4d2017-01-24 19:39:46 +00002406Target-dependent compilation options
2407~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00002408.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2409
Shiva Chenfc375262020-03-10 10:23:59 +08002410Put objects of at most <size> bytes into small data section (MIPS / Hexagon / RISCV)
Richard Smithc5b2e002017-01-27 02:08:37 +00002411
Craig Topper9624beb2020-03-10 11:08:19 -07002412.. option:: -ffixed-x1
2413
2414Reserve the 1 register (AArch64/RISC-V only)
2415
2416.. option:: -ffixed-x10
2417
2418Reserve the 10 register (AArch64/RISC-V only)
2419
2420.. option:: -ffixed-x11
2421
2422Reserve the 11 register (AArch64/RISC-V only)
2423
2424.. option:: -ffixed-x12
2425
2426Reserve the 12 register (AArch64/RISC-V only)
2427
2428.. option:: -ffixed-x13
2429
2430Reserve the 13 register (AArch64/RISC-V only)
2431
2432.. option:: -ffixed-x14
2433
2434Reserve the 14 register (AArch64/RISC-V only)
2435
2436.. option:: -ffixed-x15
2437
2438Reserve the 15 register (AArch64/RISC-V only)
2439
2440.. option:: -ffixed-x16
2441
2442Reserve the 16 register (AArch64/RISC-V only)
2443
2444.. option:: -ffixed-x17
2445
2446Reserve the 17 register (AArch64/RISC-V only)
2447
2448.. option:: -ffixed-x18
2449
2450Reserve the 18 register (AArch64/RISC-V only)
2451
2452.. option:: -ffixed-x19
2453
2454Reserve the 19 register (AArch64/RISC-V only)
2455
2456.. option:: -ffixed-x2
2457
2458Reserve the 2 register (AArch64/RISC-V only)
2459
2460.. option:: -ffixed-x20
2461
2462Reserve the 20 register (AArch64/RISC-V only)
2463
2464.. option:: -ffixed-x21
2465
2466Reserve the 21 register (AArch64/RISC-V only)
2467
2468.. option:: -ffixed-x22
2469
2470Reserve the 22 register (AArch64/RISC-V only)
2471
2472.. option:: -ffixed-x23
2473
2474Reserve the 23 register (AArch64/RISC-V only)
2475
2476.. option:: -ffixed-x24
2477
2478Reserve the 24 register (AArch64/RISC-V only)
2479
2480.. option:: -ffixed-x25
2481
2482Reserve the 25 register (AArch64/RISC-V only)
2483
2484.. option:: -ffixed-x26
2485
2486Reserve the 26 register (AArch64/RISC-V only)
2487
2488.. option:: -ffixed-x27
2489
2490Reserve the 27 register (AArch64/RISC-V only)
2491
2492.. option:: -ffixed-x28
2493
2494Reserve the 28 register (AArch64/RISC-V only)
2495
2496.. option:: -ffixed-x29
2497
2498Reserve the 29 register (AArch64/RISC-V only)
2499
2500.. option:: -ffixed-x3
2501
2502Reserve the 3 register (AArch64/RISC-V only)
2503
2504.. option:: -ffixed-x30
2505
2506Reserve the 30 register (AArch64/RISC-V only)
2507
2508.. option:: -ffixed-x31
2509
2510Reserve the 31 register (AArch64/RISC-V only)
2511
2512.. option:: -ffixed-x4
2513
2514Reserve the 4 register (AArch64/RISC-V only)
2515
2516.. option:: -ffixed-x5
2517
2518Reserve the 5 register (AArch64/RISC-V only)
2519
2520.. option:: -ffixed-x6
2521
2522Reserve the 6 register (AArch64/RISC-V only)
2523
2524.. option:: -ffixed-x7
2525
2526Reserve the 7 register (AArch64/RISC-V only)
2527
2528.. option:: -ffixed-x8
2529
2530Reserve the 8 register (AArch64/RISC-V only)
2531
2532.. option:: -ffixed-x9
2533
2534Reserve the 9 register (AArch64/RISC-V only)
2535
Richard Smith081ad4d2017-01-24 19:39:46 +00002536.. option:: -m16
2537
Richard Smith081ad4d2017-01-24 19:39:46 +00002538.. option:: -m32
2539
Richard Smith081ad4d2017-01-24 19:39:46 +00002540.. option:: -m64
2541
Richard Smith081ad4d2017-01-24 19:39:46 +00002542.. option:: -mabi=<arg>
2543
Craig Topper9624beb2020-03-10 11:08:19 -07002544.. option:: -malign-branch-boundary=<arg>
2545
2546Specify the boundary's size to align branches
2547
2548.. option:: -malign-branch-prefix-size=<arg>
2549
2550.. option:: -malign-branch=<arg1>,<arg2>...
2551
2552Specify types of branches to align
2553
Richard Smith081ad4d2017-01-24 19:39:46 +00002554.. option:: -malign-double
2555
2556Align doubles to two words in structs (x86 only)
2557
Richard Smith081ad4d2017-01-24 19:39:46 +00002558.. option:: -march=<arg>
2559
Richard Smith081ad4d2017-01-24 19:39:46 +00002560.. option:: -masm=<arg>
2561
Richard Smith081ad4d2017-01-24 19:39:46 +00002562.. option:: -mbackchain, -mno-backchain
2563
2564Link stack frames through backchain on System Z
2565
Craig Topper9624beb2020-03-10 11:08:19 -07002566.. option:: -mbranches-within-32B-boundaries
2567
2568Align selected branches (fused, jcc, jmp) within 32-byte boundary
2569
2570.. option:: -mcmodel=<arg>, -mcmodel=medany (equivalent to -mcmodel=medium), -mcmodel=medlow (equivalent to -mcmodel=small)
Richard Smith081ad4d2017-01-24 19:39:46 +00002571
Richard Smith081ad4d2017-01-24 19:39:46 +00002572.. option:: -mconsole<arg>
2573
Craig Topper9624beb2020-03-10 11:08:19 -07002574.. program:: clang1
2575.. 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), -mv66 (equivalent to -mcpu=hexagonv66), -mv67 (equivalent to -mcpu=hexagonv67), -mv67t (equivalent to -mcpu=hexagonv67t)
2576.. program:: clang
Ziang Wande94ac92019-06-25 23:57:14 +00002577
Vedant Kumar368540f2018-08-23 17:55:03 +00002578.. option:: -mcrc, -mno-crc
2579
2580Allow use of CRC instructions (ARM/Mips only)
2581
Craig Topperd23254a2017-07-20 17:52:48 +00002582.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2583
Richard Smith081ad4d2017-01-24 19:39:46 +00002584.. option:: -mdll<arg>
2585
Richard Smith081ad4d2017-01-24 19:39:46 +00002586.. option:: -mdynamic-no-pic<arg>
2587
Richard Smith081ad4d2017-01-24 19:39:46 +00002588.. option:: -meabi <arg>
2589
2590Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2591
Richard Smith78e23fd2017-04-13 22:39:49 +00002592.. option:: -mfentry
2593
Jonas Paulsson81aa62a2019-09-20 13:13:50 +00002594Insert calls to fentry at function entry (x86/SystemZ only)
Richard Smith78e23fd2017-04-13 22:39:49 +00002595
Richard Smith081ad4d2017-01-24 19:39:46 +00002596.. option:: -mfloat-abi=<arg>
2597
Richard Smith081ad4d2017-01-24 19:39:46 +00002598.. option:: -mfpmath=<arg>
2599
Richard Smith081ad4d2017-01-24 19:39:46 +00002600.. option:: -mfpu=<arg>
2601
Richard Smith081ad4d2017-01-24 19:39:46 +00002602.. option:: -mglobal-merge, -mno-global-merge
2603
2604Enable merging of globals
2605
Richard Smith081ad4d2017-01-24 19:39:46 +00002606.. option:: -mhard-float
2607
Richard Smith081ad4d2017-01-24 19:39:46 +00002608.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2609
Craig Topper9624beb2020-03-10 11:08:19 -07002610.. option:: -mhwmult=<arg>
2611
Richard Smith081ad4d2017-01-24 19:39:46 +00002612.. option:: -miamcu, -mno-iamcu
2613
2614Use Intel MCU ABI
2615
Richard Smith081ad4d2017-01-24 19:39:46 +00002616.. option:: -mimplicit-float, -mno-implicit-float
2617
Richard Smith081ad4d2017-01-24 19:39:46 +00002618.. option:: -mimplicit-it=<arg>
2619
Richard Smith081ad4d2017-01-24 19:39:46 +00002620.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2621
2622(integrated-as) Emit an object file which can be used with an incremental linker
2623
Richard Smith78e23fd2017-04-13 22:39:49 +00002624.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002625
Richard Smith081ad4d2017-01-24 19:39:46 +00002626.. option:: -mkernel
2627
Richard Smith081ad4d2017-01-24 19:39:46 +00002628.. option:: -mlong-calls, -mno-long-calls
2629
2630Generate branches with extended addressability, usually via indirect jumps.
2631
Scott Constable5b519cf2020-04-02 21:59:47 -07002632.. option:: -mlvi-cfi, -mno-lvi-cfi
2633
2634Enable only control-flow mitigations for Load Value Injection (LVI)
2635
Craig Topperd23254a2017-07-20 17:52:48 +00002636.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002637
Craig Topper9624beb2020-03-10 11:08:19 -07002638Set Mac OS X deployment target
Richard Smith081ad4d2017-01-24 19:39:46 +00002639
Craig Topperd23254a2017-07-20 17:52:48 +00002640.. option:: -mmcu=<arg>
2641
Richard Smith081ad4d2017-01-24 19:39:46 +00002642.. option:: -mms-bitfields, -mno-ms-bitfields
2643
2644Set the default structure layout to be compatible with the Microsoft compiler standard
2645
Craig Topper9624beb2020-03-10 11:08:19 -07002646.. option:: -mnop-mcount
2647
2648Generate mcount/\_\_fentry\_\_ calls as nops. To activate they need to be patched in.
2649
Richard Smith081ad4d2017-01-24 19:39:46 +00002650.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2651
2652Omit frame pointer setup for leaf functions
2653
Richard Smith081ad4d2017-01-24 19:39:46 +00002654.. option:: -moslib=<arg>
2655
Craig Topper9624beb2020-03-10 11:08:19 -07002656.. option:: -mpacked-stack, -mno-packed-stack
2657
2658Use packed stack layout (SystemZ only).
2659
Richard Smith081ad4d2017-01-24 19:39:46 +00002660.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2661
2662Use copy relocations support for PIE builds
2663
Craig Topper9a724aa2017-12-11 21:09:19 +00002664.. option:: -mprefer-vector-width=<arg>
2665
2666Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2667
Richard Smith081ad4d2017-01-24 19:39:46 +00002668.. option:: -mqdsp6-compat
2669
2670Enable hexagon-qdsp6 backward compatibility
2671
Richard Smith081ad4d2017-01-24 19:39:46 +00002672.. option:: -mrecip
2673
Richard Smithb2c82a62017-01-27 01:54:42 +00002674.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002675.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002676.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002677
Craig Topper9624beb2020-03-10 11:08:19 -07002678.. option:: -mrecord-mcount
2679
2680Generate a \_\_mcount\_loc section entry for each \_\_fentry\_\_ call.
2681
Richard Smith081ad4d2017-01-24 19:39:46 +00002682.. option:: -mred-zone, -mno-red-zone
2683
Richard Smith081ad4d2017-01-24 19:39:46 +00002684.. option:: -mregparm=<arg>
2685
Richard Smith081ad4d2017-01-24 19:39:46 +00002686.. option:: -mrelax-all, -mno-relax-all
2687
2688(integrated-as) Relax all machine instructions
2689
Vedant Kumar368540f2018-08-23 17:55:03 +00002690.. option:: -mretpoline, -mno-retpoline
2691
Richard Smith081ad4d2017-01-24 19:39:46 +00002692.. option:: -mrtd, -mno-rtd
2693
2694Make StdCall calling convention the default
2695
Vedant Kumar368540f2018-08-23 17:55:03 +00002696.. option:: -msign-return-address=<arg>
2697
2698Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002699
Richard Smith081ad4d2017-01-24 19:39:46 +00002700.. option:: -msoft-float, -mno-soft-float
2701
2702Use software floating point
2703
Craig Topper9624beb2020-03-10 11:08:19 -07002704.. option:: -mspeculative-load-hardening, -mno-speculative-load-hardening
2705
Richard Smith081ad4d2017-01-24 19:39:46 +00002706.. option:: -mstack-alignment=<arg>
2707
2708Set the stack alignment
2709
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002710.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2711
2712Enable stack probes
2713
Richard Smith081ad4d2017-01-24 19:39:46 +00002714.. option:: -mstack-probe-size=<arg>
2715
2716Set the stack probe size
2717
Richard Smith081ad4d2017-01-24 19:39:46 +00002718.. option:: -mstackrealign, -mno-stackrealign
2719
2720Force realign the stack at entry to every function
2721
Richard Smith081ad4d2017-01-24 19:39:46 +00002722.. option:: -mthread-model <arg>
2723
2724The thread model to use, e.g. posix, single (posix by default)
2725
Richard Smith081ad4d2017-01-24 19:39:46 +00002726.. option:: -mthreads<arg>
2727
Richard Smith081ad4d2017-01-24 19:39:46 +00002728.. option:: -mthumb, -mno-thumb
2729
Craig Topper9624beb2020-03-10 11:08:19 -07002730.. option:: -mtls-direct-seg-refs, -mno-tls-direct-seg-refs
Richard Smith081ad4d2017-01-24 19:39:46 +00002731
Craig Topper9624beb2020-03-10 11:08:19 -07002732Enable direct TLS access through segment registers (default)
2733
2734.. option:: -mtls-size=<arg>
2735
2736Specify bit size of immediate TLS offsets (AArch64 ELF only): 12 (for 4KB) \| 24 (for 16MB, default) \| 32 (for 4GB) \| 48 (for 256TB, needs -mcmodel=large)
2737
2738.. program:: clang1
2739.. option:: -mtune=<arg>
2740.. program:: clang
Ziang Wande94ac92019-06-25 23:57:14 +00002741
Sjoerd Meijer35cf2f42020-04-22 08:49:02 +01002742Accepted for compatibility with GCC. Currently has no effect.
2743
Richard Smith78e23fd2017-04-13 22:39:49 +00002744.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002745
Richard Smith081ad4d2017-01-24 19:39:46 +00002746.. option:: -municode<arg>
2747
Richard Smith081ad4d2017-01-24 19:39:46 +00002748.. option:: -mvx, -mno-vx
2749
Richard Smith081ad4d2017-01-24 19:39:46 +00002750.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2751
Richard Smith78e23fd2017-04-13 22:39:49 +00002752.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002753
Craig Topper9624beb2020-03-10 11:08:19 -07002754.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2755
2756Wavefront size 64 is used
2757
Richard Smith081ad4d2017-01-24 19:39:46 +00002758.. option:: -mwindows<arg>
2759
Richard Smith081ad4d2017-01-24 19:39:46 +00002760.. option:: -mx32
2761
Richard Smith081ad4d2017-01-24 19:39:46 +00002762AARCH64
2763-------
Tri Vo28e7e602018-09-25 16:48:40 +00002764.. option:: -fcall-saved-x10
2765
2766Make the x10 register call-saved (AArch64 only)
2767
2768.. option:: -fcall-saved-x11
2769
2770Make the x11 register call-saved (AArch64 only)
2771
2772.. option:: -fcall-saved-x12
2773
2774Make the x12 register call-saved (AArch64 only)
2775
2776.. option:: -fcall-saved-x13
2777
2778Make the x13 register call-saved (AArch64 only)
2779
2780.. option:: -fcall-saved-x14
2781
2782Make the x14 register call-saved (AArch64 only)
2783
2784.. option:: -fcall-saved-x15
2785
2786Make the x15 register call-saved (AArch64 only)
2787
2788.. option:: -fcall-saved-x18
2789
2790Make the x18 register call-saved (AArch64 only)
2791
Craig Topper9624beb2020-03-10 11:08:19 -07002792.. option:: -fcall-saved-x8
2793
2794Make the x8 register call-saved (AArch64 only)
2795
2796.. option:: -fcall-saved-x9
2797
2798Make the x9 register call-saved (AArch64 only)
2799
Richard Smith081ad4d2017-01-24 19:39:46 +00002800.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2801
2802Workaround Cortex-A53 erratum 835769 (AArch64 only)
2803
Richard Smith081ad4d2017-01-24 19:39:46 +00002804.. option:: -mgeneral-regs-only
2805
2806Generate code which only uses the general purpose registers (AArch64 only)
2807
2808AMDGPU
2809------
Craig Topper9624beb2020-03-10 11:08:19 -07002810.. option:: -mcode-object-v3, -mno-code-object-v3
2811
2812Enable code object v3 (AMDGPU only)
2813
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002814.. option:: -mcumode, -mno-cumode
2815
Craig Topper9624beb2020-03-10 11:08:19 -07002816CU wavefront execution mode is used (AMDGPU only)
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002817
Craig Topper9624beb2020-03-10 11:08:19 -07002818.. option:: -msram-ecc, -mno-sram-ecc
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002819
Craig Topper9624beb2020-03-10 11:08:19 -07002820Enable SRAM ECC (AMDGPU only)
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002821
Craig Topper16418662017-11-20 18:07:43 +00002822.. option:: -mxnack, -mno-xnack
2823
2824Enable XNACK (AMDGPU only)
2825
Richard Smith081ad4d2017-01-24 19:39:46 +00002826ARM
2827---
Craig Topper9624beb2020-03-10 11:08:19 -07002828.. option:: -fAAPCSBitfieldLoad
2829
2830Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).
2831
Richard Smith081ad4d2017-01-24 19:39:46 +00002832.. option:: -ffixed-r9
2833
2834Reserve the r9 register (ARM only)
2835
Craig Topper9624beb2020-03-10 11:08:19 -07002836.. option:: -mcmse
Momchil Velikovac215352020-01-29 10:38:10 +00002837
Craig Topper9624beb2020-03-10 11:08:19 -07002838Allow use of CMSE (Armv8-M Security Extensions)
Momchil Velikovac215352020-01-29 10:38:10 +00002839
Richard Smith081ad4d2017-01-24 19:39:46 +00002840.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2841
2842Disallow generation of data access to code sections (ARM only)
2843
Richard Smith081ad4d2017-01-24 19:39:46 +00002844.. option:: -mno-movt
2845
2846Disallow use of movt/movw pairs (ARM only)
2847
Richard Smith78e23fd2017-04-13 22:39:49 +00002848.. option:: -mno-neg-immediates
2849
2850Disallow converting instructions with negative immediates to their negation or inversion.
2851
Richard Smith081ad4d2017-01-24 19:39:46 +00002852.. option:: -mnocrc
2853
2854Disallow use of CRC instructions (ARM only)
2855
Richard Smith081ad4d2017-01-24 19:39:46 +00002856.. option:: -mrestrict-it, -mno-restrict-it
2857
2858Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2859
Craig Topper16418662017-11-20 18:07:43 +00002860.. option:: -mtp=<arg>
2861
Craig Topper9624beb2020-03-10 11:08:19 -07002862Thread pointer access method (AArch32/AArch64 only)
Craig Topper16418662017-11-20 18:07:43 +00002863
Richard Smith081ad4d2017-01-24 19:39:46 +00002864.. option:: -munaligned-access, -mno-unaligned-access
2865
2866Allow memory accesses to be unaligned (AArch32/AArch64 only)
2867
2868Hexagon
2869-------
Craig Topper16418662017-11-20 18:07:43 +00002870.. option:: -mieee-rnd-near
2871
Vedant Kumar368540f2018-08-23 17:55:03 +00002872.. option:: -mmemops, -mno-memops
2873
2874Enable generation of memop instructions
2875
2876.. option:: -mnvj, -mno-nvj
2877
2878Enable generation of new-value jumps
2879
2880.. option:: -mnvs, -mno-nvs
2881
2882Enable generation of new-value stores
2883
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002884.. option:: -mpackets, -mno-packets
2885
2886Enable generation of instruction packets
2887
Craig Topper16418662017-11-20 18:07:43 +00002888Hexagon
2889-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002890.. option:: -mhvx, -mno-hvx
2891
2892Enable Hexagon Vector eXtensions
2893
Craig Topper16418662017-11-20 18:07:43 +00002894.. option:: -mhvx-length=<arg>
2895
2896Set Hexagon Vector Length
2897
2898.. program:: clang1
2899.. option:: -mhvx=<arg>
2900.. program:: clang
2901
2902Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002903
Vedant Kumar368540f2018-08-23 17:55:03 +00002904MIPS
2905----
2906.. option:: -mabicalls, -mno-abicalls
2907
2908Enable SVR4-style position-independent code (Mips only)
2909
2910.. option:: -mabs=<arg>
2911
2912.. option:: -mcheck-zero-division, -mno-check-zero-division
2913
2914.. option:: -mcompact-branches=<arg>
2915
2916.. option:: -mdouble-float
2917
2918.. option:: -mdsp, -mno-dsp
2919
2920.. option:: -mdspr2, -mno-dspr2
2921
2922.. option:: -membedded-data, -mno-embedded-data
2923
2924Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2925
2926.. option:: -mextern-sdata, -mno-extern-sdata
2927
2928Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2929
2930.. option:: -mfp32
2931
2932Use 32-bit floating point registers (MIPS only)
2933
2934.. option:: -mfp64
2935
2936Use 64-bit floating point registers (MIPS only)
2937
2938.. option:: -mginv, -mno-ginv
2939
2940.. option:: -mgpopt, -mno-gpopt
2941
2942Use GP relative accesses for symbols known to be in a small data section (MIPS)
2943
2944.. option:: -mindirect-jump=<arg>
2945
2946Change indirect jump instructions to inhibit speculation
2947
2948.. option:: -mips16
2949
2950.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2951
2952.. option:: -mlocal-sdata, -mno-local-sdata
2953
2954Extend the -G behaviour to object local data (MIPS)
2955
2956.. option:: -mmadd4, -mno-madd4
2957
2958Enable the generation of 4-operand madd.s, madd.d and related instructions.
2959
2960.. option:: -mmicromips, -mno-micromips
2961
2962.. option:: -mmsa, -mno-msa
2963
2964Enable MSA ASE (MIPS only)
2965
2966.. option:: -mmt, -mno-mt
2967
2968Enable MT ASE (MIPS only)
2969
2970.. option:: -mnan=<arg>
2971
2972.. option:: -mno-mips16
2973
2974.. option:: -msingle-float
2975
2976.. option:: -mvirt, -mno-virt
2977
2978.. option:: -mxgot, -mno-xgot
2979
Richard Smith081ad4d2017-01-24 19:39:46 +00002980PowerPC
2981-------
Justin Hibbits4ca2cad2020-04-21 15:36:08 -05002982.. option:: -maix-struct-return
2983
2984Override the default ABI for 32-bit targets to return all structs in memory,
2985as in the Power 32-bit ABI for Linux (2011), and on AIX and Darwin.
2986
Richard Smith78e23fd2017-04-13 22:39:49 +00002987.. option:: -maltivec, -mno-altivec
2988
Richard Smith081ad4d2017-01-24 19:39:46 +00002989.. option:: -mcmpb, -mno-cmpb
2990
Richard Smith081ad4d2017-01-24 19:39:46 +00002991.. option:: -mcrbits, -mno-crbits
2992
Richard Smith081ad4d2017-01-24 19:39:46 +00002993.. option:: -mcrypto, -mno-crypto
2994
Richard Smith081ad4d2017-01-24 19:39:46 +00002995.. option:: -mdirect-move, -mno-direct-move
2996
Richard Smith081ad4d2017-01-24 19:39:46 +00002997.. option:: -mfloat128, -mno-float128
2998
Richard Smith081ad4d2017-01-24 19:39:46 +00002999.. option:: -mfprnd, -mno-fprnd
3000
Richard Smith081ad4d2017-01-24 19:39:46 +00003001.. option:: -mhtm, -mno-htm
3002
Richard Smith081ad4d2017-01-24 19:39:46 +00003003.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
3004
Richard Smith081ad4d2017-01-24 19:39:46 +00003005.. option:: -misel, -mno-isel
3006
Richard Smith081ad4d2017-01-24 19:39:46 +00003007.. option:: -mlongcall, -mno-longcall
3008
Richard Smith081ad4d2017-01-24 19:39:46 +00003009.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
3010
Richard Smith081ad4d2017-01-24 19:39:46 +00003011.. option:: -mpopcntd, -mno-popcntd
3012
Richard Smith081ad4d2017-01-24 19:39:46 +00003013.. option:: -mpower8-vector, -mno-power8-vector
3014
Richard Smith081ad4d2017-01-24 19:39:46 +00003015.. option:: -mpower9-vector, -mno-power9-vector
3016
Richard Smith081ad4d2017-01-24 19:39:46 +00003017.. option:: -mqpx, -mno-qpx
3018
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003019.. option:: -msecure-plt
3020
Craig Topper9624beb2020-03-10 11:08:19 -07003021.. option:: -mspe, -mno-spe
3022
Justin Hibbits4ca2cad2020-04-21 15:36:08 -05003023.. option:: -msvr4-struct-return
3024
3025Override the default ABI for 32-bit targets to return small structs in
3026registers, as in the System V ABI (1995).
3027
Richard Smith081ad4d2017-01-24 19:39:46 +00003028.. option:: -mvsx, -mno-vsx
3029
3030WebAssembly
3031-----------
Craig Topper9624beb2020-03-10 11:08:19 -07003032.. option:: -matomics, -mno-atomics
3033
3034.. option:: -mbulk-memory, -mno-bulk-memory
3035
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003036.. option:: -mexception-handling, -mno-exception-handling
3037
Craig Topper9624beb2020-03-10 11:08:19 -07003038.. option:: -mmultivalue, -mno-multivalue
3039
3040.. option:: -mmutable-globals, -mno-mutable-globals
3041
Craig Topper188252d2017-12-11 21:09:16 +00003042.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
3043
Craig Topper9624beb2020-03-10 11:08:19 -07003044.. option:: -mreference-types, -mno-reference-types
3045
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00003046.. option:: -msign-ext, -mno-sign-ext
3047
Richard Smith081ad4d2017-01-24 19:39:46 +00003048.. option:: -msimd128, -mno-simd128
3049
Craig Topper9624beb2020-03-10 11:08:19 -07003050.. option:: -mtail-call, -mno-tail-call
3051
3052.. option:: -munimplemented-simd128, -mno-unimplemented-simd128
3053
Richard Smith081ad4d2017-01-24 19:39:46 +00003054X86
3055---
Richard Smith081ad4d2017-01-24 19:39:46 +00003056.. option:: -m3dnow, -mno-3dnow
3057
Richard Smith081ad4d2017-01-24 19:39:46 +00003058.. option:: -m3dnowa, -mno-3dnowa
3059
Richard Smith081ad4d2017-01-24 19:39:46 +00003060.. option:: -madx, -mno-adx
3061
Richard Smith081ad4d2017-01-24 19:39:46 +00003062.. option:: -maes, -mno-aes
3063
Richard Smith081ad4d2017-01-24 19:39:46 +00003064.. option:: -mavx, -mno-avx
3065
Richard Smith081ad4d2017-01-24 19:39:46 +00003066.. option:: -mavx2, -mno-avx2
3067
Luo, Yuanke844f6622019-05-06 08:25:11 +00003068.. option:: -mavx512bf16, -mno-avx512bf16
3069
Craig Topper9624beb2020-03-10 11:08:19 -07003070.. option:: -mavx512bitalg, -mno-avx512bitalg
3071
Richard Smith081ad4d2017-01-24 19:39:46 +00003072.. option:: -mavx512bw, -mno-avx512bw
3073
Richard Smith081ad4d2017-01-24 19:39:46 +00003074.. option:: -mavx512cd, -mno-avx512cd
3075
Richard Smith081ad4d2017-01-24 19:39:46 +00003076.. option:: -mavx512dq, -mno-avx512dq
3077
Richard Smith081ad4d2017-01-24 19:39:46 +00003078.. option:: -mavx512er, -mno-avx512er
3079
Richard Smith081ad4d2017-01-24 19:39:46 +00003080.. option:: -mavx512f, -mno-avx512f
3081
Richard Smith081ad4d2017-01-24 19:39:46 +00003082.. option:: -mavx512ifma, -mno-avx512ifma
3083
Richard Smith081ad4d2017-01-24 19:39:46 +00003084.. option:: -mavx512pf, -mno-avx512pf
3085
Richard Smith081ad4d2017-01-24 19:39:46 +00003086.. option:: -mavx512vbmi, -mno-avx512vbmi
3087
Craig Topper287c8012018-01-03 18:29:12 +00003088.. option:: -mavx512vbmi2, -mno-avx512vbmi2
3089
Richard Smith081ad4d2017-01-24 19:39:46 +00003090.. option:: -mavx512vl, -mno-avx512vl
3091
Craig Topper287c8012018-01-03 18:29:12 +00003092.. option:: -mavx512vnni, -mno-avx512vnni
3093
Pengfei Wangcc3629d2019-05-31 06:09:35 +00003094.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
3095
Craig Topperd23254a2017-07-20 17:52:48 +00003096.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
3097
Richard Smith081ad4d2017-01-24 19:39:46 +00003098.. option:: -mbmi, -mno-bmi
3099
Richard Smith081ad4d2017-01-24 19:39:46 +00003100.. option:: -mbmi2, -mno-bmi2
3101
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003102.. option:: -mcldemote, -mno-cldemote
3103
Craig Topper78b47872017-02-08 06:48:58 +00003104.. option:: -mclflushopt, -mno-clflushopt
3105
Craig Topper177a57c2017-02-08 07:57:01 +00003106.. option:: -mclwb, -mno-clwb
3107
Richard Smith78e23fd2017-04-13 22:39:49 +00003108.. option:: -mclzero, -mno-clzero
3109
Richard Smith081ad4d2017-01-24 19:39:46 +00003110.. option:: -mcx16, -mno-cx16
3111
Pengfei Wang3a29f7c2019-06-06 08:28:42 +00003112.. option:: -menqcmd, -mno-enqcmd
3113
Richard Smith081ad4d2017-01-24 19:39:46 +00003114.. option:: -mf16c, -mno-f16c
3115
Richard Smith081ad4d2017-01-24 19:39:46 +00003116.. option:: -mfma, -mno-fma
3117
Richard Smith081ad4d2017-01-24 19:39:46 +00003118.. option:: -mfma4, -mno-fma4
3119
Richard Smith081ad4d2017-01-24 19:39:46 +00003120.. option:: -mfsgsbase, -mno-fsgsbase
3121
Richard Smith081ad4d2017-01-24 19:39:46 +00003122.. option:: -mfxsr, -mno-fxsr
3123
Craig Topper287c8012018-01-03 18:29:12 +00003124.. option:: -mgfni, -mno-gfni
3125
Vedant Kumar368540f2018-08-23 17:55:03 +00003126.. option:: -minvpcid, -mno-invpcid
3127
Craig Topperd23254a2017-07-20 17:52:48 +00003128.. option:: -mlwp, -mno-lwp
3129
Richard Smith081ad4d2017-01-24 19:39:46 +00003130.. option:: -mlzcnt, -mno-lzcnt
3131
Richard Smith081ad4d2017-01-24 19:39:46 +00003132.. option:: -mmmx, -mno-mmx
3133
Craig Topper177a57c2017-02-08 07:57:01 +00003134.. option:: -mmovbe, -mno-movbe
3135
Gabor Buellaa51e0c22018-05-01 10:05:42 +00003136.. option:: -mmovdir64b, -mno-movdir64b
3137
Vedant Kumar368540f2018-08-23 17:55:03 +00003138.. option:: -mmovdiri, -mno-movdiri
3139
Richard Smith081ad4d2017-01-24 19:39:46 +00003140.. option:: -mmwaitx, -mno-mwaitx
3141
Richard Smith081ad4d2017-01-24 19:39:46 +00003142.. option:: -mpclmul, -mno-pclmul
3143
Vedant Kumar368540f2018-08-23 17:55:03 +00003144.. option:: -mpconfig, -mno-pconfig
3145
Richard Smith081ad4d2017-01-24 19:39:46 +00003146.. option:: -mpku, -mno-pku
3147
Richard Smith081ad4d2017-01-24 19:39:46 +00003148.. option:: -mpopcnt, -mno-popcnt
3149
Craig Topperd2bf7b02017-02-08 08:23:40 +00003150.. option:: -mprefetchwt1, -mno-prefetchwt1
3151
Richard Smith081ad4d2017-01-24 19:39:46 +00003152.. option:: -mprfchw, -mno-prfchw
3153
Vedant Kumar368540f2018-08-23 17:55:03 +00003154.. option:: -mptwrite, -mno-ptwrite
3155
Craig Topper596527b2018-01-23 18:40:15 +00003156.. option:: -mrdpid, -mno-rdpid
3157
Richard Smith081ad4d2017-01-24 19:39:46 +00003158.. option:: -mrdrnd, -mno-rdrnd
3159
Richard Smith081ad4d2017-01-24 19:39:46 +00003160.. option:: -mrdseed, -mno-rdseed
3161
Craig Topper596527b2018-01-23 18:40:15 +00003162.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
3163
Richard Smith081ad4d2017-01-24 19:39:46 +00003164.. option:: -mrtm, -mno-rtm
3165
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00003166.. option:: -msahf, -mno-sahf
3167
WangTianQingd08fadd2020-04-02 16:15:34 +08003168.. option:: -mserialize, -mno-serialize
3169
Craig Topper204ecff2017-02-08 08:23:17 +00003170.. option:: -msgx, -mno-sgx
3171
Richard Smith081ad4d2017-01-24 19:39:46 +00003172.. option:: -msha, -mno-sha
3173
Craig Topper188252d2017-12-11 21:09:16 +00003174.. option:: -mshstk, -mno-shstk
3175
Richard Smith081ad4d2017-01-24 19:39:46 +00003176.. option:: -msse, -mno-sse
3177
Richard Smith081ad4d2017-01-24 19:39:46 +00003178.. option:: -msse2, -mno-sse2
3179
Richard Smith081ad4d2017-01-24 19:39:46 +00003180.. option:: -msse3, -mno-sse3
3181
Richard Smith081ad4d2017-01-24 19:39:46 +00003182.. option:: -msse4.1, -mno-sse4.1
3183
Richard Smithb2c82a62017-01-27 01:54:42 +00003184.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00003185.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00003186.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00003187
Richard Smith081ad4d2017-01-24 19:39:46 +00003188.. option:: -msse4a, -mno-sse4a
3189
Richard Smith081ad4d2017-01-24 19:39:46 +00003190.. option:: -mssse3, -mno-ssse3
3191
Richard Smith081ad4d2017-01-24 19:39:46 +00003192.. option:: -mtbm, -mno-tbm
3193
WangTianQinga3dc9492020-04-09 13:15:42 +08003194.. option:: -mtsxldtrk, -mno-tsxldtrk
3195
Craig Topper287c8012018-01-03 18:29:12 +00003196.. option:: -mvaes, -mno-vaes
3197
3198.. option:: -mvpclmulqdq, -mno-vpclmulqdq
3199
Craig Topper9624beb2020-03-10 11:08:19 -07003200.. option:: -mvzeroupper, -mno-vzeroupper
3201
Craig Topper42da9cb2018-04-23 21:41:06 +00003202.. option:: -mwaitpkg, -mno-waitpkg
3203
Gabor Buellaa0520162018-04-11 20:09:09 +00003204.. option:: -mwbnoinvd, -mno-wbnoinvd
3205
Richard Smith081ad4d2017-01-24 19:39:46 +00003206.. option:: -mx87, -m80387, -mno-x87
3207
Richard Smith081ad4d2017-01-24 19:39:46 +00003208.. option:: -mxop, -mno-xop
3209
Richard Smith081ad4d2017-01-24 19:39:46 +00003210.. option:: -mxsave, -mno-xsave
3211
Richard Smith081ad4d2017-01-24 19:39:46 +00003212.. option:: -mxsavec, -mno-xsavec
3213
Richard Smith081ad4d2017-01-24 19:39:46 +00003214.. option:: -mxsaveopt, -mno-xsaveopt
3215
Richard Smith081ad4d2017-01-24 19:39:46 +00003216.. option:: -mxsaves, -mno-xsaves
3217
Vedant Kumar368540f2018-08-23 17:55:03 +00003218RISCV
3219-----
3220.. option:: -mrelax, -mno-relax
3221
3222Enable linker relaxation
3223
Craig Topper9624beb2020-03-10 11:08:19 -07003224.. option:: -msave-restore, -mno-save-restore
3225
3226Enable using library calls for save and restore
3227
Shiva Chenfc375262020-03-10 10:23:59 +08003228.. option:: -msmall-data-limit=<limit>
3229
3230Put global and static data smaller than the limit into a special section
3231
Craig Topper9624beb2020-03-10 11:08:19 -07003232Long double flags
3233-----------------
3234Selects the long double implementation
3235
3236.. option:: -mlong-double-128
3237
3238Force long double to be 128 bits
3239
3240.. option:: -mlong-double-64
3241
3242Force long double to be 64 bits
3243
3244.. option:: -mlong-double-80
3245
3246Force long double to be 80 bits, padded to 128 bits for storage
3247
Richard Smith081ad4d2017-01-24 19:39:46 +00003248Optimization level
3249~~~~~~~~~~~~~~~~~~
3250
3251Flags controlling how much optimization should be performed.
3252
Richard Smith081ad4d2017-01-24 19:39:46 +00003253.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
3254
Richard Smith081ad4d2017-01-24 19:39:46 +00003255.. option:: -Ofast<arg>
3256
3257Debug information generation
3258~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3259
3260Flags controlling how much and what kind of debug information should be
3261generated.
3262
3263Kind and level of debug information
3264-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003265.. option:: -g, --debug, --debug=<arg>
3266
3267Generate source-level debug information
3268
Craig Topper9624beb2020-03-10 11:08:19 -07003269.. option:: -gdwarf
3270
3271Generate source-level debug information with the default dwarf version
3272
Richard Smith081ad4d2017-01-24 19:39:46 +00003273.. option:: -gdwarf-2
3274
3275Generate source-level debug information with dwarf version 2
3276
Richard Smith081ad4d2017-01-24 19:39:46 +00003277.. option:: -gdwarf-3
3278
3279Generate source-level debug information with dwarf version 3
3280
Craig Topper9624beb2020-03-10 11:08:19 -07003281.. option:: -gdwarf-4
Richard Smith081ad4d2017-01-24 19:39:46 +00003282
3283Generate source-level debug information with dwarf version 4
3284
Richard Smith081ad4d2017-01-24 19:39:46 +00003285.. option:: -gdwarf-5
3286
3287Generate source-level debug information with dwarf version 5
3288
Richard Smith081ad4d2017-01-24 19:39:46 +00003289.. option:: -gfull
3290
Richard Smith081ad4d2017-01-24 19:39:46 +00003291.. option:: -gused
3292
3293Debug level
3294___________
Richard Smith081ad4d2017-01-24 19:39:46 +00003295.. option:: -g0
3296
Richard Smith081ad4d2017-01-24 19:39:46 +00003297.. option:: -g2
3298
Richard Smith081ad4d2017-01-24 19:39:46 +00003299.. option:: -g3
3300
Richard Smith081ad4d2017-01-24 19:39:46 +00003301.. option:: -ggdb0
3302
Richard Smith081ad4d2017-01-24 19:39:46 +00003303.. option:: -ggdb1
3304
Richard Smith081ad4d2017-01-24 19:39:46 +00003305.. option:: -ggdb2
3306
Richard Smith081ad4d2017-01-24 19:39:46 +00003307.. option:: -ggdb3
3308
Craig Topper9624beb2020-03-10 11:08:19 -07003309.. option:: -gline-directives-only
3310
3311Emit debug line info directives only
3312
Richard Smith081ad4d2017-01-24 19:39:46 +00003313.. option:: -gline-tables-only, -g1, -gmlt
3314
3315Emit debug line number tables only
3316
Richard Smith081ad4d2017-01-24 19:39:46 +00003317.. option:: -gmodules
3318
3319Generate debug info with external references to clang modules or precompiled headers
3320
3321Debugger to tune debug information for
3322______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00003323.. option:: -ggdb
3324
Richard Smith081ad4d2017-01-24 19:39:46 +00003325.. option:: -glldb
3326
Richard Smith081ad4d2017-01-24 19:39:46 +00003327.. option:: -gsce
3328
3329Debug information flags
3330-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003331.. option:: -gcolumn-info, -gno-column-info
3332
Richard Smith081ad4d2017-01-24 19:39:46 +00003333.. option:: -gdwarf-aranges
3334
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003335.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00003336
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003337Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00003338
Vedant Kumar368540f2018-08-23 17:55:03 +00003339.. option:: -ggnu-pubnames, -gno-gnu-pubnames
3340
3341.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00003342
Craig Topper9624beb2020-03-10 11:08:19 -07003343.. option:: -grecord-command-line, -gno-record-command-line, -grecord-gcc-switches
Richard Smith081ad4d2017-01-24 19:39:46 +00003344
Richard Smith081ad4d2017-01-24 19:39:46 +00003345.. option:: -gsplit-dwarf
3346
Craig Topper9624beb2020-03-10 11:08:19 -07003347.. program:: clang1
3348.. option:: -gsplit-dwarf=<arg>
3349.. program:: clang
3350
3351Set DWARF fission mode to either 'split' or 'single'
3352
Richard Smith081ad4d2017-01-24 19:39:46 +00003353.. option:: -gstrict-dwarf, -gno-strict-dwarf
3354
Craig Topperd23254a2017-07-20 17:52:48 +00003355.. option:: -gz
3356
3357DWARF debug sections compression type
3358
3359.. program:: clang1
3360.. option:: -gz=<arg>
3361.. program:: clang
3362
3363DWARF debug sections compression type
3364
Richard Smithc5b2e002017-01-27 02:08:37 +00003365Static analyzer flags
3366=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00003367
Richard Smithc5b2e002017-01-27 02:08:37 +00003368Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00003369
Richard Smithc5b2e002017-01-27 02:08:37 +00003370.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00003371
Richard Smithc5b2e002017-01-27 02:08:37 +00003372Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00003373
3374Fortran compilation flags
3375=========================
3376
3377Flags that will be passed onto the ``gfortran`` compiler when Clang is given
3378a Fortran input.
3379
Richard Smithc5b2e002017-01-27 02:08:37 +00003380.. option:: -A<arg>, --assert <arg>, --assert=<arg>
3381
Richard Smith081ad4d2017-01-24 19:39:46 +00003382.. option:: -A-<arg>
3383
Richard Smith081ad4d2017-01-24 19:39:46 +00003384.. option:: -J<arg>
3385
Richard Smith081ad4d2017-01-24 19:39:46 +00003386.. option:: -cpp
3387
Richard Smith081ad4d2017-01-24 19:39:46 +00003388.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
3389
Richard Smith081ad4d2017-01-24 19:39:46 +00003390.. option:: -falign-commons, -fno-align-commons
3391
Richard Smith081ad4d2017-01-24 19:39:46 +00003392.. option:: -fall-intrinsics, -fno-all-intrinsics
3393
Richard Smith081ad4d2017-01-24 19:39:46 +00003394.. option:: -fautomatic, -fno-automatic
3395
Richard Smith081ad4d2017-01-24 19:39:46 +00003396.. option:: -fbackslash, -fno-backslash
3397
Richard Smith081ad4d2017-01-24 19:39:46 +00003398.. option:: -fbacktrace, -fno-backtrace
3399
Richard Smith081ad4d2017-01-24 19:39:46 +00003400.. option:: -fblas-matmul-limit=<arg>
3401
Richard Smith081ad4d2017-01-24 19:39:46 +00003402.. option:: -fbounds-check, -fno-bounds-check
3403
Richard Smith081ad4d2017-01-24 19:39:46 +00003404.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
3405
Richard Smith081ad4d2017-01-24 19:39:46 +00003406.. option:: -fcheck=<arg>
3407
Richard Smith081ad4d2017-01-24 19:39:46 +00003408.. option:: -fcoarray=<arg>
3409
Richard Smith081ad4d2017-01-24 19:39:46 +00003410.. option:: -fconvert=<arg>
3411
Richard Smith081ad4d2017-01-24 19:39:46 +00003412.. option:: -fcray-pointer, -fno-cray-pointer
3413
Richard Smith081ad4d2017-01-24 19:39:46 +00003414.. option:: -fd-lines-as-code, -fno-d-lines-as-code
3415
Richard Smith081ad4d2017-01-24 19:39:46 +00003416.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
3417
Richard Smith081ad4d2017-01-24 19:39:46 +00003418.. option:: -fdefault-double-8, -fno-default-double-8
3419
Richard Smith081ad4d2017-01-24 19:39:46 +00003420.. option:: -fdefault-integer-8, -fno-default-integer-8
3421
Richard Smith081ad4d2017-01-24 19:39:46 +00003422.. option:: -fdefault-real-8, -fno-default-real-8
3423
Richard Smith081ad4d2017-01-24 19:39:46 +00003424.. option:: -fdollar-ok, -fno-dollar-ok
3425
Richard Smith081ad4d2017-01-24 19:39:46 +00003426.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
3427
Richard Smith081ad4d2017-01-24 19:39:46 +00003428.. option:: -fdump-fortran-original, -fno-dump-fortran-original
3429
Richard Smith081ad4d2017-01-24 19:39:46 +00003430.. option:: -fdump-parse-tree, -fno-dump-parse-tree
3431
Richard Smith081ad4d2017-01-24 19:39:46 +00003432.. option:: -fexternal-blas, -fno-external-blas
3433
Richard Smith081ad4d2017-01-24 19:39:46 +00003434.. option:: -ff2c, -fno-f2c
3435
Richard Smith081ad4d2017-01-24 19:39:46 +00003436.. option:: -ffixed-form, -fno-fixed-form
3437
Richard Smith081ad4d2017-01-24 19:39:46 +00003438.. option:: -ffixed-line-length-<arg>
3439
Richard Smith081ad4d2017-01-24 19:39:46 +00003440.. option:: -ffpe-trap=<arg>
3441
Richard Smith081ad4d2017-01-24 19:39:46 +00003442.. option:: -ffree-form, -fno-free-form
3443
Richard Smith081ad4d2017-01-24 19:39:46 +00003444.. option:: -ffree-line-length-<arg>
3445
Richard Smith081ad4d2017-01-24 19:39:46 +00003446.. option:: -ffrontend-optimize, -fno-frontend-optimize
3447
Richard Smith081ad4d2017-01-24 19:39:46 +00003448.. option:: -fimplicit-none, -fno-implicit-none
3449
Richard Smith081ad4d2017-01-24 19:39:46 +00003450.. option:: -finit-character=<arg>
3451
Richard Smith081ad4d2017-01-24 19:39:46 +00003452.. option:: -finit-integer=<arg>
3453
Richard Smith081ad4d2017-01-24 19:39:46 +00003454.. option:: -finit-local-zero, -fno-init-local-zero
3455
Richard Smith081ad4d2017-01-24 19:39:46 +00003456.. option:: -finit-logical=<arg>
3457
Richard Smith081ad4d2017-01-24 19:39:46 +00003458.. option:: -finit-real=<arg>
3459
Richard Smith081ad4d2017-01-24 19:39:46 +00003460.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
3461
Richard Smith081ad4d2017-01-24 19:39:46 +00003462.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
3463
Richard Smith081ad4d2017-01-24 19:39:46 +00003464.. option:: -fmax-array-constructor=<arg>
3465
Richard Smith081ad4d2017-01-24 19:39:46 +00003466.. option:: -fmax-errors=<arg>
3467
Richard Smith081ad4d2017-01-24 19:39:46 +00003468.. option:: -fmax-identifier-length, -fno-max-identifier-length
3469
Richard Smith081ad4d2017-01-24 19:39:46 +00003470.. option:: -fmax-stack-var-size=<arg>
3471
Richard Smith081ad4d2017-01-24 19:39:46 +00003472.. option:: -fmax-subrecord-length=<arg>
3473
Richard Smith081ad4d2017-01-24 19:39:46 +00003474.. option:: -fmodule-private, -fno-module-private
3475
Richard Smith081ad4d2017-01-24 19:39:46 +00003476.. option:: -fpack-derived, -fno-pack-derived
3477
Richard Smith081ad4d2017-01-24 19:39:46 +00003478.. option:: -fprotect-parens, -fno-protect-parens
3479
Richard Smith081ad4d2017-01-24 19:39:46 +00003480.. option:: -frange-check, -fno-range-check
3481
Richard Smith081ad4d2017-01-24 19:39:46 +00003482.. option:: -freal-4-real-10, -fno-real-4-real-10
3483
Richard Smith081ad4d2017-01-24 19:39:46 +00003484.. option:: -freal-4-real-16, -fno-real-4-real-16
3485
Richard Smith081ad4d2017-01-24 19:39:46 +00003486.. option:: -freal-4-real-8, -fno-real-4-real-8
3487
Richard Smith081ad4d2017-01-24 19:39:46 +00003488.. option:: -freal-8-real-10, -fno-real-8-real-10
3489
Richard Smith081ad4d2017-01-24 19:39:46 +00003490.. option:: -freal-8-real-16, -fno-real-8-real-16
3491
Richard Smith081ad4d2017-01-24 19:39:46 +00003492.. option:: -freal-8-real-4, -fno-real-8-real-4
3493
Richard Smith081ad4d2017-01-24 19:39:46 +00003494.. option:: -frealloc-lhs, -fno-realloc-lhs
3495
Richard Smith081ad4d2017-01-24 19:39:46 +00003496.. option:: -frecord-marker=<arg>
3497
Richard Smith081ad4d2017-01-24 19:39:46 +00003498.. option:: -frecursive, -fno-recursive
3499
Richard Smith081ad4d2017-01-24 19:39:46 +00003500.. option:: -frepack-arrays, -fno-repack-arrays
3501
Richard Smith081ad4d2017-01-24 19:39:46 +00003502.. option:: -fsecond-underscore, -fno-second-underscore
3503
Richard Smith081ad4d2017-01-24 19:39:46 +00003504.. option:: -fsign-zero, -fno-sign-zero
3505
Richard Smith081ad4d2017-01-24 19:39:46 +00003506.. option:: -fstack-arrays, -fno-stack-arrays
3507
Richard Smith081ad4d2017-01-24 19:39:46 +00003508.. option:: -funderscoring, -fno-underscoring
3509
Richard Smith081ad4d2017-01-24 19:39:46 +00003510.. option:: -fwhole-file, -fno-whole-file
3511
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003512.. option:: -imultilib <arg>
3513
Richard Smith081ad4d2017-01-24 19:39:46 +00003514.. option:: -nocpp
3515
Richard Smith081ad4d2017-01-24 19:39:46 +00003516.. option:: -static-libgfortran
3517
Richard Smithc5b2e002017-01-27 02:08:37 +00003518Linker flags
3519============
3520Flags that are passed on to the linker
3521
3522.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3523
3524Add directory to library search path
3525
3526.. option:: -Mach
3527
3528.. option:: -T<script>
3529
3530Specify <script> as linker script
3531
Richard Smith78e23fd2017-04-13 22:39:49 +00003532.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003533
3534Set starting address of BSS to <addr>
3535
Richard Smith78e23fd2017-04-13 22:39:49 +00003536.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003537
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003538Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003539
Richard Smith78e23fd2017-04-13 22:39:49 +00003540.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003541
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003542Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003543
3544.. option:: -Wl,<arg>,<arg2>...
3545
3546Pass the comma separated arguments in <arg> to the linker
3547
3548.. option:: -X
3549
3550.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3551
3552Pass <arg> to the linker
3553
3554.. program:: clang1
3555.. option:: -Z
3556.. program:: clang
3557
3558.. option:: -e<arg>, --entry
3559
3560.. option:: -filelist <arg>
3561
Vedant Kumar368540f2018-08-23 17:55:03 +00003562.. option:: --hip-device-lib-path=<arg>
3563
3564HIP device library path
3565
3566.. option:: --hip-device-lib=<arg>
3567
3568HIP device library
3569
Richard Smithc5b2e002017-01-27 02:08:37 +00003570.. option:: -l<arg>
3571
3572.. option:: -r
3573
3574.. option:: -rpath <arg>
3575
3576.. option:: -s
3577
3578.. option:: -t
3579
3580.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3581
3582.. option:: -undef
3583
3584undef all system defines
3585
3586.. option:: -undefined<arg>, --no-undefined
3587
3588.. option:: -z <arg>
3589
3590Pass -z <arg> to the linker
3591