blob: 74e831c36eb90ed0ea48bfa3f49e93302f4aaeae [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
Richard Smith081ad4d2017-01-24 19:39:46 +00001334.. option:: -fblocks, -fno-blocks
1335
1336Enable the 'blocks' language feature
1337
Richard Smith081ad4d2017-01-24 19:39:46 +00001338.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1339
Richard Smith081ad4d2017-01-24 19:39:46 +00001340.. option:: -fborland-extensions, -fno-borland-extensions
1341
1342Accept non-standard constructs supported by the Borland compiler
1343
Richard Smith081ad4d2017-01-24 19:39:46 +00001344.. option:: -fbracket-depth=<arg>
1345
Richard Smith081ad4d2017-01-24 19:39:46 +00001346.. option:: -fbuiltin, -fno-builtin
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fbuiltin-module-map
1349
1350Load the clang builtins module map file.
1351
Vedant Kumar368540f2018-08-23 17:55:03 +00001352.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1353
1354Enable C++ static destructor registration (the default)
1355
Richard Smith081ad4d2017-01-24 19:39:46 +00001356.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1357
Craig Topper596527b2018-01-23 18:40:15 +00001358.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1359
1360Instrument control-flow architecture protection. Options: return, branch, full, none.
1361
Craig Topper9624beb2020-03-10 11:08:19 -07001362.. option:: -fcf-runtime-abi=<arg>
1363
Vedant Kumar368540f2018-08-23 17:55:03 +00001364.. option:: -fchar8\_t, -fno-char8\_t
1365
1366Enable C++ builtin type char8\_t
1367
Richard Smith081ad4d2017-01-24 19:39:46 +00001368.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1369
Richard Smith081ad4d2017-01-24 19:39:46 +00001370.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1371
1372Use colors in diagnostics
1373
Richard Smith081ad4d2017-01-24 19:39:46 +00001374.. option:: -fcommon, -fno-common
1375
Craig Topper9624beb2020-03-10 11:08:19 -07001376Place uninitialized global variables in a common block
Sjoerd Meijer3d9a0442020-03-09 19:25:24 +00001377
Richard Smith081ad4d2017-01-24 19:39:46 +00001378.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1379
Richard Smith081ad4d2017-01-24 19:39:46 +00001380.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1381
Richard Smith081ad4d2017-01-24 19:39:46 +00001382.. option:: -fconstant-string-class=<arg>
1383
Richard Smith081ad4d2017-01-24 19:39:46 +00001384.. option:: -fconstexpr-backtrace-limit=<arg>
1385
Richard Smith081ad4d2017-01-24 19:39:46 +00001386.. option:: -fconstexpr-depth=<arg>
1387
Richard Smith081ad4d2017-01-24 19:39:46 +00001388.. option:: -fconstexpr-steps=<arg>
1389
Craig Topper9624beb2020-03-10 11:08:19 -07001390.. option:: -fconvergent-functions
1391
1392Assume functions may be convergent
1393
Richard Smith081ad4d2017-01-24 19:39:46 +00001394.. option:: -fcoroutines-ts, -fno-coroutines-ts
1395
1396Enable support for the C++ Coroutines TS
1397
Richard Smith081ad4d2017-01-24 19:39:46 +00001398.. option:: -fcoverage-mapping, -fno-coverage-mapping
1399
1400Generate coverage mapping to enable code coverage analysis
1401
Richard Smith081ad4d2017-01-24 19:39:46 +00001402.. option:: -fcreate-profile
1403
Craig Topper9624beb2020-03-10 11:08:19 -07001404.. option:: -fcs-profile-generate
1405
1406Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1407
1408.. program:: clang1
1409.. option:: -fcs-profile-generate=<directory>
1410.. program:: clang
1411
1412Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1413
Richard Smith081ad4d2017-01-24 19:39:46 +00001414.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1415
1416Enable C++ exceptions
1417
Richard Smith081ad4d2017-01-24 19:39:46 +00001418.. option:: -fcxx-modules, -fno-cxx-modules
1419
Richard Smith081ad4d2017-01-24 19:39:46 +00001420.. option:: -fdata-sections, -fno-data-sections
1421
Craig Topper9624beb2020-03-10 11:08:19 -07001422Place each data in its own section
1423
1424.. option:: -fdebug-compilation-dir <arg>, -fdebug-compilation-dir=<arg>
1425
1426The compilation directory to embed in the debug info.
1427
1428.. option:: -fdebug-default-version=<arg>
1429
1430Default DWARF version to use, if a -g option caused DWARF debug info to be produced
Richard Smith081ad4d2017-01-24 19:39:46 +00001431
Richard Smith081ad4d2017-01-24 19:39:46 +00001432.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1433
1434Emit extra debug info to make sample profile more accurate.
1435
Richard Smith78e23fd2017-04-13 22:39:49 +00001436.. option:: -fdebug-macro, -fno-debug-macro
1437
1438Emit macro debug information
1439
Richard Smith081ad4d2017-01-24 19:39:46 +00001440.. option:: -fdebug-pass-arguments
1441
Richard Smith081ad4d2017-01-24 19:39:46 +00001442.. option:: -fdebug-pass-structure
1443
Richard Smith081ad4d2017-01-24 19:39:46 +00001444.. option:: -fdebug-prefix-map=<arg>
1445
1446remap file source paths in debug info
1447
Craig Topper9624beb2020-03-10 11:08:19 -07001448.. option:: -fdebug-ranges-base-address, -fno-debug-ranges-base-address
1449
1450Use DWARF base address selection entries in debug\_ranges
1451
Richard Smith081ad4d2017-01-24 19:39:46 +00001452.. option:: -fdebug-types-section, -fno-debug-types-section
1453
1454Place debug types in their own section (ELF Only)
1455
Richard Smith081ad4d2017-01-24 19:39:46 +00001456.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1457
1458Parse templated function definitions at the end of the translation unit
1459
Vedant Kumar368540f2018-08-23 17:55:03 +00001460.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1461
1462Treat usage of null pointers as undefined behavior.
1463
Richard Smith081ad4d2017-01-24 19:39:46 +00001464.. option:: -fdenormal-fp-math=<arg>
1465
Richard Smith081ad4d2017-01-24 19:39:46 +00001466.. option:: -fdiagnostics-absolute-paths
1467
1468Print absolute paths in diagnostics
1469
Richard Smith081ad4d2017-01-24 19:39:46 +00001470.. option:: -fdiagnostics-color, -fno-diagnostics-color
1471
Richard Smithb2c82a62017-01-27 01:54:42 +00001472.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001473.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001474.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001475
Craig Topperd23254a2017-07-20 17:52:48 +00001476.. option:: -fdiagnostics-hotness-threshold=<number>
1477
1478Prevent optimization remarks from being output if they do not have at least this profile count
1479
Richard Smith081ad4d2017-01-24 19:39:46 +00001480.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1481
1482Enable profile hotness information in diagnostic line
1483
Richard Smith081ad4d2017-01-24 19:39:46 +00001484.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1485
1486Display include stacks for diagnostic notes
1487
Richard Smith081ad4d2017-01-24 19:39:46 +00001488.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1489
1490Print option name with mappable diagnostics
1491
Richard Smith081ad4d2017-01-24 19:39:46 +00001492.. option:: -fdiagnostics-show-template-tree
1493
1494Print a template comparison tree for differing templates
1495
Vedant Kumar368540f2018-08-23 17:55:03 +00001496.. option:: -fdigraphs, -fno-digraphs
1497
1498Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1499
Richard Smith081ad4d2017-01-24 19:39:46 +00001500.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1501
1502Allow '$' in identifiers
1503
Craig Topper16418662017-11-20 18:07:43 +00001504.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1505
1506Enable '\[\[\]\]' attributes in all C and C++ language modes
1507
Richard Smith081ad4d2017-01-24 19:39:46 +00001508.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1509
Craig Topper188252d2017-12-11 21:09:16 +00001510.. option:: -fdwarf-exceptions
1511
1512Use DWARF style exceptions
1513
Richard Smith081ad4d2017-01-24 19:39:46 +00001514.. option:: -felide-constructors, -fno-elide-constructors
1515
Richard Smith081ad4d2017-01-24 19:39:46 +00001516.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1517
Richard Smith081ad4d2017-01-24 19:39:46 +00001518.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1519
1520Embed LLVM bitcode (option: off, all, bitcode, marker)
1521
Richard Smith081ad4d2017-01-24 19:39:46 +00001522.. option:: -femit-all-decls
1523
1524Emit all declarations, even if unused
1525
Richard Smith081ad4d2017-01-24 19:39:46 +00001526.. option:: -femulated-tls, -fno-emulated-tls
1527
1528Use emutls functions to access thread\_local variables
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1531
Richard Smith081ad4d2017-01-24 19:39:46 +00001532.. option:: -ferror-limit=<arg>
1533
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001534.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1535
Richard Smith081ad4d2017-01-24 19:39:46 +00001536.. option:: -fexceptions, -fno-exceptions
1537
1538Enable support for exception handling
1539
Richard Smith081ad4d2017-01-24 19:39:46 +00001540.. option:: -fexec-charset=<arg>
1541
Craig Topper9624beb2020-03-10 11:08:19 -07001542.. option:: -fexperimental-new-constant-interpreter
1543
1544Enable the experimental new constant interpreter
1545
Richard Smith081ad4d2017-01-24 19:39:46 +00001546.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1547
Richard Smith081ad4d2017-01-24 19:39:46 +00001548.. option:: -ffast-math, -fno-fast-math
1549
1550Allow aggressive, lossy floating-point optimizations
1551
Craig Topper9624beb2020-03-10 11:08:19 -07001552.. option:: -ffile-prefix-map=<arg>
1553
1554remap file source paths in debug info and predefined preprocessor macros
1555
Richard Smith081ad4d2017-01-24 19:39:46 +00001556.. option:: -ffinite-math-only, -fno-finite-math-only
1557
Vedant Kumar368540f2018-08-23 17:55:03 +00001558.. option:: -ffixed-point, -fno-fixed-point
1559
1560Enable fixed point types
1561
Richard Smith081ad4d2017-01-24 19:39:46 +00001562.. option:: -ffor-scope, -fno-for-scope
1563
Craig Topper9624beb2020-03-10 11:08:19 -07001564.. option:: -fforce-dwarf-frame, -fno-force-dwarf-frame
1565
1566Always emit a debug frame section
1567
Vedant Kumar368540f2018-08-23 17:55:03 +00001568.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1569
1570Emits more virtual tables to improve devirtualization
1571
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001572.. option:: -fforce-enable-int128, -fno-force-enable-int128
1573
1574Enable support for int128\_t type
1575
Richard Smith081ad4d2017-01-24 19:39:46 +00001576.. option:: -ffp-contract=<arg>
1577
Craig Topper9624beb2020-03-10 11:08:19 -07001578Form 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.
1579
1580.. option:: -ffp-exception-behavior=<arg>
1581
1582Specifies the exception behavior of floating-point operations.
1583
1584.. option:: -ffp-model=<arg>
1585
1586Controls the semantics of floating-point calculations.
Richard Smith081ad4d2017-01-24 19:39:46 +00001587
Richard Smith081ad4d2017-01-24 19:39:46 +00001588.. option:: -ffreestanding
1589
1590Assert that the compilation takes place in a freestanding environment
1591
Richard Smith081ad4d2017-01-24 19:39:46 +00001592.. option:: -ffunction-sections, -fno-function-sections
1593
Craig Topper9624beb2020-03-10 11:08:19 -07001594Place each function in its own section
Richard Smith081ad4d2017-01-24 19:39:46 +00001595
Richard Smith081ad4d2017-01-24 19:39:46 +00001596.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1597
Richard Smith081ad4d2017-01-24 19:39:46 +00001598.. option:: -fgnu-keywords, -fno-gnu-keywords
1599
1600Allow GNU-extension keywords regardless of language standard
1601
Richard Smith081ad4d2017-01-24 19:39:46 +00001602.. option:: -fgnu-runtime
1603
1604Generate output compatible with the standard GNU Objective-C runtime
1605
Richard Smith081ad4d2017-01-24 19:39:46 +00001606.. option:: -fgnu89-inline, -fno-gnu89-inline
1607
1608Use the gnu89 inline semantics
1609
Craig Topper9624beb2020-03-10 11:08:19 -07001610.. option:: -fgnuc-version=<arg>
1611
1612Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)
1613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1615
Richard Smith081ad4d2017-01-24 19:39:46 +00001616.. option:: -fhonor-nans, -fno-honor-nans
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -fhosted
1619
Craig Topper9624beb2020-03-10 11:08:19 -07001620.. option:: -fignore-exceptions
1621
1622Enable support for ignoring exception handling constructs
1623
Richard Smith081ad4d2017-01-24 19:39:46 +00001624.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1625
1626Implicitly search the file system for module map files.
1627
Richard Smith081ad4d2017-01-24 19:39:46 +00001628.. option:: -fimplicit-modules, -fno-implicit-modules
1629
Richard Smith081ad4d2017-01-24 19:39:46 +00001630.. option:: -finput-charset=<arg>
1631
Craig Topper188252d2017-12-11 21:09:16 +00001632.. option:: -finstrument-function-entry-bare
1633
1634Instrument function entry only, after inlining, without arguments to the instrumentation call
1635
Richard Smith081ad4d2017-01-24 19:39:46 +00001636.. option:: -finstrument-functions
1637
1638Generate calls to instrument function entry and exit
1639
Craig Topper16418662017-11-20 18:07:43 +00001640.. option:: -finstrument-functions-after-inlining
1641
1642Like -finstrument-functions, but insert the calls after inlining
1643
Richard Smith081ad4d2017-01-24 19:39:46 +00001644.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1645
1646Enable the integrated assembler
1647
Craig Topper9624beb2020-03-10 11:08:19 -07001648.. option:: -fintegrated-cc1, -fno-integrated-cc1
1649
1650Run cc1 in-process
1651
Richard Smith081ad4d2017-01-24 19:39:46 +00001652.. option:: -fjump-tables, -fno-jump-tables
1653
Vedant Kumar368540f2018-08-23 17:55:03 +00001654.. option:: -fkeep-static-consts
1655
1656Keep static const variables even if unused
1657
Craig Topper9624beb2020-03-10 11:08:19 -07001658.. option:: -flax-vector-conversions=<arg>, -flax-vector-conversions (equivalent to -flax-vector-conversions=integer), -fno-lax-vector-conversions (equivalent to -flax-vector-conversions=none)
1659
1660Enable implicit vector bit-casts
Richard Smith081ad4d2017-01-24 19:39:46 +00001661
Richard Smith081ad4d2017-01-24 19:39:46 +00001662.. option:: -flimited-precision=<arg>
1663
Richard Smith081ad4d2017-01-24 19:39:46 +00001664.. option:: -flto, -fno-lto
1665
1666Enable LTO in 'full' mode
1667
Richard Smith081ad4d2017-01-24 19:39:46 +00001668.. option:: -flto-jobs=<arg>
1669
1670Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1671
Richard Smithb2c82a62017-01-27 01:54:42 +00001672.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001673.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001674.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001675
1676Set LTO mode to either 'full' or 'thin'
1677
Richard Smith081ad4d2017-01-24 19:39:46 +00001678.. option:: -fmacro-backtrace-limit=<arg>
1679
Richard Smith081ad4d2017-01-24 19:39:46 +00001680.. option:: -fmath-errno, -fno-math-errno
1681
1682Require math functions to indicate errors by setting errno
1683
Craig Topper9624beb2020-03-10 11:08:19 -07001684.. option:: -fmax-tokens=<arg>
1685
1686Max total number of preprocessed tokens for -Wmax-tokens.
1687
Richard Smith081ad4d2017-01-24 19:39:46 +00001688.. option:: -fmax-type-align=<arg>
1689
1690Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1691
Richard Smith081ad4d2017-01-24 19:39:46 +00001692.. option:: -fmerge-all-constants, -fno-merge-all-constants
1693
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001694Allow merging of constants
1695
Richard Smith081ad4d2017-01-24 19:39:46 +00001696.. option:: -fmessage-length=<arg>
1697
Richard Smith081ad4d2017-01-24 19:39:46 +00001698.. option:: -fmodule-file-deps, -fno-module-file-deps
1699
Richard Smith081ad4d2017-01-24 19:39:46 +00001700.. option:: -fmodule-map-file=<file>
1701
1702Load this module map file
1703
Richard Smith081ad4d2017-01-24 19:39:46 +00001704.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1705
1706Specify the name of the module to build
1707
Richard Smith081ad4d2017-01-24 19:39:46 +00001708.. option:: -fmodules, -fno-modules
1709
1710Enable the 'modules' language feature
1711
Richard Smith081ad4d2017-01-24 19:39:46 +00001712.. option:: -fmodules-decluse, -fno-modules-decluse
1713
1714Require declaration of modules used within a module
1715
Richard Smith081ad4d2017-01-24 19:39:46 +00001716.. option:: -fmodules-ignore-macro=<arg>
1717
1718Ignore the definition of the given macro when building and loading modules
1719
Richard Smith081ad4d2017-01-24 19:39:46 +00001720.. option:: -fmodules-search-all, -fno-modules-search-all
1721
1722Search even non-imported modules to resolve references
1723
Richard Smith081ad4d2017-01-24 19:39:46 +00001724.. option:: -fmodules-strict-decluse
1725
1726Like -fmodules-decluse but requires all headers to be in modules
1727
Richard Smith081ad4d2017-01-24 19:39:46 +00001728.. option:: -fmodules-ts
1729
1730Enable support for the C++ Modules TS
1731
Craig Topper9624beb2020-03-10 11:08:19 -07001732.. option:: -fmodules-validate-input-files-content
1733
1734Validate PCM input files based on content if mtime differs
1735
Richard Smith081ad4d2017-01-24 19:39:46 +00001736.. option:: -fms-compatibility, -fno-ms-compatibility
1737
1738Enable full Microsoft Visual C++ compatibility
1739
Richard Smith081ad4d2017-01-24 19:39:46 +00001740.. option:: -fms-compatibility-version=<arg>
1741
1742Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1743
Richard Smith081ad4d2017-01-24 19:39:46 +00001744.. option:: -fms-extensions, -fno-ms-extensions
1745
1746Accept some non-standard constructs supported by the Microsoft compiler
1747
Richard Smith081ad4d2017-01-24 19:39:46 +00001748.. option:: -fms-memptr-rep=<arg>
1749
Craig Topper9624beb2020-03-10 11:08:19 -07001750.. option:: -fms-volatile
Richard Smith081ad4d2017-01-24 19:39:46 +00001751
Richard Smith081ad4d2017-01-24 19:39:46 +00001752.. option:: -fmsc-version=<arg>
1753
1754Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1755
Richard Smith081ad4d2017-01-24 19:39:46 +00001756.. option:: -fmudflap
1757
Richard Smith081ad4d2017-01-24 19:39:46 +00001758.. option:: -fmudflapth
1759
Richard Smith081ad4d2017-01-24 19:39:46 +00001760.. option:: -fnested-functions
1761
Richard Smith081ad4d2017-01-24 19:39:46 +00001762.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1763
1764Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1765
Richard Smith081ad4d2017-01-24 19:39:46 +00001766.. option:: -fnext-runtime
1767
Richard Smith081ad4d2017-01-24 19:39:46 +00001768.. option:: -fno-builtin-<arg>
1769
1770Disable implicit builtin knowledge of a specific function
1771
Richard Smith081ad4d2017-01-24 19:39:46 +00001772.. option:: -fno-elide-type
1773
1774Do not elide types when printing diagnostics
1775
Richard Smith081ad4d2017-01-24 19:39:46 +00001776.. option:: -fno-max-type-align
1777
Richard Smith081ad4d2017-01-24 19:39:46 +00001778.. option:: -fno-operator-names
1779
1780Do not treat C++ operator name keywords as synonyms for operators
1781
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001782.. option:: -fno-rtti-data
1783
1784Control emission of RTTI data
1785
Richard Smith081ad4d2017-01-24 19:39:46 +00001786.. option:: -fno-strict-modules-decluse
1787
Craig Topper9624beb2020-03-10 11:08:19 -07001788.. option:: -fno-temp-file
1789
1790Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes
1791
1792.. option:: -fno-virtual-function\_elimination
1793
Richard Smith081ad4d2017-01-24 19:39:46 +00001794.. option:: -fno-working-directory
1795
Craig Topper9624beb2020-03-10 11:08:19 -07001796.. option:: -fno\_modules-validate-input-files-content
1797
1798.. program:: clang1
1799.. option:: -fno\_pch-validate-input-files-content
1800.. program:: clang
1801
1802.. option:: -fnostack-clash-protection
1803
1804Disable stack clash protection
1805
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001806.. option:: -fnoxray-link-deps
1807
Richard Smith081ad4d2017-01-24 19:39:46 +00001808.. option:: -fobjc-abi-version=<arg>
1809
Richard Smith081ad4d2017-01-24 19:39:46 +00001810.. option:: -fobjc-arc, -fno-objc-arc
1811
1812Synthesize retain and release calls for Objective-C pointers
1813
Richard Smith081ad4d2017-01-24 19:39:46 +00001814.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1815
1816Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1817
Craig Topper9624beb2020-03-10 11:08:19 -07001818.. option:: -fobjc-convert-messages-to-runtime-calls, -fno-objc-convert-messages-to-runtime-calls
1819
Richard Smith081ad4d2017-01-24 19:39:46 +00001820.. option:: -fobjc-exceptions, -fno-objc-exceptions
1821
1822Enable Objective-C exceptions
1823
Richard Smith081ad4d2017-01-24 19:39:46 +00001824.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1825
Richard Smith081ad4d2017-01-24 19:39:46 +00001826.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1827
Richard Smith081ad4d2017-01-24 19:39:46 +00001828.. option:: -fobjc-link-runtime
1829
Richard Smith081ad4d2017-01-24 19:39:46 +00001830.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1831
Richard Smith081ad4d2017-01-24 19:39:46 +00001832.. option:: -fobjc-nonfragile-abi-version=<arg>
1833
Richard Smith081ad4d2017-01-24 19:39:46 +00001834.. option:: -fobjc-runtime=<arg>
1835
1836Specify the target Objective-C runtime kind and version
1837
Richard Smith081ad4d2017-01-24 19:39:46 +00001838.. option:: -fobjc-sender-dependent-dispatch
1839
Richard Smith081ad4d2017-01-24 19:39:46 +00001840.. option:: -fobjc-weak, -fno-objc-weak
1841
1842Enable ARC-style weak references in Objective-C
1843
Richard Smith081ad4d2017-01-24 19:39:46 +00001844.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1845
Richard Smith081ad4d2017-01-24 19:39:46 +00001846.. option:: -fopenmp, -fno-openmp
1847
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001848Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001849
Craig Topper287c8012018-01-03 18:29:12 +00001850.. option:: -fopenmp-simd, -fno-openmp-simd
1851
1852Emit OpenMP code only for SIMD-based constructs.
1853
Richard Smith081ad4d2017-01-24 19:39:46 +00001854.. option:: -fopenmp-version=<arg>
1855
Richard Smithb2c82a62017-01-27 01:54:42 +00001856.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001857.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001858.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001859
Richard Smith081ad4d2017-01-24 19:39:46 +00001860.. option:: -foperator-arrow-depth=<arg>
1861
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001862.. option:: -foptimization-record-file=<file>
Richard Smith081ad4d2017-01-24 19:39:46 +00001863
Craig Topper9624beb2020-03-10 11:08:19 -07001864Specify 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 -08001865
1866.. option:: -foptimization-record-passes=<regex>
1867
1868Only 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 +00001869
Richard Smith081ad4d2017-01-24 19:39:46 +00001870.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1871
Craig Topper9624beb2020-03-10 11:08:19 -07001872.. option:: -forder-file-instrumentation
1873
1874Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1875
Richard Smith081ad4d2017-01-24 19:39:46 +00001876.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1877
Richard Smith081ad4d2017-01-24 19:39:46 +00001878.. option:: -fpack-struct, -fno-pack-struct
1879
Richard Smithb2c82a62017-01-27 01:54:42 +00001880.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001881.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001882.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001883
1884Specify the default maximum struct packing alignment
1885
Richard Smith081ad4d2017-01-24 19:39:46 +00001886.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1887
1888Recognize and construct Pascal-style string literals
1889
Craig Topper9624beb2020-03-10 11:08:19 -07001890.. option:: -fpass-plugin=<dsopath>
1891
1892Load pass plugin from a dynamic shared object file (only with new pass manager).
1893
1894.. option:: -fpatchable-function-entry=<N,M>
1895
1896Generate M NOPs before function entry and N-M NOPs after function entry
1897
Richard Smith081ad4d2017-01-24 19:39:46 +00001898.. option:: -fpcc-struct-return
1899
1900Override the default ABI to return all structs on the stack
1901
Richard Smith081ad4d2017-01-24 19:39:46 +00001902.. option:: -fpch-preprocess
1903
Craig Topper9624beb2020-03-10 11:08:19 -07001904.. option:: -fpch-validate-input-files-content
1905
1906Validate PCH input files based on content if mtime differs
1907
Richard Smith081ad4d2017-01-24 19:39:46 +00001908.. option:: -fpic, -fno-pic
1909
Richard Smith081ad4d2017-01-24 19:39:46 +00001910.. option:: -fpie, -fno-pie
1911
Craig Topper16418662017-11-20 18:07:43 +00001912.. option:: -fplt, -fno-plt
1913
1914Use the PLT to make function calls
1915
Richard Smith081ad4d2017-01-24 19:39:46 +00001916.. option:: -fplugin=<dsopath>
1917
1918Load the named plugin (dynamic shared object)
1919
Richard Smith081ad4d2017-01-24 19:39:46 +00001920.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1921
Richard Smith081ad4d2017-01-24 19:39:46 +00001922.. option:: -fprofile-arcs, -fno-profile-arcs
1923
Richard Smith081ad4d2017-01-24 19:39:46 +00001924.. option:: -fprofile-dir=<arg>
1925
Craig Topper9624beb2020-03-10 11:08:19 -07001926.. option:: -fprofile-exclude-files=<arg>
1927
1928Instrument only functions from files where names don't match all the regexes separated by a semi-colon
1929
1930.. option:: -fprofile-filter-files=<arg>
1931
1932Instrument only functions from files where names match any regex separated by a semi-colon
1933
Richard Smith081ad4d2017-01-24 19:39:46 +00001934.. option:: -fprofile-generate, -fno-profile-generate
1935
1936Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1937
Richard Smithb2c82a62017-01-27 01:54:42 +00001938.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001939.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001940.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001941
1942Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1943
Richard Smith081ad4d2017-01-24 19:39:46 +00001944.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1945
1946Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1947
Richard Smithb2c82a62017-01-27 01:54:42 +00001948.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001949.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00001950.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001951
1952Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1953
Richard Smith081ad4d2017-01-24 19:39:46 +00001954.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1955
Richard Smithb2c82a62017-01-27 01:54:42 +00001956.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001957.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001958.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001959
1960Use instrumentation data for profile-guided optimization
1961
Craig Topper9624beb2020-03-10 11:08:19 -07001962.. option:: -fprofile-remapping-file=<file>, -fprofile-remapping-file <arg>
1963
1964Use the remappings described in <file> to match the profile data against names in the program
1965
Boris Kolpackovb150d242017-08-30 09:15:53 +00001966.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1967
1968Specifies that the sample profile is accurate. If the sample
1969 profile is accurate, callsites without profile samples are marked
1970 as cold. Otherwise, treat callsites without profile samples as if
1971 we have no profile
1972
Richard Smith78e23fd2017-04-13 22:39:49 +00001973.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1974
1975.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001976.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00001977.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001978
1979Enable sample-based profile guided optimizations
1980
Richard Smithb2c82a62017-01-27 01:54:42 +00001981.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001982.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00001983.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001984
1985Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1986
Richard Smith081ad4d2017-01-24 19:39:46 +00001987.. option:: -freciprocal-math, -fno-reciprocal-math
1988
1989Allow division operations to be reassociated
1990
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -freg-struct-return
1992
1993Override the default ABI to return small structs in registers
1994
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001995.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1996
1997Use atexit or \_\_cxa\_atexit to register global destructors
1998
Richard Smith081ad4d2017-01-24 19:39:46 +00001999.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
2000
2001Enable C++17 relaxed template template argument matching
2002
Richard Smith081ad4d2017-01-24 19:39:46 +00002003.. option:: -freroll-loops, -fno-reroll-loops
2004
2005Turn on loop reroller
2006
Richard Smith081ad4d2017-01-24 19:39:46 +00002007.. option:: -fretain-comments-from-system-headers
2008
Craig Topperd23254a2017-07-20 17:52:48 +00002009.. option:: -frewrite-imports, -fno-rewrite-imports
2010
Richard Smith081ad4d2017-01-24 19:39:46 +00002011.. option:: -frewrite-includes, -fno-rewrite-includes
2012
Richard Smith081ad4d2017-01-24 19:39:46 +00002013.. option:: -frewrite-map-file <arg>
2014
Richard Smithb2c82a62017-01-27 01:54:42 +00002015.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002016.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002017.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002018
Richard Smith081ad4d2017-01-24 19:39:46 +00002019.. option:: -fropi, -fno-ropi
2020
Craig Topper9624beb2020-03-10 11:08:19 -07002021.. option:: -frounding-math, -fno-rounding-math
2022
Richard Smith081ad4d2017-01-24 19:39:46 +00002023.. option:: -frtti, -fno-rtti
2024
Richard Smith081ad4d2017-01-24 19:39:46 +00002025.. option:: -frwpi, -fno-rwpi
2026
Richard Smith081ad4d2017-01-24 19:39:46 +00002027.. option:: -fsave-optimization-record, -fno-save-optimization-record
2028
2029Generate a YAML optimization record file
2030
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08002031.. program:: clang1
2032.. option:: -fsave-optimization-record=<format>
2033.. program:: clang
2034
Craig Topper9624beb2020-03-10 11:08:19 -07002035Generate an optimization record file in a specific format
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08002036
Craig Topper188252d2017-12-11 21:09:16 +00002037.. option:: -fseh-exceptions
2038
2039Use SEH style exceptions
2040
Craig Topper9624beb2020-03-10 11:08:19 -07002041.. option:: -fsemantic-interposition, -fno-semantic-interposition
2042
Richard Smith081ad4d2017-01-24 19:39:46 +00002043.. option:: -fshort-enums, -fno-short-enums
2044
2045Allocate to an enum type only as many bytes as it needs for the declared range of possible values
2046
Richard Smith081ad4d2017-01-24 19:39:46 +00002047.. option:: -fshort-wchar, -fno-short-wchar
2048
2049Force wchar\_t to be a short unsigned int
2050
Richard Smith081ad4d2017-01-24 19:39:46 +00002051.. option:: -fshow-column, -fno-show-column
2052
Richard Smith081ad4d2017-01-24 19:39:46 +00002053.. option:: -fshow-overloads=<arg>
2054
2055Which overload candidates to show when overload resolution fails: best\|all; defaults to all
2056
Richard Smith081ad4d2017-01-24 19:39:46 +00002057.. option:: -fshow-source-location, -fno-show-source-location
2058
Richard Smith081ad4d2017-01-24 19:39:46 +00002059.. option:: -fsignaling-math, -fno-signaling-math
2060
Richard Smith081ad4d2017-01-24 19:39:46 +00002061.. option:: -fsigned-bitfields
2062
Richard Smith081ad4d2017-01-24 19:39:46 +00002063.. option:: -fsigned-char, -fno-signed-char, --signed-char
2064
Richard Smith081ad4d2017-01-24 19:39:46 +00002065.. option:: -fsigned-zeros, -fno-signed-zeros
2066
Richard Smith081ad4d2017-01-24 19:39:46 +00002067.. option:: -fsized-deallocation, -fno-sized-deallocation
2068
2069Enable C++14 sized global deallocation functions
2070
Richard Smith081ad4d2017-01-24 19:39:46 +00002071.. option:: -fsjlj-exceptions
2072
2073Use SjLj style exceptions
2074
Richard Smith081ad4d2017-01-24 19:39:46 +00002075.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
2076
2077Enable the superword-level parallelism vectorization passes
2078
Richard Smith081ad4d2017-01-24 19:39:46 +00002079.. option:: -fspell-checking, -fno-spell-checking
2080
Richard Smith081ad4d2017-01-24 19:39:46 +00002081.. option:: -fspell-checking-limit=<arg>
2082
Richard Smith081ad4d2017-01-24 19:39:46 +00002083.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
2084
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002085Provide 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 +00002086
Craig Topper9624beb2020-03-10 11:08:19 -07002087.. option:: -fsplit-lto-unit, -fno-split-lto-unit
2088
2089Enables splitting of the LTO unit.
2090
Richard Smith081ad4d2017-01-24 19:39:46 +00002091.. option:: -fsplit-stack
2092
Craig Topper9624beb2020-03-10 11:08:19 -07002093.. option:: -fstack-clash-protection
2094
2095Enable stack clash protection
2096
Richard Smith081ad4d2017-01-24 19:39:46 +00002097.. option:: -fstack-protector, -fno-stack-protector
2098
Craig Topper9624beb2020-03-10 11:08:19 -07002099Enable 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 +00002100
Richard Smith081ad4d2017-01-24 19:39:46 +00002101.. option:: -fstack-protector-all
2102
Craig Topper9624beb2020-03-10 11:08:19 -07002103Enable stack protectors for all functions
Richard Smith081ad4d2017-01-24 19:39:46 +00002104
Richard Smith081ad4d2017-01-24 19:39:46 +00002105.. option:: -fstack-protector-strong
2106
Craig Topper9624beb2020-03-10 11:08:19 -07002107Enable 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 +00002108
Craig Topper596527b2018-01-23 18:40:15 +00002109.. option:: -fstack-size-section, -fno-stack-size-section
2110
2111Emit section containing metadata on function stack sizes
2112
Richard Smith081ad4d2017-01-24 19:39:46 +00002113.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
2114
2115Emit full debug info for all types used by the program
2116
Richard Smith081ad4d2017-01-24 19:39:46 +00002117.. option:: -fstrict-aliasing, -fno-strict-aliasing
2118
Richard Smith081ad4d2017-01-24 19:39:46 +00002119.. option:: -fstrict-enums, -fno-strict-enums
2120
2121Enable optimizations based on the strict definition of an enum's value range
2122
Vedant Kumar368540f2018-08-23 17:55:03 +00002123.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
2124
2125Assume that overflowing float-to-int casts are undefined (default)
2126
Richard Smith081ad4d2017-01-24 19:39:46 +00002127.. option:: -fstrict-overflow, -fno-strict-overflow
2128
Richard Smith081ad4d2017-01-24 19:39:46 +00002129.. option:: -fstrict-return, -fno-strict-return
2130
Richard Smith78e23fd2017-04-13 22:39:49 +00002131Always treat control flow paths that fall off the end of a non-void function as unreachable
Richard Smith081ad4d2017-01-24 19:39:46 +00002132
Richard Smith081ad4d2017-01-24 19:39:46 +00002133.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
2134
2135Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
2136
Richard Smith081ad4d2017-01-24 19:39:46 +00002137.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
2138
Craig Topper9624beb2020-03-10 11:08:19 -07002139.. option:: -fsymbol-partition=<arg>
2140
Richard Smith081ad4d2017-01-24 19:39:46 +00002141.. option:: -ftabstop=<arg>
2142
Richard Smith081ad4d2017-01-24 19:39:46 +00002143.. option:: -ftemplate-backtrace-limit=<arg>
2144
Richard Smith081ad4d2017-01-24 19:39:46 +00002145.. option:: -ftemplate-depth-<arg>
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -ftemplate-depth=<arg>
2148
Richard Smith081ad4d2017-01-24 19:39:46 +00002149.. option:: -ftest-coverage
2150
Craig Topper9624beb2020-03-10 11:08:19 -07002151.. option:: -fthin-link-bitcode=<arg>
2152
2153Write minimized bitcode to <file> for the ThinLTO thin link only
2154
Richard Smith081ad4d2017-01-24 19:39:46 +00002155.. option:: -fthinlto-index=<arg>
2156
2157Perform ThinLTO importing using provided function summary index
2158
Richard Smith081ad4d2017-01-24 19:39:46 +00002159.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
2160
Richard Smith081ad4d2017-01-24 19:39:46 +00002161.. option:: -ftime-report
2162
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00002163.. option:: -ftime-trace
2164
Craig Topper9624beb2020-03-10 11:08:19 -07002165
2166Turn on time profiler. Generates JSON file based on output filename. Results
2167can be analyzed with chrome://tracing or `Speedscope App
2168<https://www.speedscope.app>`_ for flamegraph visualization.
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00002169
2170.. option:: -ftime-trace-granularity=<arg>
2171
2172Minimum time granularity (in microseconds) traced by time profiler
2173
Richard Smith081ad4d2017-01-24 19:39:46 +00002174.. option:: -ftls-model=<arg>
2175
Richard Smith081ad4d2017-01-24 19:39:46 +00002176.. option:: -ftrap-function=<arg>
2177
2178Issue call to specified function rather than a trap instruction
2179
Richard Smith081ad4d2017-01-24 19:39:46 +00002180.. option:: -ftrapping-math, -fno-trapping-math
2181
Richard Smith081ad4d2017-01-24 19:39:46 +00002182.. option:: -ftrapv
2183
2184Trap on integer overflow
2185
Richard Smith081ad4d2017-01-24 19:39:46 +00002186.. option:: -ftrapv-handler <arg>
2187
Richard Smithb2c82a62017-01-27 01:54:42 +00002188.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002189.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00002190.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002191
2192Specify the function to be called on overflow
2193
Richard Smith081ad4d2017-01-24 19:39:46 +00002194.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
2195
2196Process trigraph sequences
2197
Craig Topper9624beb2020-03-10 11:08:19 -07002198.. option:: -ftrivial-auto-var-init=<arg>
2199
2200Initialize trivial automatic stack variables: uninitialized (default) \| pattern
2201
Richard Smith081ad4d2017-01-24 19:39:46 +00002202.. option:: -funique-section-names, -fno-unique-section-names
2203
Craig Topper9624beb2020-03-10 11:08:19 -07002204Use unique names for text and data sections
Richard Smith081ad4d2017-01-24 19:39:46 +00002205
Richard Smith081ad4d2017-01-24 19:39:46 +00002206.. option:: -funit-at-a-time, -fno-unit-at-a-time
2207
Richard Smith081ad4d2017-01-24 19:39:46 +00002208.. option:: -funroll-loops, -fno-unroll-loops
2209
2210Turn on loop unroller
2211
Richard Smith081ad4d2017-01-24 19:39:46 +00002212.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
2213
Richard Smith081ad4d2017-01-24 19:39:46 +00002214.. option:: -funsigned-bitfields
2215
Richard Smith081ad4d2017-01-24 19:39:46 +00002216.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
2217
Richard Smith081ad4d2017-01-24 19:39:46 +00002218.. option:: -funwind-tables, -fno-unwind-tables
2219
Richard Smith081ad4d2017-01-24 19:39:46 +00002220.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
2221
Richard Smith081ad4d2017-01-24 19:39:46 +00002222.. option:: -fuse-init-array, -fno-use-init-array
2223
2224Use .init\_array instead of .ctors
2225
Richard Smith081ad4d2017-01-24 19:39:46 +00002226.. option:: -fuse-ld=<arg>
2227
Richard Smith081ad4d2017-01-24 19:39:46 +00002228.. option:: -fuse-line-directives, -fno-use-line-directives
2229
Craig Topper9624beb2020-03-10 11:08:19 -07002230.. option:: -fvalidate-ast-input-files-content
2231
2232Compute 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
2233
Richard Smith081ad4d2017-01-24 19:39:46 +00002234.. option:: -fveclib=<arg>
2235
2236Use the given vector functions library
2237
Richard Smith081ad4d2017-01-24 19:39:46 +00002238.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2239
2240Enable the loop vectorization passes
2241
Craig Topper9624beb2020-03-10 11:08:19 -07002242.. option:: -fverbose-asm, -dA, -fno-verbose-asm
2243
2244.. option:: -fvirtual-function-elimination
2245
2246Enables dead virtual function elimination optimization. Requires -flto=full
2247
2248.. option:: -fvisibility-global-new-delete-hidden
2249
2250Give global C++ operator new and delete declarations hidden visibility
Richard Smith081ad4d2017-01-24 19:39:46 +00002251
Richard Smith081ad4d2017-01-24 19:39:46 +00002252.. option:: -fvisibility-inlines-hidden
2253
Fangrui Songdf81b972018-07-19 22:45:41 +00002254Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00002255
Richard Smith081ad4d2017-01-24 19:39:46 +00002256.. option:: -fvisibility-ms-compat
2257
2258Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2259
Richard Smith081ad4d2017-01-24 19:39:46 +00002260.. option:: -fvisibility=<arg>
2261
2262Set the default symbol visibility for all global declarations
2263
Craig Topper9624beb2020-03-10 11:08:19 -07002264.. option:: -fwasm-exceptions
2265
2266Use WebAssembly style exceptions
2267
Richard Smith081ad4d2017-01-24 19:39:46 +00002268.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2269
2270Enables whole-program vtable optimization. Requires -flto
2271
Richard Smith081ad4d2017-01-24 19:39:46 +00002272.. option:: -fwrapv, -fno-wrapv
2273
2274Treat signed integer overflow as two's complement
2275
Richard Smith081ad4d2017-01-24 19:39:46 +00002276.. option:: -fwritable-strings
2277
2278Store string literals as writable data
2279
Craig Topper188252d2017-12-11 21:09:16 +00002280.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2281
2282Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2283
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002284.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2285
2286Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2287
Richard Smith78e23fd2017-04-13 22:39:49 +00002288.. option:: -fxray-always-instrument=<arg>
2289
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002290DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2291
2292.. option:: -fxray-attr-list=<arg>
2293
2294Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002295
Craig Topper9624beb2020-03-10 11:08:19 -07002296.. option:: -fxray-ignore-loops, -fno-xray-ignore-loops
2297
2298Don't instrument functions with loops unless they also meet the minimum function size
2299
Richard Smith081ad4d2017-01-24 19:39:46 +00002300.. option:: -fxray-instruction-threshold<arg>
2301
Richard Smithb2c82a62017-01-27 01:54:42 +00002302.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002303.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002304.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002305
2306Sets the minimum function size to instrument with XRay
2307
Richard Smith081ad4d2017-01-24 19:39:46 +00002308.. option:: -fxray-instrument, -fno-xray-instrument
2309
2310Generate XRay instrumentation sleds on function entry and exit
2311
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002312.. option:: -fxray-instrumentation-bundle=<arg>
2313
Craig Topper9624beb2020-03-10 11:08:19 -07002314Select 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 +00002315
2316.. option:: -fxray-link-deps
2317
2318Tells clang to add the link dependencies for XRay.
2319
2320.. option:: -fxray-modes=<arg>
2321
2322List of modes to link in by default into XRay instrumented binaries.
2323
Richard Smith78e23fd2017-04-13 22:39:49 +00002324.. option:: -fxray-never-instrument=<arg>
2325
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002326DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002327
Richard Smith081ad4d2017-01-24 19:39:46 +00002328.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2329
Richard Smith081ad4d2017-01-24 19:39:46 +00002330.. option:: -fzvector, -fno-zvector, -mzvector
2331
2332Enable System z vector language extension
2333
Richard Smith081ad4d2017-01-24 19:39:46 +00002334.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2335
Richard Smith081ad4d2017-01-24 19:39:46 +00002336.. option:: -pedantic-errors, --pedantic-errors
2337
2338OpenCL flags
2339------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002340.. option:: -cl-denorms-are-zero
2341
2342OpenCL only. Allow denormals to be flushed to zero.
2343
Richard Smith081ad4d2017-01-24 19:39:46 +00002344.. option:: -cl-fast-relaxed-math
2345
2346OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2347
Richard Smith081ad4d2017-01-24 19:39:46 +00002348.. option:: -cl-finite-math-only
2349
2350OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2351
Richard Smith081ad4d2017-01-24 19:39:46 +00002352.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2353
2354OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2355
Richard Smith081ad4d2017-01-24 19:39:46 +00002356.. option:: -cl-kernel-arg-info
2357
2358OpenCL only. Generate kernel argument metadata.
2359
Richard Smith081ad4d2017-01-24 19:39:46 +00002360.. option:: -cl-mad-enable
2361
2362OpenCL only. Allow use of less precise MAD computations in the generated binary.
2363
Richard Smith081ad4d2017-01-24 19:39:46 +00002364.. option:: -cl-no-signed-zeros
2365
2366OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2367
Richard Smith081ad4d2017-01-24 19:39:46 +00002368.. option:: -cl-opt-disable
2369
2370OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2371
Richard Smith081ad4d2017-01-24 19:39:46 +00002372.. option:: -cl-single-precision-constant
2373
2374OpenCL only. Treat double precision floating-point constant as single precision constant.
2375
Richard Smith081ad4d2017-01-24 19:39:46 +00002376.. option:: -cl-std=<arg>
2377
2378OpenCL language standard to compile for.
2379
Richard Smith081ad4d2017-01-24 19:39:46 +00002380.. option:: -cl-strict-aliasing
2381
2382OpenCL only. This option is added for compatibility with OpenCL 1.0.
2383
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002384.. option:: -cl-uniform-work-group-size
2385
2386OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2387
Richard Smith081ad4d2017-01-24 19:39:46 +00002388.. option:: -cl-unsafe-math-optimizations
2389
2390OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2391
Craig Topper9624beb2020-03-10 11:08:19 -07002392SYCL flags
2393----------
2394.. option:: -fsycl, -fno-sycl
2395
2396Enable SYCL kernels compilation for device
2397
2398.. option:: -sycl-std=<arg>
2399
2400SYCL language standard to compile for.
2401
Richard Smith081ad4d2017-01-24 19:39:46 +00002402Target-dependent compilation options
2403~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smithc5b2e002017-01-27 02:08:37 +00002404.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2405
2406Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2407
Craig Topper9624beb2020-03-10 11:08:19 -07002408.. option:: -ffixed-x1
2409
2410Reserve the 1 register (AArch64/RISC-V only)
2411
2412.. option:: -ffixed-x10
2413
2414Reserve the 10 register (AArch64/RISC-V only)
2415
2416.. option:: -ffixed-x11
2417
2418Reserve the 11 register (AArch64/RISC-V only)
2419
2420.. option:: -ffixed-x12
2421
2422Reserve the 12 register (AArch64/RISC-V only)
2423
2424.. option:: -ffixed-x13
2425
2426Reserve the 13 register (AArch64/RISC-V only)
2427
2428.. option:: -ffixed-x14
2429
2430Reserve the 14 register (AArch64/RISC-V only)
2431
2432.. option:: -ffixed-x15
2433
2434Reserve the 15 register (AArch64/RISC-V only)
2435
2436.. option:: -ffixed-x16
2437
2438Reserve the 16 register (AArch64/RISC-V only)
2439
2440.. option:: -ffixed-x17
2441
2442Reserve the 17 register (AArch64/RISC-V only)
2443
2444.. option:: -ffixed-x18
2445
2446Reserve the 18 register (AArch64/RISC-V only)
2447
2448.. option:: -ffixed-x19
2449
2450Reserve the 19 register (AArch64/RISC-V only)
2451
2452.. option:: -ffixed-x2
2453
2454Reserve the 2 register (AArch64/RISC-V only)
2455
2456.. option:: -ffixed-x20
2457
2458Reserve the 20 register (AArch64/RISC-V only)
2459
2460.. option:: -ffixed-x21
2461
2462Reserve the 21 register (AArch64/RISC-V only)
2463
2464.. option:: -ffixed-x22
2465
2466Reserve the 22 register (AArch64/RISC-V only)
2467
2468.. option:: -ffixed-x23
2469
2470Reserve the 23 register (AArch64/RISC-V only)
2471
2472.. option:: -ffixed-x24
2473
2474Reserve the 24 register (AArch64/RISC-V only)
2475
2476.. option:: -ffixed-x25
2477
2478Reserve the 25 register (AArch64/RISC-V only)
2479
2480.. option:: -ffixed-x26
2481
2482Reserve the 26 register (AArch64/RISC-V only)
2483
2484.. option:: -ffixed-x27
2485
2486Reserve the 27 register (AArch64/RISC-V only)
2487
2488.. option:: -ffixed-x28
2489
2490Reserve the 28 register (AArch64/RISC-V only)
2491
2492.. option:: -ffixed-x29
2493
2494Reserve the 29 register (AArch64/RISC-V only)
2495
2496.. option:: -ffixed-x3
2497
2498Reserve the 3 register (AArch64/RISC-V only)
2499
2500.. option:: -ffixed-x30
2501
2502Reserve the 30 register (AArch64/RISC-V only)
2503
2504.. option:: -ffixed-x31
2505
2506Reserve the 31 register (AArch64/RISC-V only)
2507
2508.. option:: -ffixed-x4
2509
2510Reserve the 4 register (AArch64/RISC-V only)
2511
2512.. option:: -ffixed-x5
2513
2514Reserve the 5 register (AArch64/RISC-V only)
2515
2516.. option:: -ffixed-x6
2517
2518Reserve the 6 register (AArch64/RISC-V only)
2519
2520.. option:: -ffixed-x7
2521
2522Reserve the 7 register (AArch64/RISC-V only)
2523
2524.. option:: -ffixed-x8
2525
2526Reserve the 8 register (AArch64/RISC-V only)
2527
2528.. option:: -ffixed-x9
2529
2530Reserve the 9 register (AArch64/RISC-V only)
2531
Richard Smith081ad4d2017-01-24 19:39:46 +00002532.. option:: -m16
2533
Richard Smith081ad4d2017-01-24 19:39:46 +00002534.. option:: -m32
2535
Richard Smith081ad4d2017-01-24 19:39:46 +00002536.. option:: -m64
2537
Richard Smith081ad4d2017-01-24 19:39:46 +00002538.. option:: -mabi=<arg>
2539
Craig Topper9624beb2020-03-10 11:08:19 -07002540.. option:: -malign-branch-boundary=<arg>
2541
2542Specify the boundary's size to align branches
2543
2544.. option:: -malign-branch-prefix-size=<arg>
2545
2546.. option:: -malign-branch=<arg1>,<arg2>...
2547
2548Specify types of branches to align
2549
Richard Smith081ad4d2017-01-24 19:39:46 +00002550.. option:: -malign-double
2551
2552Align doubles to two words in structs (x86 only)
2553
Richard Smith081ad4d2017-01-24 19:39:46 +00002554.. option:: -march=<arg>
2555
Richard Smith081ad4d2017-01-24 19:39:46 +00002556.. option:: -masm=<arg>
2557
Richard Smith081ad4d2017-01-24 19:39:46 +00002558.. option:: -mbackchain, -mno-backchain
2559
2560Link stack frames through backchain on System Z
2561
Craig Topper9624beb2020-03-10 11:08:19 -07002562.. option:: -mbranches-within-32B-boundaries
2563
2564Align selected branches (fused, jcc, jmp) within 32-byte boundary
2565
2566.. option:: -mcmodel=<arg>, -mcmodel=medany (equivalent to -mcmodel=medium), -mcmodel=medlow (equivalent to -mcmodel=small)
Richard Smith081ad4d2017-01-24 19:39:46 +00002567
Richard Smith081ad4d2017-01-24 19:39:46 +00002568.. option:: -mconsole<arg>
2569
Craig Topper9624beb2020-03-10 11:08:19 -07002570.. program:: clang1
2571.. 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)
2572.. program:: clang
Ziang Wande94ac92019-06-25 23:57:14 +00002573
Vedant Kumar368540f2018-08-23 17:55:03 +00002574.. option:: -mcrc, -mno-crc
2575
2576Allow use of CRC instructions (ARM/Mips only)
2577
Craig Topperd23254a2017-07-20 17:52:48 +00002578.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2579
Richard Smith081ad4d2017-01-24 19:39:46 +00002580.. option:: -mdll<arg>
2581
Richard Smith081ad4d2017-01-24 19:39:46 +00002582.. option:: -mdynamic-no-pic<arg>
2583
Richard Smith081ad4d2017-01-24 19:39:46 +00002584.. option:: -meabi <arg>
2585
2586Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2587
Richard Smith78e23fd2017-04-13 22:39:49 +00002588.. option:: -mfentry
2589
Jonas Paulsson81aa62a2019-09-20 13:13:50 +00002590Insert calls to fentry at function entry (x86/SystemZ only)
Richard Smith78e23fd2017-04-13 22:39:49 +00002591
Richard Smith081ad4d2017-01-24 19:39:46 +00002592.. option:: -mfloat-abi=<arg>
2593
Richard Smith081ad4d2017-01-24 19:39:46 +00002594.. option:: -mfpmath=<arg>
2595
Richard Smith081ad4d2017-01-24 19:39:46 +00002596.. option:: -mfpu=<arg>
2597
Richard Smith081ad4d2017-01-24 19:39:46 +00002598.. option:: -mglobal-merge, -mno-global-merge
2599
2600Enable merging of globals
2601
Richard Smith081ad4d2017-01-24 19:39:46 +00002602.. option:: -mhard-float
2603
Richard Smith081ad4d2017-01-24 19:39:46 +00002604.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2605
Craig Topper9624beb2020-03-10 11:08:19 -07002606.. option:: -mhwmult=<arg>
2607
Richard Smith081ad4d2017-01-24 19:39:46 +00002608.. option:: -miamcu, -mno-iamcu
2609
2610Use Intel MCU ABI
2611
Richard Smith081ad4d2017-01-24 19:39:46 +00002612.. option:: -mimplicit-float, -mno-implicit-float
2613
Richard Smith081ad4d2017-01-24 19:39:46 +00002614.. option:: -mimplicit-it=<arg>
2615
Richard Smith081ad4d2017-01-24 19:39:46 +00002616.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2617
2618(integrated-as) Emit an object file which can be used with an incremental linker
2619
Richard Smith78e23fd2017-04-13 22:39:49 +00002620.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002621
Richard Smith081ad4d2017-01-24 19:39:46 +00002622.. option:: -mkernel
2623
Richard Smith081ad4d2017-01-24 19:39:46 +00002624.. option:: -mlong-calls, -mno-long-calls
2625
2626Generate branches with extended addressability, usually via indirect jumps.
2627
Craig Topperd23254a2017-07-20 17:52:48 +00002628.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002629
Craig Topper9624beb2020-03-10 11:08:19 -07002630Set Mac OS X deployment target
Richard Smith081ad4d2017-01-24 19:39:46 +00002631
Craig Topperd23254a2017-07-20 17:52:48 +00002632.. option:: -mmcu=<arg>
2633
Richard Smith081ad4d2017-01-24 19:39:46 +00002634.. option:: -mms-bitfields, -mno-ms-bitfields
2635
2636Set the default structure layout to be compatible with the Microsoft compiler standard
2637
Craig Topper9624beb2020-03-10 11:08:19 -07002638.. option:: -mnop-mcount
2639
2640Generate mcount/\_\_fentry\_\_ calls as nops. To activate they need to be patched in.
2641
Richard Smith081ad4d2017-01-24 19:39:46 +00002642.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2643
2644Omit frame pointer setup for leaf functions
2645
Richard Smith081ad4d2017-01-24 19:39:46 +00002646.. option:: -moslib=<arg>
2647
Craig Topper9624beb2020-03-10 11:08:19 -07002648.. option:: -mpacked-stack, -mno-packed-stack
2649
2650Use packed stack layout (SystemZ only).
2651
Richard Smith081ad4d2017-01-24 19:39:46 +00002652.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2653
2654Use copy relocations support for PIE builds
2655
Craig Topper9a724aa2017-12-11 21:09:19 +00002656.. option:: -mprefer-vector-width=<arg>
2657
2658Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2659
Richard Smith081ad4d2017-01-24 19:39:46 +00002660.. option:: -mqdsp6-compat
2661
2662Enable hexagon-qdsp6 backward compatibility
2663
Richard Smith081ad4d2017-01-24 19:39:46 +00002664.. option:: -mrecip
2665
Richard Smithb2c82a62017-01-27 01:54:42 +00002666.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002667.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002668.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002669
Craig Topper9624beb2020-03-10 11:08:19 -07002670.. option:: -mrecord-mcount
2671
2672Generate a \_\_mcount\_loc section entry for each \_\_fentry\_\_ call.
2673
Richard Smith081ad4d2017-01-24 19:39:46 +00002674.. option:: -mred-zone, -mno-red-zone
2675
Richard Smith081ad4d2017-01-24 19:39:46 +00002676.. option:: -mregparm=<arg>
2677
Richard Smith081ad4d2017-01-24 19:39:46 +00002678.. option:: -mrelax-all, -mno-relax-all
2679
2680(integrated-as) Relax all machine instructions
2681
Vedant Kumar368540f2018-08-23 17:55:03 +00002682.. option:: -mretpoline, -mno-retpoline
2683
Richard Smith081ad4d2017-01-24 19:39:46 +00002684.. option:: -mrtd, -mno-rtd
2685
2686Make StdCall calling convention the default
2687
Vedant Kumar368540f2018-08-23 17:55:03 +00002688.. option:: -msign-return-address=<arg>
2689
2690Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002691
Richard Smith081ad4d2017-01-24 19:39:46 +00002692.. option:: -msoft-float, -mno-soft-float
2693
2694Use software floating point
2695
Craig Topper9624beb2020-03-10 11:08:19 -07002696.. option:: -mspeculative-load-hardening, -mno-speculative-load-hardening
2697
Richard Smith081ad4d2017-01-24 19:39:46 +00002698.. option:: -mstack-alignment=<arg>
2699
2700Set the stack alignment
2701
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002702.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2703
2704Enable stack probes
2705
Richard Smith081ad4d2017-01-24 19:39:46 +00002706.. option:: -mstack-probe-size=<arg>
2707
2708Set the stack probe size
2709
Richard Smith081ad4d2017-01-24 19:39:46 +00002710.. option:: -mstackrealign, -mno-stackrealign
2711
2712Force realign the stack at entry to every function
2713
Richard Smith081ad4d2017-01-24 19:39:46 +00002714.. option:: -mthread-model <arg>
2715
2716The thread model to use, e.g. posix, single (posix by default)
2717
Richard Smith081ad4d2017-01-24 19:39:46 +00002718.. option:: -mthreads<arg>
2719
Richard Smith081ad4d2017-01-24 19:39:46 +00002720.. option:: -mthumb, -mno-thumb
2721
Craig Topper9624beb2020-03-10 11:08:19 -07002722.. option:: -mtls-direct-seg-refs, -mno-tls-direct-seg-refs
Richard Smith081ad4d2017-01-24 19:39:46 +00002723
Craig Topper9624beb2020-03-10 11:08:19 -07002724Enable direct TLS access through segment registers (default)
2725
2726.. option:: -mtls-size=<arg>
2727
2728Specify 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)
2729
2730.. program:: clang1
2731.. option:: -mtune=<arg>
2732.. program:: clang
Ziang Wande94ac92019-06-25 23:57:14 +00002733
Richard Smith78e23fd2017-04-13 22:39:49 +00002734.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002735
Richard Smith081ad4d2017-01-24 19:39:46 +00002736.. option:: -municode<arg>
2737
Richard Smith081ad4d2017-01-24 19:39:46 +00002738.. option:: -mvx, -mno-vx
2739
Richard Smith081ad4d2017-01-24 19:39:46 +00002740.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2741
Richard Smith78e23fd2017-04-13 22:39:49 +00002742.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002743
Craig Topper9624beb2020-03-10 11:08:19 -07002744.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2745
2746Wavefront size 64 is used
2747
Richard Smith081ad4d2017-01-24 19:39:46 +00002748.. option:: -mwindows<arg>
2749
Richard Smith081ad4d2017-01-24 19:39:46 +00002750.. option:: -mx32
2751
Richard Smith081ad4d2017-01-24 19:39:46 +00002752AARCH64
2753-------
Tri Vo28e7e602018-09-25 16:48:40 +00002754.. option:: -fcall-saved-x10
2755
2756Make the x10 register call-saved (AArch64 only)
2757
2758.. option:: -fcall-saved-x11
2759
2760Make the x11 register call-saved (AArch64 only)
2761
2762.. option:: -fcall-saved-x12
2763
2764Make the x12 register call-saved (AArch64 only)
2765
2766.. option:: -fcall-saved-x13
2767
2768Make the x13 register call-saved (AArch64 only)
2769
2770.. option:: -fcall-saved-x14
2771
2772Make the x14 register call-saved (AArch64 only)
2773
2774.. option:: -fcall-saved-x15
2775
2776Make the x15 register call-saved (AArch64 only)
2777
2778.. option:: -fcall-saved-x18
2779
2780Make the x18 register call-saved (AArch64 only)
2781
Craig Topper9624beb2020-03-10 11:08:19 -07002782.. option:: -fcall-saved-x8
2783
2784Make the x8 register call-saved (AArch64 only)
2785
2786.. option:: -fcall-saved-x9
2787
2788Make the x9 register call-saved (AArch64 only)
2789
Richard Smith081ad4d2017-01-24 19:39:46 +00002790.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2791
2792Workaround Cortex-A53 erratum 835769 (AArch64 only)
2793
Richard Smith081ad4d2017-01-24 19:39:46 +00002794.. option:: -mgeneral-regs-only
2795
2796Generate code which only uses the general purpose registers (AArch64 only)
2797
2798AMDGPU
2799------
Craig Topper9624beb2020-03-10 11:08:19 -07002800.. option:: -mcode-object-v3, -mno-code-object-v3
2801
2802Enable code object v3 (AMDGPU only)
2803
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002804.. option:: -mcumode, -mno-cumode
2805
Craig Topper9624beb2020-03-10 11:08:19 -07002806CU wavefront execution mode is used (AMDGPU only)
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002807
Craig Topper9624beb2020-03-10 11:08:19 -07002808.. option:: -msram-ecc, -mno-sram-ecc
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002809
Craig Topper9624beb2020-03-10 11:08:19 -07002810Enable SRAM ECC (AMDGPU only)
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002811
Craig Topper16418662017-11-20 18:07:43 +00002812.. option:: -mxnack, -mno-xnack
2813
2814Enable XNACK (AMDGPU only)
2815
Richard Smith081ad4d2017-01-24 19:39:46 +00002816ARM
2817---
Craig Topper9624beb2020-03-10 11:08:19 -07002818.. option:: -fAAPCSBitfieldLoad
2819
2820Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).
2821
Richard Smith081ad4d2017-01-24 19:39:46 +00002822.. option:: -ffixed-r9
2823
2824Reserve the r9 register (ARM only)
2825
Craig Topper9624beb2020-03-10 11:08:19 -07002826.. option:: -mcmse
Momchil Velikovac215352020-01-29 10:38:10 +00002827
Craig Topper9624beb2020-03-10 11:08:19 -07002828Allow use of CMSE (Armv8-M Security Extensions)
Momchil Velikovac215352020-01-29 10:38:10 +00002829
Richard Smith081ad4d2017-01-24 19:39:46 +00002830.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2831
2832Disallow generation of data access to code sections (ARM only)
2833
Richard Smith081ad4d2017-01-24 19:39:46 +00002834.. option:: -mno-movt
2835
2836Disallow use of movt/movw pairs (ARM only)
2837
Richard Smith78e23fd2017-04-13 22:39:49 +00002838.. option:: -mno-neg-immediates
2839
2840Disallow converting instructions with negative immediates to their negation or inversion.
2841
Richard Smith081ad4d2017-01-24 19:39:46 +00002842.. option:: -mnocrc
2843
2844Disallow use of CRC instructions (ARM only)
2845
Richard Smith081ad4d2017-01-24 19:39:46 +00002846.. option:: -mrestrict-it, -mno-restrict-it
2847
2848Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2849
Craig Topper16418662017-11-20 18:07:43 +00002850.. option:: -mtp=<arg>
2851
Craig Topper9624beb2020-03-10 11:08:19 -07002852Thread pointer access method (AArch32/AArch64 only)
Craig Topper16418662017-11-20 18:07:43 +00002853
Richard Smith081ad4d2017-01-24 19:39:46 +00002854.. option:: -munaligned-access, -mno-unaligned-access
2855
2856Allow memory accesses to be unaligned (AArch32/AArch64 only)
2857
2858Hexagon
2859-------
Craig Topper16418662017-11-20 18:07:43 +00002860.. option:: -mieee-rnd-near
2861
Vedant Kumar368540f2018-08-23 17:55:03 +00002862.. option:: -mmemops, -mno-memops
2863
2864Enable generation of memop instructions
2865
2866.. option:: -mnvj, -mno-nvj
2867
2868Enable generation of new-value jumps
2869
2870.. option:: -mnvs, -mno-nvs
2871
2872Enable generation of new-value stores
2873
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002874.. option:: -mpackets, -mno-packets
2875
2876Enable generation of instruction packets
2877
Craig Topper16418662017-11-20 18:07:43 +00002878Hexagon
2879-------
Richard Smith081ad4d2017-01-24 19:39:46 +00002880.. option:: -mhvx, -mno-hvx
2881
2882Enable Hexagon Vector eXtensions
2883
Craig Topper16418662017-11-20 18:07:43 +00002884.. option:: -mhvx-length=<arg>
2885
2886Set Hexagon Vector Length
2887
2888.. program:: clang1
2889.. option:: -mhvx=<arg>
2890.. program:: clang
2891
2892Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00002893
Vedant Kumar368540f2018-08-23 17:55:03 +00002894MIPS
2895----
2896.. option:: -mabicalls, -mno-abicalls
2897
2898Enable SVR4-style position-independent code (Mips only)
2899
2900.. option:: -mabs=<arg>
2901
2902.. option:: -mcheck-zero-division, -mno-check-zero-division
2903
2904.. option:: -mcompact-branches=<arg>
2905
2906.. option:: -mdouble-float
2907
2908.. option:: -mdsp, -mno-dsp
2909
2910.. option:: -mdspr2, -mno-dspr2
2911
2912.. option:: -membedded-data, -mno-embedded-data
2913
2914Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2915
2916.. option:: -mextern-sdata, -mno-extern-sdata
2917
2918Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2919
2920.. option:: -mfp32
2921
2922Use 32-bit floating point registers (MIPS only)
2923
2924.. option:: -mfp64
2925
2926Use 64-bit floating point registers (MIPS only)
2927
2928.. option:: -mginv, -mno-ginv
2929
2930.. option:: -mgpopt, -mno-gpopt
2931
2932Use GP relative accesses for symbols known to be in a small data section (MIPS)
2933
2934.. option:: -mindirect-jump=<arg>
2935
2936Change indirect jump instructions to inhibit speculation
2937
2938.. option:: -mips16
2939
2940.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2941
2942.. option:: -mlocal-sdata, -mno-local-sdata
2943
2944Extend the -G behaviour to object local data (MIPS)
2945
2946.. option:: -mmadd4, -mno-madd4
2947
2948Enable the generation of 4-operand madd.s, madd.d and related instructions.
2949
2950.. option:: -mmicromips, -mno-micromips
2951
2952.. option:: -mmsa, -mno-msa
2953
2954Enable MSA ASE (MIPS only)
2955
2956.. option:: -mmt, -mno-mt
2957
2958Enable MT ASE (MIPS only)
2959
2960.. option:: -mnan=<arg>
2961
2962.. option:: -mno-mips16
2963
2964.. option:: -msingle-float
2965
2966.. option:: -mvirt, -mno-virt
2967
2968.. option:: -mxgot, -mno-xgot
2969
Richard Smith081ad4d2017-01-24 19:39:46 +00002970PowerPC
2971-------
Richard Smith78e23fd2017-04-13 22:39:49 +00002972.. option:: -maltivec, -mno-altivec
2973
Richard Smith081ad4d2017-01-24 19:39:46 +00002974.. option:: -mcmpb, -mno-cmpb
2975
Richard Smith081ad4d2017-01-24 19:39:46 +00002976.. option:: -mcrbits, -mno-crbits
2977
Richard Smith081ad4d2017-01-24 19:39:46 +00002978.. option:: -mcrypto, -mno-crypto
2979
Richard Smith081ad4d2017-01-24 19:39:46 +00002980.. option:: -mdirect-move, -mno-direct-move
2981
Richard Smith081ad4d2017-01-24 19:39:46 +00002982.. option:: -mfloat128, -mno-float128
2983
Richard Smith081ad4d2017-01-24 19:39:46 +00002984.. option:: -mfprnd, -mno-fprnd
2985
Richard Smith081ad4d2017-01-24 19:39:46 +00002986.. option:: -mhtm, -mno-htm
2987
Richard Smith081ad4d2017-01-24 19:39:46 +00002988.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2989
Richard Smith081ad4d2017-01-24 19:39:46 +00002990.. option:: -misel, -mno-isel
2991
Richard Smith081ad4d2017-01-24 19:39:46 +00002992.. option:: -mlongcall, -mno-longcall
2993
Richard Smith081ad4d2017-01-24 19:39:46 +00002994.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2995
Richard Smith081ad4d2017-01-24 19:39:46 +00002996.. option:: -mpopcntd, -mno-popcntd
2997
Richard Smith081ad4d2017-01-24 19:39:46 +00002998.. option:: -mpower8-vector, -mno-power8-vector
2999
Richard Smith081ad4d2017-01-24 19:39:46 +00003000.. option:: -mpower9-vector, -mno-power9-vector
3001
Richard Smith081ad4d2017-01-24 19:39:46 +00003002.. option:: -mqpx, -mno-qpx
3003
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003004.. option:: -msecure-plt
3005
Craig Topper9624beb2020-03-10 11:08:19 -07003006.. option:: -mspe, -mno-spe
3007
Richard Smith081ad4d2017-01-24 19:39:46 +00003008.. option:: -mvsx, -mno-vsx
3009
3010WebAssembly
3011-----------
Craig Topper9624beb2020-03-10 11:08:19 -07003012.. option:: -matomics, -mno-atomics
3013
3014.. option:: -mbulk-memory, -mno-bulk-memory
3015
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003016.. option:: -mexception-handling, -mno-exception-handling
3017
Craig Topper9624beb2020-03-10 11:08:19 -07003018.. option:: -mmultivalue, -mno-multivalue
3019
3020.. option:: -mmutable-globals, -mno-mutable-globals
3021
Craig Topper188252d2017-12-11 21:09:16 +00003022.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
3023
Craig Topper9624beb2020-03-10 11:08:19 -07003024.. option:: -mreference-types, -mno-reference-types
3025
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00003026.. option:: -msign-ext, -mno-sign-ext
3027
Richard Smith081ad4d2017-01-24 19:39:46 +00003028.. option:: -msimd128, -mno-simd128
3029
Craig Topper9624beb2020-03-10 11:08:19 -07003030.. option:: -mtail-call, -mno-tail-call
3031
3032.. option:: -munimplemented-simd128, -mno-unimplemented-simd128
3033
Richard Smith081ad4d2017-01-24 19:39:46 +00003034X86
3035---
Richard Smith081ad4d2017-01-24 19:39:46 +00003036.. option:: -m3dnow, -mno-3dnow
3037
Richard Smith081ad4d2017-01-24 19:39:46 +00003038.. option:: -m3dnowa, -mno-3dnowa
3039
Richard Smith081ad4d2017-01-24 19:39:46 +00003040.. option:: -madx, -mno-adx
3041
Richard Smith081ad4d2017-01-24 19:39:46 +00003042.. option:: -maes, -mno-aes
3043
Richard Smith081ad4d2017-01-24 19:39:46 +00003044.. option:: -mavx, -mno-avx
3045
Richard Smith081ad4d2017-01-24 19:39:46 +00003046.. option:: -mavx2, -mno-avx2
3047
Luo, Yuanke844f6622019-05-06 08:25:11 +00003048.. option:: -mavx512bf16, -mno-avx512bf16
3049
Craig Topper9624beb2020-03-10 11:08:19 -07003050.. option:: -mavx512bitalg, -mno-avx512bitalg
3051
Richard Smith081ad4d2017-01-24 19:39:46 +00003052.. option:: -mavx512bw, -mno-avx512bw
3053
Richard Smith081ad4d2017-01-24 19:39:46 +00003054.. option:: -mavx512cd, -mno-avx512cd
3055
Richard Smith081ad4d2017-01-24 19:39:46 +00003056.. option:: -mavx512dq, -mno-avx512dq
3057
Richard Smith081ad4d2017-01-24 19:39:46 +00003058.. option:: -mavx512er, -mno-avx512er
3059
Richard Smith081ad4d2017-01-24 19:39:46 +00003060.. option:: -mavx512f, -mno-avx512f
3061
Richard Smith081ad4d2017-01-24 19:39:46 +00003062.. option:: -mavx512ifma, -mno-avx512ifma
3063
Richard Smith081ad4d2017-01-24 19:39:46 +00003064.. option:: -mavx512pf, -mno-avx512pf
3065
Richard Smith081ad4d2017-01-24 19:39:46 +00003066.. option:: -mavx512vbmi, -mno-avx512vbmi
3067
Craig Topper287c8012018-01-03 18:29:12 +00003068.. option:: -mavx512vbmi2, -mno-avx512vbmi2
3069
Richard Smith081ad4d2017-01-24 19:39:46 +00003070.. option:: -mavx512vl, -mno-avx512vl
3071
Craig Topper287c8012018-01-03 18:29:12 +00003072.. option:: -mavx512vnni, -mno-avx512vnni
3073
Pengfei Wangcc3629d2019-05-31 06:09:35 +00003074.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
3075
Craig Topperd23254a2017-07-20 17:52:48 +00003076.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
3077
Richard Smith081ad4d2017-01-24 19:39:46 +00003078.. option:: -mbmi, -mno-bmi
3079
Richard Smith081ad4d2017-01-24 19:39:46 +00003080.. option:: -mbmi2, -mno-bmi2
3081
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003082.. option:: -mcldemote, -mno-cldemote
3083
Craig Topper78b47872017-02-08 06:48:58 +00003084.. option:: -mclflushopt, -mno-clflushopt
3085
Craig Topper177a57c2017-02-08 07:57:01 +00003086.. option:: -mclwb, -mno-clwb
3087
Richard Smith78e23fd2017-04-13 22:39:49 +00003088.. option:: -mclzero, -mno-clzero
3089
Richard Smith081ad4d2017-01-24 19:39:46 +00003090.. option:: -mcx16, -mno-cx16
3091
Pengfei Wang3a29f7c2019-06-06 08:28:42 +00003092.. option:: -menqcmd, -mno-enqcmd
3093
Richard Smith081ad4d2017-01-24 19:39:46 +00003094.. option:: -mf16c, -mno-f16c
3095
Richard Smith081ad4d2017-01-24 19:39:46 +00003096.. option:: -mfma, -mno-fma
3097
Richard Smith081ad4d2017-01-24 19:39:46 +00003098.. option:: -mfma4, -mno-fma4
3099
Richard Smith081ad4d2017-01-24 19:39:46 +00003100.. option:: -mfsgsbase, -mno-fsgsbase
3101
Richard Smith081ad4d2017-01-24 19:39:46 +00003102.. option:: -mfxsr, -mno-fxsr
3103
Craig Topper287c8012018-01-03 18:29:12 +00003104.. option:: -mgfni, -mno-gfni
3105
Vedant Kumar368540f2018-08-23 17:55:03 +00003106.. option:: -minvpcid, -mno-invpcid
3107
Craig Topperd23254a2017-07-20 17:52:48 +00003108.. option:: -mlwp, -mno-lwp
3109
Richard Smith081ad4d2017-01-24 19:39:46 +00003110.. option:: -mlzcnt, -mno-lzcnt
3111
Richard Smith081ad4d2017-01-24 19:39:46 +00003112.. option:: -mmmx, -mno-mmx
3113
Craig Topper177a57c2017-02-08 07:57:01 +00003114.. option:: -mmovbe, -mno-movbe
3115
Gabor Buellaa51e0c22018-05-01 10:05:42 +00003116.. option:: -mmovdir64b, -mno-movdir64b
3117
Vedant Kumar368540f2018-08-23 17:55:03 +00003118.. option:: -mmovdiri, -mno-movdiri
3119
Richard Smith081ad4d2017-01-24 19:39:46 +00003120.. option:: -mmwaitx, -mno-mwaitx
3121
Richard Smith081ad4d2017-01-24 19:39:46 +00003122.. option:: -mpclmul, -mno-pclmul
3123
Vedant Kumar368540f2018-08-23 17:55:03 +00003124.. option:: -mpconfig, -mno-pconfig
3125
Richard Smith081ad4d2017-01-24 19:39:46 +00003126.. option:: -mpku, -mno-pku
3127
Richard Smith081ad4d2017-01-24 19:39:46 +00003128.. option:: -mpopcnt, -mno-popcnt
3129
Craig Topperd2bf7b02017-02-08 08:23:40 +00003130.. option:: -mprefetchwt1, -mno-prefetchwt1
3131
Richard Smith081ad4d2017-01-24 19:39:46 +00003132.. option:: -mprfchw, -mno-prfchw
3133
Vedant Kumar368540f2018-08-23 17:55:03 +00003134.. option:: -mptwrite, -mno-ptwrite
3135
Craig Topper596527b2018-01-23 18:40:15 +00003136.. option:: -mrdpid, -mno-rdpid
3137
Richard Smith081ad4d2017-01-24 19:39:46 +00003138.. option:: -mrdrnd, -mno-rdrnd
3139
Richard Smith081ad4d2017-01-24 19:39:46 +00003140.. option:: -mrdseed, -mno-rdseed
3141
Craig Topper596527b2018-01-23 18:40:15 +00003142.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
3143
Richard Smith081ad4d2017-01-24 19:39:46 +00003144.. option:: -mrtm, -mno-rtm
3145
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00003146.. option:: -msahf, -mno-sahf
3147
Craig Topper204ecff2017-02-08 08:23:17 +00003148.. option:: -msgx, -mno-sgx
3149
Richard Smith081ad4d2017-01-24 19:39:46 +00003150.. option:: -msha, -mno-sha
3151
Craig Topper188252d2017-12-11 21:09:16 +00003152.. option:: -mshstk, -mno-shstk
3153
Richard Smith081ad4d2017-01-24 19:39:46 +00003154.. option:: -msse, -mno-sse
3155
Richard Smith081ad4d2017-01-24 19:39:46 +00003156.. option:: -msse2, -mno-sse2
3157
Richard Smith081ad4d2017-01-24 19:39:46 +00003158.. option:: -msse3, -mno-sse3
3159
Richard Smith081ad4d2017-01-24 19:39:46 +00003160.. option:: -msse4.1, -mno-sse4.1
3161
Richard Smithb2c82a62017-01-27 01:54:42 +00003162.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00003163.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00003164.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00003165
Richard Smith081ad4d2017-01-24 19:39:46 +00003166.. option:: -msse4a, -mno-sse4a
3167
Richard Smith081ad4d2017-01-24 19:39:46 +00003168.. option:: -mssse3, -mno-ssse3
3169
Richard Smith081ad4d2017-01-24 19:39:46 +00003170.. option:: -mtbm, -mno-tbm
3171
Craig Topper287c8012018-01-03 18:29:12 +00003172.. option:: -mvaes, -mno-vaes
3173
3174.. option:: -mvpclmulqdq, -mno-vpclmulqdq
3175
Craig Topper9624beb2020-03-10 11:08:19 -07003176.. option:: -mvzeroupper, -mno-vzeroupper
3177
Craig Topper42da9cb2018-04-23 21:41:06 +00003178.. option:: -mwaitpkg, -mno-waitpkg
3179
Gabor Buellaa0520162018-04-11 20:09:09 +00003180.. option:: -mwbnoinvd, -mno-wbnoinvd
3181
Richard Smith081ad4d2017-01-24 19:39:46 +00003182.. option:: -mx87, -m80387, -mno-x87
3183
Richard Smith081ad4d2017-01-24 19:39:46 +00003184.. option:: -mxop, -mno-xop
3185
Richard Smith081ad4d2017-01-24 19:39:46 +00003186.. option:: -mxsave, -mno-xsave
3187
Richard Smith081ad4d2017-01-24 19:39:46 +00003188.. option:: -mxsavec, -mno-xsavec
3189
Richard Smith081ad4d2017-01-24 19:39:46 +00003190.. option:: -mxsaveopt, -mno-xsaveopt
3191
Richard Smith081ad4d2017-01-24 19:39:46 +00003192.. option:: -mxsaves, -mno-xsaves
3193
Vedant Kumar368540f2018-08-23 17:55:03 +00003194RISCV
3195-----
3196.. option:: -mrelax, -mno-relax
3197
3198Enable linker relaxation
3199
Craig Topper9624beb2020-03-10 11:08:19 -07003200.. option:: -msave-restore, -mno-save-restore
3201
3202Enable using library calls for save and restore
3203
3204Long double flags
3205-----------------
3206Selects the long double implementation
3207
3208.. option:: -mlong-double-128
3209
3210Force long double to be 128 bits
3211
3212.. option:: -mlong-double-64
3213
3214Force long double to be 64 bits
3215
3216.. option:: -mlong-double-80
3217
3218Force long double to be 80 bits, padded to 128 bits for storage
3219
Richard Smith081ad4d2017-01-24 19:39:46 +00003220Optimization level
3221~~~~~~~~~~~~~~~~~~
3222
3223Flags controlling how much optimization should be performed.
3224
Richard Smith081ad4d2017-01-24 19:39:46 +00003225.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
3226
Richard Smith081ad4d2017-01-24 19:39:46 +00003227.. option:: -Ofast<arg>
3228
3229Debug information generation
3230~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3231
3232Flags controlling how much and what kind of debug information should be
3233generated.
3234
3235Kind and level of debug information
3236-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003237.. option:: -g, --debug, --debug=<arg>
3238
3239Generate source-level debug information
3240
Craig Topper9624beb2020-03-10 11:08:19 -07003241.. option:: -gdwarf
3242
3243Generate source-level debug information with the default dwarf version
3244
Richard Smith081ad4d2017-01-24 19:39:46 +00003245.. option:: -gdwarf-2
3246
3247Generate source-level debug information with dwarf version 2
3248
Richard Smith081ad4d2017-01-24 19:39:46 +00003249.. option:: -gdwarf-3
3250
3251Generate source-level debug information with dwarf version 3
3252
Craig Topper9624beb2020-03-10 11:08:19 -07003253.. option:: -gdwarf-4
Richard Smith081ad4d2017-01-24 19:39:46 +00003254
3255Generate source-level debug information with dwarf version 4
3256
Richard Smith081ad4d2017-01-24 19:39:46 +00003257.. option:: -gdwarf-5
3258
3259Generate source-level debug information with dwarf version 5
3260
Richard Smith081ad4d2017-01-24 19:39:46 +00003261.. option:: -gfull
3262
Richard Smith081ad4d2017-01-24 19:39:46 +00003263.. option:: -gused
3264
3265Debug level
3266___________
Richard Smith081ad4d2017-01-24 19:39:46 +00003267.. option:: -g0
3268
Richard Smith081ad4d2017-01-24 19:39:46 +00003269.. option:: -g2
3270
Richard Smith081ad4d2017-01-24 19:39:46 +00003271.. option:: -g3
3272
Richard Smith081ad4d2017-01-24 19:39:46 +00003273.. option:: -ggdb0
3274
Richard Smith081ad4d2017-01-24 19:39:46 +00003275.. option:: -ggdb1
3276
Richard Smith081ad4d2017-01-24 19:39:46 +00003277.. option:: -ggdb2
3278
Richard Smith081ad4d2017-01-24 19:39:46 +00003279.. option:: -ggdb3
3280
Craig Topper9624beb2020-03-10 11:08:19 -07003281.. option:: -gline-directives-only
3282
3283Emit debug line info directives only
3284
Richard Smith081ad4d2017-01-24 19:39:46 +00003285.. option:: -gline-tables-only, -g1, -gmlt
3286
3287Emit debug line number tables only
3288
Richard Smith081ad4d2017-01-24 19:39:46 +00003289.. option:: -gmodules
3290
3291Generate debug info with external references to clang modules or precompiled headers
3292
3293Debugger to tune debug information for
3294______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00003295.. option:: -ggdb
3296
Richard Smith081ad4d2017-01-24 19:39:46 +00003297.. option:: -glldb
3298
Richard Smith081ad4d2017-01-24 19:39:46 +00003299.. option:: -gsce
3300
3301Debug information flags
3302-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003303.. option:: -gcolumn-info, -gno-column-info
3304
Richard Smith081ad4d2017-01-24 19:39:46 +00003305.. option:: -gdwarf-aranges
3306
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003307.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00003308
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003309Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00003310
Vedant Kumar368540f2018-08-23 17:55:03 +00003311.. option:: -ggnu-pubnames, -gno-gnu-pubnames
3312
3313.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00003314
Craig Topper9624beb2020-03-10 11:08:19 -07003315.. option:: -grecord-command-line, -gno-record-command-line, -grecord-gcc-switches
Richard Smith081ad4d2017-01-24 19:39:46 +00003316
Richard Smith081ad4d2017-01-24 19:39:46 +00003317.. option:: -gsplit-dwarf
3318
Craig Topper9624beb2020-03-10 11:08:19 -07003319.. program:: clang1
3320.. option:: -gsplit-dwarf=<arg>
3321.. program:: clang
3322
3323Set DWARF fission mode to either 'split' or 'single'
3324
Richard Smith081ad4d2017-01-24 19:39:46 +00003325.. option:: -gstrict-dwarf, -gno-strict-dwarf
3326
Craig Topperd23254a2017-07-20 17:52:48 +00003327.. option:: -gz
3328
3329DWARF debug sections compression type
3330
3331.. program:: clang1
3332.. option:: -gz=<arg>
3333.. program:: clang
3334
3335DWARF debug sections compression type
3336
Richard Smithc5b2e002017-01-27 02:08:37 +00003337Static analyzer flags
3338=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00003339
Richard Smithc5b2e002017-01-27 02:08:37 +00003340Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00003341
Richard Smithc5b2e002017-01-27 02:08:37 +00003342.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00003343
Richard Smithc5b2e002017-01-27 02:08:37 +00003344Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00003345
3346Fortran compilation flags
3347=========================
3348
3349Flags that will be passed onto the ``gfortran`` compiler when Clang is given
3350a Fortran input.
3351
Richard Smithc5b2e002017-01-27 02:08:37 +00003352.. option:: -A<arg>, --assert <arg>, --assert=<arg>
3353
Richard Smith081ad4d2017-01-24 19:39:46 +00003354.. option:: -A-<arg>
3355
Richard Smith081ad4d2017-01-24 19:39:46 +00003356.. option:: -J<arg>
3357
Richard Smith081ad4d2017-01-24 19:39:46 +00003358.. option:: -cpp
3359
Richard Smith081ad4d2017-01-24 19:39:46 +00003360.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
3361
Richard Smith081ad4d2017-01-24 19:39:46 +00003362.. option:: -falign-commons, -fno-align-commons
3363
Richard Smith081ad4d2017-01-24 19:39:46 +00003364.. option:: -fall-intrinsics, -fno-all-intrinsics
3365
Richard Smith081ad4d2017-01-24 19:39:46 +00003366.. option:: -fautomatic, -fno-automatic
3367
Richard Smith081ad4d2017-01-24 19:39:46 +00003368.. option:: -fbackslash, -fno-backslash
3369
Richard Smith081ad4d2017-01-24 19:39:46 +00003370.. option:: -fbacktrace, -fno-backtrace
3371
Richard Smith081ad4d2017-01-24 19:39:46 +00003372.. option:: -fblas-matmul-limit=<arg>
3373
Richard Smith081ad4d2017-01-24 19:39:46 +00003374.. option:: -fbounds-check, -fno-bounds-check
3375
Richard Smith081ad4d2017-01-24 19:39:46 +00003376.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
3377
Richard Smith081ad4d2017-01-24 19:39:46 +00003378.. option:: -fcheck=<arg>
3379
Richard Smith081ad4d2017-01-24 19:39:46 +00003380.. option:: -fcoarray=<arg>
3381
Richard Smith081ad4d2017-01-24 19:39:46 +00003382.. option:: -fconvert=<arg>
3383
Richard Smith081ad4d2017-01-24 19:39:46 +00003384.. option:: -fcray-pointer, -fno-cray-pointer
3385
Richard Smith081ad4d2017-01-24 19:39:46 +00003386.. option:: -fd-lines-as-code, -fno-d-lines-as-code
3387
Richard Smith081ad4d2017-01-24 19:39:46 +00003388.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
3389
Richard Smith081ad4d2017-01-24 19:39:46 +00003390.. option:: -fdefault-double-8, -fno-default-double-8
3391
Richard Smith081ad4d2017-01-24 19:39:46 +00003392.. option:: -fdefault-integer-8, -fno-default-integer-8
3393
Richard Smith081ad4d2017-01-24 19:39:46 +00003394.. option:: -fdefault-real-8, -fno-default-real-8
3395
Richard Smith081ad4d2017-01-24 19:39:46 +00003396.. option:: -fdollar-ok, -fno-dollar-ok
3397
Richard Smith081ad4d2017-01-24 19:39:46 +00003398.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
3399
Richard Smith081ad4d2017-01-24 19:39:46 +00003400.. option:: -fdump-fortran-original, -fno-dump-fortran-original
3401
Richard Smith081ad4d2017-01-24 19:39:46 +00003402.. option:: -fdump-parse-tree, -fno-dump-parse-tree
3403
Richard Smith081ad4d2017-01-24 19:39:46 +00003404.. option:: -fexternal-blas, -fno-external-blas
3405
Richard Smith081ad4d2017-01-24 19:39:46 +00003406.. option:: -ff2c, -fno-f2c
3407
Richard Smith081ad4d2017-01-24 19:39:46 +00003408.. option:: -ffixed-form, -fno-fixed-form
3409
Richard Smith081ad4d2017-01-24 19:39:46 +00003410.. option:: -ffixed-line-length-<arg>
3411
Richard Smith081ad4d2017-01-24 19:39:46 +00003412.. option:: -ffpe-trap=<arg>
3413
Richard Smith081ad4d2017-01-24 19:39:46 +00003414.. option:: -ffree-form, -fno-free-form
3415
Richard Smith081ad4d2017-01-24 19:39:46 +00003416.. option:: -ffree-line-length-<arg>
3417
Richard Smith081ad4d2017-01-24 19:39:46 +00003418.. option:: -ffrontend-optimize, -fno-frontend-optimize
3419
Richard Smith081ad4d2017-01-24 19:39:46 +00003420.. option:: -fimplicit-none, -fno-implicit-none
3421
Richard Smith081ad4d2017-01-24 19:39:46 +00003422.. option:: -finit-character=<arg>
3423
Richard Smith081ad4d2017-01-24 19:39:46 +00003424.. option:: -finit-integer=<arg>
3425
Richard Smith081ad4d2017-01-24 19:39:46 +00003426.. option:: -finit-local-zero, -fno-init-local-zero
3427
Richard Smith081ad4d2017-01-24 19:39:46 +00003428.. option:: -finit-logical=<arg>
3429
Richard Smith081ad4d2017-01-24 19:39:46 +00003430.. option:: -finit-real=<arg>
3431
Richard Smith081ad4d2017-01-24 19:39:46 +00003432.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
3433
Richard Smith081ad4d2017-01-24 19:39:46 +00003434.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
3435
Richard Smith081ad4d2017-01-24 19:39:46 +00003436.. option:: -fmax-array-constructor=<arg>
3437
Richard Smith081ad4d2017-01-24 19:39:46 +00003438.. option:: -fmax-errors=<arg>
3439
Richard Smith081ad4d2017-01-24 19:39:46 +00003440.. option:: -fmax-identifier-length, -fno-max-identifier-length
3441
Richard Smith081ad4d2017-01-24 19:39:46 +00003442.. option:: -fmax-stack-var-size=<arg>
3443
Richard Smith081ad4d2017-01-24 19:39:46 +00003444.. option:: -fmax-subrecord-length=<arg>
3445
Richard Smith081ad4d2017-01-24 19:39:46 +00003446.. option:: -fmodule-private, -fno-module-private
3447
Richard Smith081ad4d2017-01-24 19:39:46 +00003448.. option:: -fpack-derived, -fno-pack-derived
3449
Richard Smith081ad4d2017-01-24 19:39:46 +00003450.. option:: -fprotect-parens, -fno-protect-parens
3451
Richard Smith081ad4d2017-01-24 19:39:46 +00003452.. option:: -frange-check, -fno-range-check
3453
Richard Smith081ad4d2017-01-24 19:39:46 +00003454.. option:: -freal-4-real-10, -fno-real-4-real-10
3455
Richard Smith081ad4d2017-01-24 19:39:46 +00003456.. option:: -freal-4-real-16, -fno-real-4-real-16
3457
Richard Smith081ad4d2017-01-24 19:39:46 +00003458.. option:: -freal-4-real-8, -fno-real-4-real-8
3459
Richard Smith081ad4d2017-01-24 19:39:46 +00003460.. option:: -freal-8-real-10, -fno-real-8-real-10
3461
Richard Smith081ad4d2017-01-24 19:39:46 +00003462.. option:: -freal-8-real-16, -fno-real-8-real-16
3463
Richard Smith081ad4d2017-01-24 19:39:46 +00003464.. option:: -freal-8-real-4, -fno-real-8-real-4
3465
Richard Smith081ad4d2017-01-24 19:39:46 +00003466.. option:: -frealloc-lhs, -fno-realloc-lhs
3467
Richard Smith081ad4d2017-01-24 19:39:46 +00003468.. option:: -frecord-marker=<arg>
3469
Richard Smith081ad4d2017-01-24 19:39:46 +00003470.. option:: -frecursive, -fno-recursive
3471
Richard Smith081ad4d2017-01-24 19:39:46 +00003472.. option:: -frepack-arrays, -fno-repack-arrays
3473
Richard Smith081ad4d2017-01-24 19:39:46 +00003474.. option:: -fsecond-underscore, -fno-second-underscore
3475
Richard Smith081ad4d2017-01-24 19:39:46 +00003476.. option:: -fsign-zero, -fno-sign-zero
3477
Richard Smith081ad4d2017-01-24 19:39:46 +00003478.. option:: -fstack-arrays, -fno-stack-arrays
3479
Richard Smith081ad4d2017-01-24 19:39:46 +00003480.. option:: -funderscoring, -fno-underscoring
3481
Richard Smith081ad4d2017-01-24 19:39:46 +00003482.. option:: -fwhole-file, -fno-whole-file
3483
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003484.. option:: -imultilib <arg>
3485
Richard Smith081ad4d2017-01-24 19:39:46 +00003486.. option:: -nocpp
3487
Richard Smith081ad4d2017-01-24 19:39:46 +00003488.. option:: -static-libgfortran
3489
Richard Smithc5b2e002017-01-27 02:08:37 +00003490Linker flags
3491============
3492Flags that are passed on to the linker
3493
3494.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3495
3496Add directory to library search path
3497
3498.. option:: -Mach
3499
3500.. option:: -T<script>
3501
3502Specify <script> as linker script
3503
Richard Smith78e23fd2017-04-13 22:39:49 +00003504.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003505
3506Set starting address of BSS to <addr>
3507
Richard Smith78e23fd2017-04-13 22:39:49 +00003508.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003509
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003510Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003511
Richard Smith78e23fd2017-04-13 22:39:49 +00003512.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003513
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003514Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003515
3516.. option:: -Wl,<arg>,<arg2>...
3517
3518Pass the comma separated arguments in <arg> to the linker
3519
3520.. option:: -X
3521
3522.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3523
3524Pass <arg> to the linker
3525
3526.. program:: clang1
3527.. option:: -Z
3528.. program:: clang
3529
3530.. option:: -e<arg>, --entry
3531
3532.. option:: -filelist <arg>
3533
Vedant Kumar368540f2018-08-23 17:55:03 +00003534.. option:: --hip-device-lib-path=<arg>
3535
3536HIP device library path
3537
3538.. option:: --hip-device-lib=<arg>
3539
3540HIP device library
3541
Richard Smithc5b2e002017-01-27 02:08:37 +00003542.. option:: -l<arg>
3543
3544.. option:: -r
3545
3546.. option:: -rpath <arg>
3547
3548.. option:: -s
3549
3550.. option:: -t
3551
3552.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3553
3554.. option:: -undef
3555
3556undef all system defines
3557
3558.. option:: -undefined<arg>, --no-undefined
3559
3560.. option:: -z <arg>
3561
3562Pass -z <arg> to the linker
3563