1..
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
21.. program:: clang0
22.. option:: -A<arg>, --assert <arg>, --assert=<arg>
23
24.. program:: clang1
25.. option:: -B<arg>, --prefix <arg>, --prefix=<arg>
26
27.. program:: clang2
28.. option:: -C, --comments
29
30.. program:: clang3
31.. option:: -CC, --comments-in-macros
32
33.. program:: clang4
34.. option:: -F<arg>
35
36Add directory to framework include search path
37
38.. program:: clang5
39.. option:: -G<arg>
40
41.. program:: clang6
42.. option:: -G=<arg>
43
44.. program:: clang7
45.. option:: -H, --trace-includes
46
47Show header includes and nesting depth
48
49.. program:: clang8
50.. option:: -Mach
51
52.. program:: clang9
53.. option:: -ObjC
54
55Treat source input files as Objective-C inputs
56
57.. program:: clang10
58.. option:: -ObjC++
59
60Treat source input files as Objective-C++ inputs
61
62.. program:: clang11
63.. option:: -P, --no-line-commands
64
65Disable linemarker output in -E mode
66
67.. program:: clang12
68.. option:: -Q
69
70.. program:: clang13
71.. option:: -Qn
72
73.. program:: clang14
74.. option:: -Qunused-arguments
75
76Don't emit warning for unused driver arguments
77
78.. program:: clang15
79.. option:: -Wa,<arg>,<arg2>...
80
81Pass the comma separated arguments in <arg> to the assembler
82
83.. program:: clang16
84.. option:: -Wlarge-by-value-copy=<arg>
85
86.. program:: clang17
87.. option:: -Wp,<arg>,<arg2>...
88
89Pass the comma separated arguments in <arg> to the preprocessor
90
91.. program:: clang18
92.. option:: -X<arg>
93
94.. program:: clang19
95.. option:: -X
96
97.. program:: clang20
98.. option:: -Xanalyzer <arg>
99
100Pass <arg> to the static analyzer
101
102.. program:: clang21
103.. option:: -Xarch\_<arg1> <arg2>
104
105.. program:: clang22
106.. option:: -Xassembler <arg>
107
108Pass <arg> to the assembler
109
110.. program:: clang23
111.. option:: -Xcuda-fatbinary <arg>
112
113Pass <arg> to fatbinary invocation
114
115.. program:: clang24
116.. option:: -Xcuda-ptxas <arg>
117
118Pass <arg> to the ptxas assembler
119
120.. program:: clang25
121.. option:: -Xpreprocessor <arg>
122
123Pass <arg> to the preprocessor
124
125.. program:: clang26
126.. option:: -Z<arg>
127
128.. program:: clang27
129.. option:: -a<arg>, --profile-blocks
130
131.. program:: clang28
132.. option:: -all\_load
133
134.. program:: clang29
135.. option:: -allowable\_client <arg>
136
137.. program:: clang30
138.. option:: --analyze
139
140Run the static analyzer
141
142.. program:: clang31
143.. option:: --analyze-auto
144
145.. program:: clang32
146.. option:: --analyzer-no-default-checks
147
148.. program:: clang33
149.. option:: --analyzer-output<arg>
150
151Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text).
152
153.. program:: clang34
154.. option:: -ansi, --ansi
155
156.. program:: clang35
157.. option:: -arch <arg>
158
159.. program:: clang36
160.. option:: -arch\_errors\_fatal
161
162.. program:: clang37
163.. option:: -arch\_only <arg>
164
165.. program:: clang38
166.. option:: -arcmt-migrate-emit-errors
167
168Emit ARC errors even if the migrator can fix them
169
170.. program:: clang39
171.. option:: -arcmt-migrate-report-output <arg>
172
173Output path for the plist report
174
175.. program:: clang40
176.. option:: -bind\_at\_load
177
178.. program:: clang41
179.. option:: -bundle
180
181.. program:: clang42
182.. option:: -bundle\_loader <arg>
183
184.. program:: clang43
185.. option:: -c, --compile
186
187Only run preprocess, compile, and assemble steps
188
189.. program:: clang44
190.. option:: -client\_name<arg>
191
192.. program:: clang45
193.. option:: -compatibility\_version<arg>
194
195.. program:: clang46
196.. option:: --constant-cfstrings
197
198.. program:: clang47
199.. option:: -coverage, --coverage
200
201.. program:: clang48
202.. option:: --cuda-compile-host-device
203
204Compile CUDA code for both host and device (default).  Has no effect on non-CUDA compilations.
205
206.. program:: clang49
207.. option:: --cuda-device-only
208
209Compile CUDA code for device only
210
211.. program:: clang50
212.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
213
214CUDA GPU architecture (e.g. sm\_35).  May be specified more than once.
215
216.. program:: clang51
217.. option:: --cuda-host-only
218
219Compile CUDA code for host only.  Has no effect on non-CUDA compilations.
220
221.. program:: clang52
222.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
223
224Enable device-side debug info generation. Disables ptxas optimizations.
225
226.. program:: clang53
227.. option:: -current\_version<arg>
228
229.. program:: clang54
230.. option:: -dead\_strip
231
232.. program:: clang55
233.. option:: -dependency-dot <arg>
234
235Filename to write DOT-formatted header dependencies to
236
237.. program:: clang56
238.. option:: -dependency-file <arg>
239
240Filename (or -) to write dependency output to
241
242.. program:: clang57
243.. option:: -dumpmachine
244
245.. program:: clang58
246.. option:: -dumpversion
247
248.. program:: clang59
249.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
250
251.. program:: clang60
252.. option:: -dylib\_file <arg>
253
254.. program:: clang61
255.. option:: -dylinker
256
257.. program:: clang62
258.. option:: -dylinker\_install\_name<arg>
259
260.. program:: clang63
261.. option:: -dynamic
262
263.. program:: clang64
264.. option:: -dynamiclib
265
266.. program:: clang65
267.. option:: -emit-ast
268
269Emit Clang AST files for source inputs
270
271.. program:: clang66
272.. option:: -exported\_symbols\_list <arg>
273
274.. program:: clang67
275.. option:: -faligned-new=<arg>
276
277.. program:: clang68
278.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
279
280Use approximate transcendental functions
281
282.. program:: clang69
283.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
284
285Flush denormal floating point values to zero in CUDA device mode.
286
287.. program:: clang70
288.. option:: -fheinous-gnu-extensions
289
290.. program:: clang71
291.. option:: -flat\_namespace
292
293.. program:: clang72
294.. option:: -fopenmp-targets=<arg1>,<arg2>...
295
296Specify comma-separated list of triples OpenMP offloading targets to be supported
297
298.. program:: clang73
299.. option:: -force\_cpusubtype\_ALL
300
301.. program:: clang74
302.. option:: -force\_flat\_namespace
303
304.. program:: clang75
305.. option:: -force\_load <arg>
306
307.. program:: clang76
308.. option:: -framework <arg>
309
310.. program:: clang77
311.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
312
313Use the gcc toolchain at the given directory
314
315.. program:: clang78
316.. option:: -gcodeview
317
318Generate CodeView debug information
319
320.. program:: clang79
321.. option:: -headerpad\_max\_install\_names<arg>
322
323.. program:: clang80
324.. option:: -help, --help
325
326Display available options
327
328.. program:: clang81
329.. option:: --help-hidden
330
331.. program:: clang82
332.. option:: -image\_base <arg>
333
334.. program:: clang83
335.. option:: -index-header-map
336
337Make the next included directory (-I or -F) an indexer header map
338
339.. program:: clang84
340.. option:: -init <arg>
341
342.. program:: clang85
343.. option:: -install\_name <arg>
344
345.. program:: clang86
346.. option:: -keep\_private\_externs
347
348.. program:: clang87
349.. option:: -lazy\_framework <arg>
350
351.. program:: clang88
352.. option:: -lazy\_library <arg>
353
354.. program:: clang89
355.. option:: -mbig-endian, -EB
356
357.. program:: clang90
358.. option:: --migrate
359
360Run the migrator
361
362.. program:: clang91
363.. option:: -mlinker-version=<arg>
364
365.. program:: clang92
366.. option:: -mlittle-endian, -EL
367
368.. program:: clang93
369.. option:: -mllvm <arg>
370
371Additional arguments to forward to LLVM's option processing
372
373.. program:: clang94
374.. option:: -module-dependency-dir <arg>
375
376Directory to dump module dependencies to
377
378.. program:: clang95
379.. option:: -multi\_module
380
381.. program:: clang96
382.. option:: -multiply\_defined <arg>
383
384.. program:: clang97
385.. option:: -multiply\_defined\_unused <arg>
386
387.. program:: clang98
388.. option:: --no-cuda-version-check
389
390Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
391
392.. program:: clang99
393.. option:: -no-integrated-cpp, --no-integrated-cpp
394
395.. program:: clang100
396.. option:: -no\_dead\_strip\_inits\_and\_terms
397
398.. program:: clang101
399.. option:: -nobuiltininc
400
401Disable builtin #include directories
402
403.. program:: clang102
404.. option:: -nocudainc
405
406.. program:: clang103
407.. option:: -nocudalib
408
409.. program:: clang104
410.. option:: -nodefaultlibs
411
412.. program:: clang105
413.. option:: -nofixprebinding
414
415.. program:: clang106
416.. option:: -nolibc
417
418.. program:: clang107
419.. option:: -nomultidefs
420
421.. program:: clang108
422.. option:: -nopie
423
424.. program:: clang109
425.. option:: -noprebind
426
427.. program:: clang110
428.. option:: -noseglinkedit
429
430.. program:: clang111
431.. option:: -nostartfiles
432
433.. program:: clang112
434.. option:: -nostdinc, --no-standard-includes
435
436.. program:: clang113
437.. option:: -nostdinc++
438
439Disable standard #include directories for the C++ standard library
440
441.. program:: clang114
442.. option:: -nostdlib, --no-standard-libraries
443
444.. program:: clang115
445.. option:: -nostdlibinc
446
447.. program:: clang116
448.. option:: -o<file>, --output <arg>, --output=<arg>
449
450Write output to <file>
451
452.. program:: clang117
453.. option:: -objcmt-atomic-property
454
455Make migration to 'atomic' properties
456
457.. program:: clang118
458.. option:: -objcmt-migrate-all
459
460Enable migration to modern ObjC
461
462.. program:: clang119
463.. option:: -objcmt-migrate-annotation
464
465Enable migration to property and method annotations
466
467.. program:: clang120
468.. option:: -objcmt-migrate-designated-init
469
470Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
471
472.. program:: clang121
473.. option:: -objcmt-migrate-instancetype
474
475Enable migration to infer instancetype for method result type
476
477.. program:: clang122
478.. option:: -objcmt-migrate-literals
479
480Enable migration to modern ObjC literals
481
482.. program:: clang123
483.. option:: -objcmt-migrate-ns-macros
484
485Enable migration to NS\_ENUM/NS\_OPTIONS macros
486
487.. program:: clang124
488.. option:: -objcmt-migrate-property
489
490Enable migration to modern ObjC property
491
492.. program:: clang125
493.. option:: -objcmt-migrate-property-dot-syntax
494
495Enable migration of setter/getter messages to property-dot syntax
496
497.. program:: clang126
498.. option:: -objcmt-migrate-protocol-conformance
499
500Enable migration to add protocol conformance on classes
501
502.. program:: clang127
503.. option:: -objcmt-migrate-readonly-property
504
505Enable migration to modern ObjC readonly property
506
507.. program:: clang128
508.. option:: -objcmt-migrate-readwrite-property
509
510Enable migration to modern ObjC readwrite property
511
512.. program:: clang129
513.. option:: -objcmt-migrate-subscripting
514
515Enable migration to modern ObjC subscripting
516
517.. program:: clang130
518.. option:: -objcmt-ns-nonatomic-iosonly
519
520Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
521
522.. program:: clang131
523.. option:: -objcmt-returns-innerpointer-property
524
525Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
526
527.. program:: clang132
528.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
529
530Only modify files with a filename contained in the provided directory path
531
532.. program:: clang133
533.. option:: -object
534
535.. program:: clang134
536.. option:: -p, --profile
537
538.. program:: clang135
539.. option:: -pagezero\_size<arg>
540
541.. program:: clang136
542.. option:: -pg
543
544Enable mcount instrumentation
545
546.. program:: clang137
547.. option:: -pie
548
549.. program:: clang138
550.. option:: -pipe, --pipe
551
552Use pipes between commands, when possible
553
554.. program:: clang139
555.. option:: -prebind
556
557.. program:: clang140
558.. option:: -prebind\_all\_twolevel\_modules
559
560.. program:: clang141
561.. option:: -preload
562
563.. program:: clang142
564.. option:: --print-diagnostic-categories
565
566.. program:: clang143
567.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
568
569Print the full library path of <file>
570
571.. program:: clang144
572.. option:: -print-ivar-layout
573
574Enable Objective-C Ivar layout bitmap print trace
575
576.. program:: clang145
577.. option:: -print-libgcc-file-name, --print-libgcc-file-name
578
579Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
580
581.. program:: clang146
582.. option:: -print-multi-directory, --print-multi-directory
583
584.. program:: clang147
585.. option:: -print-multi-lib, --print-multi-lib
586
587.. program:: clang148
588.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
589
590Print the full program path of <name>
591
592.. program:: clang149
593.. option:: -print-search-dirs, --print-search-dirs
594
595Print the paths used for finding libraries and programs
596
597.. program:: clang150
598.. option:: -private\_bundle
599
600.. program:: clang151
601.. option:: -pthread, -no-pthread
602
603Support POSIX threads in generated code
604
605.. program:: clang152
606.. option:: -pthreads
607
608.. program:: clang153
609.. option:: -rdynamic
610
611.. program:: clang154
612.. option:: -read\_only\_relocs <arg>
613
614.. program:: clang155
615.. option:: -relocatable-pch, --relocatable-pch
616
617Whether to build a relocatable precompiled header
618
619.. program:: clang156
620.. option:: -remap
621
622.. program:: clang157
623.. option:: -rewrite-legacy-objc
624
625Rewrite Legacy Objective-C source to C++
626
627.. program:: clang158
628.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
629
630Compiler runtime library to use
631
632.. program:: clang159
633.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
634
635Save llvm statistics.
636
637.. program:: clang160
638.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
639
640Save intermediate compilation results.
641
642.. program:: clang161
643.. option:: -sectalign <arg1> <arg2> <arg3>
644
645.. program:: clang162
646.. option:: -sectcreate <arg1> <arg2> <arg3>
647
648.. program:: clang163
649.. option:: -sectobjectsymbols <arg1> <arg2>
650
651.. program:: clang164
652.. option:: -sectorder <arg1> <arg2> <arg3>
653
654.. program:: clang165
655.. option:: -seg1addr<arg>
656
657.. program:: clang166
658.. option:: -seg\_addr\_table <arg>
659
660.. program:: clang167
661.. option:: -seg\_addr\_table\_filename <arg>
662
663.. program:: clang168
664.. option:: -segaddr <arg1> <arg2>
665
666.. program:: clang169
667.. option:: -segcreate <arg1> <arg2> <arg3>
668
669.. program:: clang170
670.. option:: -seglinkedit
671
672.. program:: clang171
673.. option:: -segprot <arg1> <arg2> <arg3>
674
675.. program:: clang172
676.. option:: -segs\_read\_<arg>
677
678.. program:: clang173
679.. option:: -segs\_read\_only\_addr <arg>
680
681.. program:: clang174
682.. option:: -segs\_read\_write\_addr <arg>
683
684.. program:: clang175
685.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
686
687Serialize compiler diagnostics to a file
688
689.. program:: clang176
690.. option:: -shared, --shared
691
692.. program:: clang177
693.. option:: -shared-libasan
694
695.. program:: clang178
696.. option:: -shared-libgcc
697
698.. program:: clang179
699.. option:: -single\_module
700
701.. program:: clang180
702.. option:: -specs=<arg>, --specs=<arg>
703
704.. program:: clang181
705.. option:: -static, --static
706
707.. program:: clang182
708.. option:: -static-libgcc
709
710.. program:: clang183
711.. option:: -static-libstdc++
712
713.. program:: clang184
714.. option:: -std-default=<arg>
715
716.. program:: clang185
717.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
718
719C++ standard library to use
720
721.. program:: clang186
722.. option:: -sub\_library<arg>
723
724.. program:: clang187
725.. option:: -sub\_umbrella<arg>
726
727.. program:: clang188
728.. option:: --sysroot=<arg>, --sysroot <arg>
729
730.. program:: clang189
731.. option:: --target-help
732
733.. program:: clang190
734.. option:: --target=<arg>, -target <arg>
735
736Generate code for the given target
737
738.. program:: clang191
739.. option:: -time
740
741Time individual commands
742
743.. program:: clang192
744.. option:: -traditional, --traditional
745
746.. program:: clang193
747.. option:: -traditional-cpp, --traditional-cpp
748
749Enable some traditional CPP emulation
750
751.. program:: clang194
752.. option:: -twolevel\_namespace
753
754.. program:: clang195
755.. option:: -twolevel\_namespace\_hints
756
757.. program:: clang196
758.. option:: -umbrella <arg>
759
760.. program:: clang197
761.. option:: -unexported\_symbols\_list <arg>
762
763.. program:: clang198
764.. option:: -v, --verbose
765
766Show commands to run and use verbose output
767
768.. program:: clang199
769.. option:: --verify-debug-info
770
771Verify the binary representation of debug output
772
773.. program:: clang200
774.. option:: --version
775
776.. program:: clang201
777.. option:: -w, --no-warnings
778
779Suppress all warnings
780
781.. program:: clang202
782.. option:: -weak-l<arg>
783
784.. program:: clang203
785.. option:: -weak\_framework <arg>
786
787.. program:: clang204
788.. option:: -weak\_library <arg>
789
790.. program:: clang205
791.. option:: -weak\_reference\_mismatches <arg>
792
793.. program:: clang206
794.. option:: -whatsloaded
795
796.. program:: clang207
797.. option:: -whyload
798
799.. program:: clang208
800.. option:: -working-directory<arg>, -working-directory=<arg>
801
802Resolve file paths relative to the specified directory
803
804.. program:: clang209
805.. option:: -x<language>, --language <arg>, --language=<arg>
806
807Treat subsequent input files as having type <language>
808
809.. program:: clang210
810.. option:: -y<arg>
811
812Actions
813=======
814The action to perform on the input.
815
816.. program:: clang211
817.. option:: -E, --preprocess
818
819Only run the preprocessor
820
821.. program:: clang212
822.. option:: -S, --assemble
823
824Only run preprocess and compilation steps
825
826.. program:: clang213
827.. option:: -emit-llvm
828
829Use the LLVM representation for assembler and object files
830
831.. program:: clang214
832.. option:: -fsyntax-only
833
834.. program:: clang215
835.. option:: -module-file-info
836
837Provide information about a particular module file
838
839.. program:: clang216
840.. option:: --precompile
841
842Only precompile the input
843
844.. program:: clang217
845.. option:: -rewrite-objc
846
847Rewrite Objective-C source to C++
848
849.. program:: clang218
850.. option:: -verify-pch
851
852Load and verify that a pre-compiled header file is not stale
853
854Compilation flags
855=================
856
857Flags controlling the behavior of Clang during compilation. These flags have
858no effect during actions that do not perform compilation.
859
860.. program:: clang219
861.. option:: -D<arg>, --define-macro <arg>, --define-macro=<arg>
862
863.. program:: clang220
864.. option:: -U<arg>, --undefine-macro <arg>, --undefine-macro=<arg>
865
866.. program:: clang221
867.. option:: -Xclang <arg>
868
869Pass <arg> to the clang compiler
870
871.. program:: clang222
872.. option:: -fcomment-block-commands=<arg>,<arg2>...
873
874Treat each comma separated argument in <arg> as a documentation comment block command
875
876.. program:: clang223
877.. option:: -fdeclspec, -fno-declspec
878
879Allow \_\_declspec as a keyword
880
881.. program:: clang224
882.. option:: -fdepfile-entry=<arg>
883
884.. program:: clang225
885.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
886
887.. program:: clang226
888.. option:: -fdiagnostics-format=<arg>
889
890.. program:: clang227
891.. option:: -fdiagnostics-parseable-fixits
892
893Print fix-its in machine parseable form
894
895.. program:: clang228
896.. option:: -fdiagnostics-print-source-range-info
897
898Print source range spans in numeric form
899
900.. program:: clang229
901.. option:: -fdiagnostics-show-category=<arg>
902
903.. program:: clang230
904.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
905
906Enables an experimental new pass manager in LLVM.
907
908.. program:: clang231
909.. option:: -finline-functions, -fno-inline-functions
910
911Inline suitable functions
912
913.. program:: clang232
914.. option:: -finline-hint-functions
915
916Inline functions which are (explicitly or implicitly) marked inline
917
918.. program:: clang233
919.. option:: -fno-crash-diagnostics
920
921.. program:: clang234
922.. option:: -fno-sanitize-blacklist
923
924Don't use blacklist file for sanitizers
925
926.. program:: clang235
927.. option:: -fparse-all-comments
928
929.. program:: clang236
930.. option:: -fsanitize-address-field-padding=<arg>
931
932Level of field padding for AddressSanitizer
933
934.. program:: clang237
935.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
936
937Enable use-after-scope detection in AddressSanitizer
938
939.. program:: clang238
940.. option:: -fsanitize-blacklist=<arg>
941
942Path to blacklist file for sanitizers
943
944.. program:: clang239
945.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
946
947Enable control flow integrity (CFI) checks for cross-DSO calls.
948
949.. program:: clang240
950.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
951
952Specify the type of coverage instrumentation for Sanitizers
953
954.. program:: clang241
955.. option:: -fsanitize-link-c++-runtime
956
957.. program:: clang242
958.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
959
960Enable origins tracking in MemorySanitizer
961
962.. program:: clang243
963.. option:: -fsanitize-memory-track-origins=<arg>
964
965Enable origins tracking in MemorySanitizer
966
967.. program:: clang244
968.. option:: -fsanitize-memory-use-after-dtor
969
970Enable use-after-destroy detection in MemorySanitizer
971
972.. program:: clang245
973.. option:: -fsanitize-recover, -fno-sanitize-recover
974
975.. program:: clang246
976.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
977
978Enable recovery for specified sanitizers
979
980.. program:: clang247
981.. option:: -fsanitize-stats, -fno-sanitize-stats
982
983Enable sanitizer statistics gathering.
984
985.. program:: clang248
986.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
987
988Enable atomic operations instrumentation in ThreadSanitizer (default)
989
990.. program:: clang249
991.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
992
993Enable function entry/exit instrumentation in ThreadSanitizer (default)
994
995.. program:: clang250
996.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
997
998Enable memory access instrumentation in ThreadSanitizer (default)
999
1000.. program:: clang251
1001.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
1002
1003Enable trapping for specified sanitizers
1004
1005.. program:: clang252
1006.. option:: -fsanitize-undefined-strip-path-components=<number>
1007
1008Strip (or keep only, if negative) a given number of path components when emitting check metadata.
1009
1010.. program:: clang253
1011.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
1012
1013.. program:: clang254
1014.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
1015
1016Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
1017
1018.. program:: clang255
1019.. option:: --param <arg>, --param=<arg>
1020
1021.. program:: clang256
1022.. option:: -std=<arg>, --std=<arg>, --std <arg>
1023
1024Language standard to compile for
1025
1026Include path management
1027~~~~~~~~~~~~~~~~~~~~~~~
1028
1029Flags controlling how ``#include``\s are resolved to files.
1030
1031.. program:: clang257
1032.. option:: -I<arg>, --include-directory <arg>, --include-directory=<arg>
1033
1034Add directory to include search path
1035
1036.. program:: clang258
1037.. option:: -I-, --include-barrier
1038
1039.. program:: clang259
1040.. option:: --cuda-path=<arg>
1041
1042CUDA installation path
1043
1044.. program:: clang260
1045.. option:: -cxx-isystem<directory>
1046
1047Add directory to the C++ SYSTEM include search path
1048
1049.. program:: clang261
1050.. option:: -fbuild-session-file=<file>
1051
1052Use the last modification time of <file> as the build session timestamp
1053
1054.. program:: clang262
1055.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
1056
1057Time when the current build session started
1058
1059.. program:: clang263
1060.. option:: -fmodules-cache-path=<directory>
1061
1062Specify the module cache path
1063
1064.. program:: clang264
1065.. option:: -fmodules-disable-diagnostic-validation
1066
1067Disable validation of the diagnostic options when loading the module
1068
1069.. program:: clang265
1070.. option:: -fmodules-prune-after=<seconds>
1071
1072Specify the interval (in seconds) after which a module file will be considered unused
1073
1074.. program:: clang266
1075.. option:: -fmodules-prune-interval=<seconds>
1076
1077Specify the interval (in seconds) between attempts to prune the module cache
1078
1079.. program:: clang267
1080.. option:: -fmodules-user-build-path <directory>
1081
1082Specify the module user build path
1083
1084.. program:: clang268
1085.. option:: -fmodules-validate-once-per-build-session
1086
1087Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1088
1089.. program:: clang269
1090.. option:: -fmodules-validate-system-headers
1091
1092Validate the system headers that a module depends on when loading the module
1093
1094.. program:: clang270
1095.. option:: -fprebuilt-module-path=<directory>
1096
1097Specify the prebuilt module path
1098
1099.. program:: clang271
1100.. option:: -i<arg>
1101
1102.. program:: clang272
1103.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1104
1105Add directory to AFTER include search path
1106
1107.. program:: clang273
1108.. option:: -iframework<arg>
1109
1110Add directory to SYSTEM framework search path
1111
1112.. program:: clang274
1113.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1114
1115Include macros from file before parsing
1116
1117.. program:: clang275
1118.. option:: -include<file>, --include<file>, --include=<arg>
1119
1120Include file before parsing
1121
1122.. program:: clang276
1123.. option:: -include-pch <file>
1124
1125Include precompiled header file
1126
1127.. program:: clang277
1128.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1129
1130Set the -iwithprefix/-iwithprefixbefore prefix
1131
1132.. program:: clang278
1133.. option:: -iquote<directory>
1134
1135Add directory to QUOTE include search path
1136
1137.. program:: clang279
1138.. option:: -isysroot<dir>
1139
1140Set the system root directory (usually /)
1141
1142.. program:: clang280
1143.. option:: -isystem<directory>
1144
1145Add directory to SYSTEM include search path
1146
1147.. program:: clang281
1148.. option:: -isystem-after<directory>
1149
1150Add directory to end of the SYSTEM include search path
1151
1152.. program:: clang282
1153.. option:: -ivfsoverlay<arg>
1154
1155Overlay the virtual filesystem described by file over the real file system
1156
1157.. program:: clang283
1158.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1159
1160Set directory to SYSTEM include search path with prefix
1161
1162.. program:: clang284
1163.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1164
1165Set directory to include search path with prefix
1166
1167.. program:: clang285
1168.. option:: -iwithsysroot<directory>
1169
1170Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1171
1172.. program:: clang286
1173.. option:: --ptxas-path=<arg>
1174
1175Path to ptxas (used for compiling CUDA code)
1176
1177.. program:: clang287
1178.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1179
1180Treat all #include paths starting with <prefix> as including a system header.
1181
1182Dependency file generation
1183~~~~~~~~~~~~~~~~~~~~~~~~~~
1184
1185Flags controlling generation of a dependency file for ``make``-like build
1186systems.
1187
1188.. program:: clang288
1189.. option:: -M, --dependencies
1190
1191Like -MD, but also implies -E and writes to stdout by default
1192
1193.. program:: clang289
1194.. option:: -MD, --write-dependencies
1195
1196Write a depfile containing user and system headers
1197
1198.. program:: clang290
1199.. option:: -MF<file>
1200
1201Write depfile output from -MMD, -MD, -MM, or -M to <file>
1202
1203.. program:: clang291
1204.. option:: -MG, --print-missing-file-dependencies
1205
1206Add missing headers to depfile
1207
1208.. program:: clang292
1209.. option:: -MJ<arg>
1210
1211Write a compilation database entry per input
1212
1213.. program:: clang293
1214.. option:: -MM, --user-dependencies
1215
1216Like -MMD, but also implies -E and writes to stdout by default
1217
1218.. program:: clang294
1219.. option:: -MMD, --write-user-dependencies
1220
1221Write a depfile containing user headers
1222
1223.. program:: clang295
1224.. option:: -MP
1225
1226Create phony target for each dependency (other than main file)
1227
1228.. program:: clang296
1229.. option:: -MQ<arg>
1230
1231Specify name of main file output to quote in depfile
1232
1233.. program:: clang297
1234.. option:: -MT<arg>
1235
1236Specify name of main file output in depfile
1237
1238.. program:: clang298
1239.. option:: -MV
1240
1241Use NMake/Jom format for the depfile
1242
1243Dumping preprocessor state
1244~~~~~~~~~~~~~~~~~~~~~~~~~~
1245
1246Flags allowing the state of the preprocessor to be dumped in various ways.
1247
1248.. program:: clang299
1249.. option:: -d
1250
1251.. program:: clang300
1252.. option:: -d<arg>
1253
1254.. program:: clang301
1255.. option:: -dA
1256
1257.. program:: clang302
1258.. option:: -dD
1259
1260Print macro definitions in -E mode in addition to normal output
1261
1262.. program:: clang303
1263.. option:: -dI
1264
1265Print include directives in -E mode in addition to normal output
1266
1267.. program:: clang304
1268.. option:: -dM
1269
1270Print macro definitions in -E mode instead of normal output
1271
1272Diagnostic flags
1273~~~~~~~~~~~~~~~~
1274
1275Flags controlling which warnings, errors, and remarks Clang will generate.
1276See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1277
1278.. program:: clang305
1279.. option:: -R<remark>
1280
1281Enable the specified remark
1282
1283.. program:: clang306
1284.. option:: -Rpass-analysis=<arg>
1285
1286Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1287
1288.. program:: clang307
1289.. option:: -Rpass-missed=<arg>
1290
1291Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1292
1293.. program:: clang308
1294.. option:: -Rpass=<arg>
1295
1296Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1297
1298.. program:: clang309
1299.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1300
1301Enable the specified warning
1302
1303.. program:: clang310
1304.. option:: -WCL4
1305
1306.. program:: clang311
1307.. option:: -Wall, --all-warnings
1308
1309.. program:: clang312
1310.. option:: -Wdeprecated, -Wno-deprecated
1311
1312.. program:: clang313
1313.. option:: -Wextra
1314
1315.. program:: clang314
1316.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1317
1318.. program:: clang315
1319.. option:: -Wwrite-strings, -Wno-write-strings
1320
1321Target-independent compilation options
1322~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1323.. program:: clang316
1324.. option:: -Wframe-larger-than=<arg>
1325
1326.. program:: clang317
1327.. option:: -fPIC, -fno-PIC
1328
1329.. program:: clang318
1330.. option:: -fPIE, -fno-PIE
1331
1332.. program:: clang319
1333.. option:: -faccess-control, -fno-access-control
1334
1335.. program:: clang320
1336.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
1337
1338Enable C++17 aligned allocation functions
1339
1340.. program:: clang321
1341.. option:: -fallow-unsupported
1342
1343.. program:: clang322
1344.. option:: -faltivec, -fno-altivec, -maltivec
1345
1346Enable AltiVec vector initializer syntax
1347
1348.. program:: clang323
1349.. option:: -fansi-escape-codes
1350
1351Use ANSI escape codes for diagnostics
1352
1353.. program:: clang324
1354.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1355
1356Use Apple's kernel extensions ABI
1357
1358.. program:: clang325
1359.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1360
1361Enable Apple gcc-compatible #pragma pack handling
1362
1363.. program:: clang326
1364.. option:: -fapplication-extension, -fno-application-extension
1365
1366Restrict code to those available for App Extensions
1367
1368.. program:: clang327
1369.. option:: -fasm, -fno-asm
1370
1371.. program:: clang328
1372.. option:: -fasm-blocks, -fno-asm-blocks
1373
1374.. program:: clang329
1375.. option:: -fassociative-math, -fno-associative-math
1376
1377.. program:: clang330
1378.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1379
1380.. program:: clang331
1381.. option:: -fast
1382
1383.. program:: clang332
1384.. option:: -fastcp
1385
1386.. program:: clang333
1387.. option:: -fastf
1388
1389.. program:: clang334
1390.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1391
1392.. program:: clang335
1393.. option:: -fautolink, -fno-autolink
1394
1395.. program:: clang336
1396.. option:: -fblocks, -fno-blocks
1397
1398Enable the 'blocks' language feature
1399
1400.. program:: clang337
1401.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1402
1403.. program:: clang338
1404.. option:: -fborland-extensions, -fno-borland-extensions
1405
1406Accept non-standard constructs supported by the Borland compiler
1407
1408.. program:: clang339
1409.. option:: -fbracket-depth=<arg>
1410
1411.. program:: clang340
1412.. option:: -fbuiltin, -fno-builtin
1413
1414.. program:: clang341
1415.. option:: -fbuiltin-module-map
1416
1417Load the clang builtins module map file.
1418
1419.. program:: clang342
1420.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1421
1422.. program:: clang343
1423.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1424
1425.. program:: clang344
1426.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1427
1428Use colors in diagnostics
1429
1430.. program:: clang345
1431.. option:: -fcommon, -fno-common
1432
1433.. program:: clang346
1434.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1435
1436.. program:: clang347
1437.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1438
1439.. program:: clang348
1440.. option:: -fconstant-string-class=<arg>
1441
1442.. program:: clang349
1443.. option:: -fconstexpr-backtrace-limit=<arg>
1444
1445.. program:: clang350
1446.. option:: -fconstexpr-depth=<arg>
1447
1448.. program:: clang351
1449.. option:: -fconstexpr-steps=<arg>
1450
1451.. program:: clang352
1452.. option:: -fcoroutines-ts, -fno-coroutines-ts
1453
1454Enable support for the C++ Coroutines TS
1455
1456.. program:: clang353
1457.. option:: -fcoverage-mapping, -fno-coverage-mapping
1458
1459Generate coverage mapping to enable code coverage analysis
1460
1461.. program:: clang354
1462.. option:: -fcreate-profile
1463
1464.. program:: clang355
1465.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1466
1467Enable C++ exceptions
1468
1469.. program:: clang356
1470.. option:: -fcxx-modules, -fno-cxx-modules
1471
1472.. program:: clang357
1473.. option:: -fdata-sections, -fno-data-sections
1474
1475Place each data in its own section (ELF Only)
1476
1477.. program:: clang358
1478.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1479
1480Emit extra debug info to make sample profile more accurate.
1481
1482.. program:: clang359
1483.. option:: -fdebug-pass-arguments
1484
1485.. program:: clang360
1486.. option:: -fdebug-pass-structure
1487
1488.. program:: clang361
1489.. option:: -fdebug-prefix-map=<arg>
1490
1491remap file source paths in debug info
1492
1493.. program:: clang362
1494.. option:: -fdebug-types-section, -fno-debug-types-section
1495
1496Place debug types in their own section (ELF Only)
1497
1498.. program:: clang363
1499.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1500
1501Parse templated function definitions at the end of the translation unit
1502
1503.. program:: clang364
1504.. option:: -fdenormal-fp-math=<arg>
1505
1506.. program:: clang365
1507.. option:: -fdiagnostics-absolute-paths
1508
1509Print absolute paths in diagnostics
1510
1511.. program:: clang366
1512.. option:: -fdiagnostics-color, -fno-diagnostics-color
1513
1514.. program:: clang367
1515.. option:: -fdiagnostics-color=<arg>
1516
1517.. program:: clang368
1518.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1519
1520Enable profile hotness information in diagnostic line
1521
1522.. program:: clang369
1523.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1524
1525Display include stacks for diagnostic notes
1526
1527.. program:: clang370
1528.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1529
1530Print option name with mappable diagnostics
1531
1532.. program:: clang371
1533.. option:: -fdiagnostics-show-template-tree
1534
1535Print a template comparison tree for differing templates
1536
1537.. program:: clang372
1538.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1539
1540Allow '$' in identifiers
1541
1542.. program:: clang373
1543.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1544
1545.. program:: clang374
1546.. option:: -felide-constructors, -fno-elide-constructors
1547
1548.. program:: clang375
1549.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1550
1551.. program:: clang376
1552.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1553
1554Embed LLVM bitcode (option: off, all, bitcode, marker)
1555
1556.. program:: clang377
1557.. option:: -femit-all-decls
1558
1559Emit all declarations, even if unused
1560
1561.. program:: clang378
1562.. option:: -femulated-tls, -fno-emulated-tls
1563
1564Use emutls functions to access thread\_local variables
1565
1566.. program:: clang379
1567.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1568
1569.. program:: clang380
1570.. option:: -ferror-limit=<arg>
1571
1572.. program:: clang381
1573.. option:: -fexceptions, -fno-exceptions
1574
1575Enable support for exception handling
1576
1577.. program:: clang382
1578.. option:: -fexec-charset=<arg>
1579
1580.. program:: clang383
1581.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1582
1583.. program:: clang384
1584.. option:: -ffast-math, -fno-fast-math
1585
1586Allow aggressive, lossy floating-point optimizations
1587
1588.. program:: clang385
1589.. option:: -ffinite-math-only, -fno-finite-math-only
1590
1591.. program:: clang386
1592.. option:: -ffor-scope, -fno-for-scope
1593
1594.. program:: clang387
1595.. option:: -ffp-contract=<arg>
1596
1597Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1598
1599.. program:: clang388
1600.. option:: -ffreestanding
1601
1602Assert that the compilation takes place in a freestanding environment
1603
1604.. program:: clang389
1605.. option:: -ffunction-sections, -fno-function-sections
1606
1607Place each function in its own section (ELF Only)
1608
1609.. program:: clang390
1610.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1611
1612.. program:: clang391
1613.. option:: -fgnu-keywords, -fno-gnu-keywords
1614
1615Allow GNU-extension keywords regardless of language standard
1616
1617.. program:: clang392
1618.. option:: -fgnu-runtime
1619
1620Generate output compatible with the standard GNU Objective-C runtime
1621
1622.. program:: clang393
1623.. option:: -fgnu89-inline, -fno-gnu89-inline
1624
1625Use the gnu89 inline semantics
1626
1627.. program:: clang394
1628.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1629
1630.. program:: clang395
1631.. option:: -fhonor-nans, -fno-honor-nans
1632
1633.. program:: clang396
1634.. option:: -fhosted
1635
1636.. program:: clang397
1637.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1638
1639Implicitly search the file system for module map files.
1640
1641.. program:: clang398
1642.. option:: -fimplicit-modules, -fno-implicit-modules
1643
1644.. program:: clang399
1645.. option:: -finput-charset=<arg>
1646
1647.. program:: clang400
1648.. option:: -finstrument-functions
1649
1650Generate calls to instrument function entry and exit
1651
1652.. program:: clang401
1653.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1654
1655Enable the integrated assembler
1656
1657.. program:: clang402
1658.. option:: -fjump-tables, -fno-jump-tables
1659
1660.. program:: clang403
1661.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1662
1663.. program:: clang404
1664.. option:: -flimited-precision=<arg>
1665
1666.. program:: clang405
1667.. option:: -flto, -fno-lto
1668
1669Enable LTO in 'full' mode
1670
1671.. program:: clang406
1672.. option:: -flto-jobs=<arg>
1673
1674Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1675
1676.. program:: clang407
1677.. option:: -flto=<arg>
1678
1679Set LTO mode to either 'full' or 'thin'
1680
1681.. program:: clang408
1682.. option:: -fmacro-backtrace-limit=<arg>
1683
1684.. program:: clang409
1685.. option:: -fmath-errno, -fno-math-errno
1686
1687Require math functions to indicate errors by setting errno
1688
1689.. program:: clang410
1690.. option:: -fmax-type-align=<arg>
1691
1692Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1693
1694.. program:: clang411
1695.. option:: -fmerge-all-constants, -fno-merge-all-constants
1696
1697.. program:: clang412
1698.. option:: -fmessage-length=<arg>
1699
1700.. program:: clang413
1701.. option:: -fmodule-file-deps, -fno-module-file-deps
1702
1703.. program:: clang414
1704.. option:: -fmodule-file=<file>
1705
1706Load this precompiled module file
1707
1708.. program:: clang415
1709.. option:: -fmodule-map-file=<file>
1710
1711Load this module map file
1712
1713.. program:: clang416
1714.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1715
1716Specify the name of the module to build
1717
1718.. program:: clang417
1719.. option:: -fmodules, -fno-modules
1720
1721Enable the 'modules' language feature
1722
1723.. program:: clang418
1724.. option:: -fmodules-decluse, -fno-modules-decluse
1725
1726Require declaration of modules used within a module
1727
1728.. program:: clang419
1729.. option:: -fmodules-ignore-macro=<arg>
1730
1731Ignore the definition of the given macro when building and loading modules
1732
1733.. program:: clang420
1734.. option:: -fmodules-search-all, -fno-modules-search-all
1735
1736Search even non-imported modules to resolve references
1737
1738.. program:: clang421
1739.. option:: -fmodules-strict-decluse
1740
1741Like -fmodules-decluse but requires all headers to be in modules
1742
1743.. program:: clang422
1744.. option:: -fmodules-ts
1745
1746Enable support for the C++ Modules TS
1747
1748.. program:: clang423
1749.. option:: -fms-compatibility, -fno-ms-compatibility
1750
1751Enable full Microsoft Visual C++ compatibility
1752
1753.. program:: clang424
1754.. option:: -fms-compatibility-version=<arg>
1755
1756Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1757
1758.. program:: clang425
1759.. option:: -fms-extensions, -fno-ms-extensions
1760
1761Accept some non-standard constructs supported by the Microsoft compiler
1762
1763.. program:: clang426
1764.. option:: -fms-memptr-rep=<arg>
1765
1766.. program:: clang427
1767.. option:: -fms-volatile<arg>
1768
1769.. program:: clang428
1770.. option:: -fmsc-version=<arg>
1771
1772Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1773
1774.. program:: clang429
1775.. option:: -fmudflap
1776
1777.. program:: clang430
1778.. option:: -fmudflapth
1779
1780.. program:: clang431
1781.. option:: -fnested-functions
1782
1783.. program:: clang432
1784.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1785
1786Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1787
1788.. program:: clang433
1789.. option:: -fnext-runtime
1790
1791.. program:: clang434
1792.. option:: -fno-builtin-<arg>
1793
1794Disable implicit builtin knowledge of a specific function
1795
1796.. program:: clang435
1797.. option:: -fno-elide-type
1798
1799Do not elide types when printing diagnostics
1800
1801.. program:: clang436
1802.. option:: -fno-max-type-align
1803
1804.. program:: clang437
1805.. option:: -fno-operator-names
1806
1807Do not treat C++ operator name keywords as synonyms for operators
1808
1809.. program:: clang438
1810.. option:: -fno-strict-modules-decluse
1811
1812.. program:: clang439
1813.. option:: -fno-working-directory
1814
1815.. program:: clang440
1816.. option:: -fnoopenmp-use-tls
1817
1818.. program:: clang441
1819.. option:: -fobjc-abi-version=<arg>
1820
1821.. program:: clang442
1822.. option:: -fobjc-arc, -fno-objc-arc
1823
1824Synthesize retain and release calls for Objective-C pointers
1825
1826.. program:: clang443
1827.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1828
1829Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1830
1831.. program:: clang444
1832.. option:: -fobjc-exceptions, -fno-objc-exceptions
1833
1834Enable Objective-C exceptions
1835
1836.. program:: clang445
1837.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1838
1839.. program:: clang446
1840.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1841
1842.. program:: clang447
1843.. option:: -fobjc-link-runtime
1844
1845.. program:: clang448
1846.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1847
1848.. program:: clang449
1849.. option:: -fobjc-nonfragile-abi-version=<arg>
1850
1851.. program:: clang450
1852.. option:: -fobjc-runtime=<arg>
1853
1854Specify the target Objective-C runtime kind and version
1855
1856.. program:: clang451
1857.. option:: -fobjc-sender-dependent-dispatch
1858
1859.. program:: clang452
1860.. option:: -fobjc-weak, -fno-objc-weak
1861
1862Enable ARC-style weak references in Objective-C
1863
1864.. program:: clang453
1865.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1866
1867.. program:: clang454
1868.. option:: -fopenmp, -fno-openmp
1869
1870.. program:: clang455
1871.. option:: -fopenmp-dump-offload-linker-script
1872
1873.. program:: clang456
1874.. option:: -fopenmp-use-tls
1875
1876.. program:: clang457
1877.. option:: -fopenmp-version=<arg>
1878
1879.. program:: clang458
1880.. option:: -fopenmp=<arg>
1881
1882.. program:: clang459
1883.. option:: -foperator-arrow-depth=<arg>
1884
1885.. program:: clang460
1886.. option:: -foptimization-record-file=<arg>
1887
1888Specify the file name of any generated YAML optimization record
1889
1890.. program:: clang461
1891.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1892
1893.. program:: clang462
1894.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1895
1896.. program:: clang463
1897.. option:: -fpack-struct, -fno-pack-struct
1898
1899.. program:: clang464
1900.. option:: -fpack-struct=<arg>
1901
1902Specify the default maximum struct packing alignment
1903
1904.. program:: clang465
1905.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1906
1907Recognize and construct Pascal-style string literals
1908
1909.. program:: clang466
1910.. option:: -fpcc-struct-return
1911
1912Override the default ABI to return all structs on the stack
1913
1914.. program:: clang467
1915.. option:: -fpch-preprocess
1916
1917.. program:: clang468
1918.. option:: -fpic, -fno-pic
1919
1920.. program:: clang469
1921.. option:: -fpie, -fno-pie
1922
1923.. program:: clang470
1924.. option:: -fplugin=<dsopath>
1925
1926Load the named plugin (dynamic shared object)
1927
1928.. program:: clang471
1929.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1930
1931.. program:: clang472
1932.. option:: -fprofile-arcs, -fno-profile-arcs
1933
1934.. program:: clang473
1935.. option:: -fprofile-dir=<arg>
1936
1937.. program:: clang474
1938.. option:: -fprofile-generate, -fno-profile-generate
1939
1940Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1941
1942.. program:: clang475
1943.. option:: -fprofile-generate=<directory>
1944
1945Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1946
1947.. program:: clang476
1948.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1949
1950Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1951
1952.. program:: clang477
1953.. option:: -fprofile-instr-generate=<file>
1954
1955Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1956
1957.. program:: clang478
1958.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1959
1960.. program:: clang479
1961.. option:: -fprofile-instr-use=<arg>
1962
1963Use instrumentation data for profile-guided optimization
1964
1965.. program:: clang480
1966.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
1967
1968Enable sample-based profile guided optimizations
1969
1970.. program:: clang481
1971.. option:: -fprofile-use=<pathname>
1972
1973Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1974
1975.. program:: clang482
1976.. option:: -freciprocal-math, -fno-reciprocal-math
1977
1978Allow division operations to be reassociated
1979
1980.. program:: clang483
1981.. option:: -freg-struct-return
1982
1983Override the default ABI to return small structs in registers
1984
1985.. program:: clang484
1986.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1987
1988Enable C++17 relaxed template template argument matching
1989
1990.. program:: clang485
1991.. option:: -freroll-loops, -fno-reroll-loops
1992
1993Turn on loop reroller
1994
1995.. program:: clang486
1996.. option:: -fretain-comments-from-system-headers
1997
1998.. program:: clang487
1999.. option:: -frewrite-includes, -fno-rewrite-includes
2000
2001.. program:: clang488
2002.. option:: -frewrite-map-file <arg>
2003
2004.. program:: clang489
2005.. option:: -frewrite-map-file=<arg>
2006
2007.. program:: clang490
2008.. option:: -fropi, -fno-ropi
2009
2010.. program:: clang491
2011.. option:: -frtti, -fno-rtti
2012
2013.. program:: clang492
2014.. option:: -frwpi, -fno-rwpi
2015
2016.. program:: clang493
2017.. option:: -fsave-optimization-record, -fno-save-optimization-record
2018
2019Generate a YAML optimization record file
2020
2021.. program:: clang494
2022.. option:: -fshort-enums, -fno-short-enums
2023
2024Allocate to an enum type only as many bytes as it needs for the declared range of possible values
2025
2026.. program:: clang495
2027.. option:: -fshort-wchar, -fno-short-wchar
2028
2029Force wchar\_t to be a short unsigned int
2030
2031.. program:: clang496
2032.. option:: -fshow-column, -fno-show-column
2033
2034.. program:: clang497
2035.. option:: -fshow-overloads=<arg>
2036
2037Which overload candidates to show when overload resolution fails: best\|all; defaults to all
2038
2039.. program:: clang498
2040.. option:: -fshow-source-location, -fno-show-source-location
2041
2042.. program:: clang499
2043.. option:: -fsignaling-math, -fno-signaling-math
2044
2045.. program:: clang500
2046.. option:: -fsigned-bitfields
2047
2048.. program:: clang501
2049.. option:: -fsigned-char, -fno-signed-char, --signed-char
2050
2051.. program:: clang502
2052.. option:: -fsigned-zeros, -fno-signed-zeros
2053
2054.. program:: clang503
2055.. option:: -fsized-deallocation, -fno-sized-deallocation
2056
2057Enable C++14 sized global deallocation functions
2058
2059.. program:: clang504
2060.. option:: -fsjlj-exceptions
2061
2062Use SjLj style exceptions
2063
2064.. program:: clang505
2065.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
2066
2067Enable the superword-level parallelism vectorization passes
2068
2069.. program:: clang506
2070.. option:: -fslp-vectorize-aggressive, -fno-slp-vectorize-aggressive
2071
2072Enable the BB vectorization passes
2073
2074.. program:: clang507
2075.. option:: -fspell-checking, -fno-spell-checking
2076
2077.. program:: clang508
2078.. option:: -fspell-checking-limit=<arg>
2079
2080.. program:: clang509
2081.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
2082
2083Place debug types in their own section (ELF Only)
2084
2085.. program:: clang510
2086.. option:: -fsplit-stack
2087
2088.. program:: clang511
2089.. option:: -fstack-protector, -fno-stack-protector
2090
2091Enable stack protectors for functions potentially vulnerable to stack smashing
2092
2093.. program:: clang512
2094.. option:: -fstack-protector-all
2095
2096Force the usage of stack protectors for all functions
2097
2098.. program:: clang513
2099.. option:: -fstack-protector-strong
2100
2101Use a strong heuristic to apply stack protectors to functions
2102
2103.. program:: clang514
2104.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
2105
2106Emit full debug info for all types used by the program
2107
2108.. program:: clang515
2109.. option:: -fstrict-aliasing, -fno-strict-aliasing
2110
2111.. program:: clang516
2112.. option:: -fstrict-enums, -fno-strict-enums
2113
2114Enable optimizations based on the strict definition of an enum's value range
2115
2116.. program:: clang517
2117.. option:: -fstrict-overflow, -fno-strict-overflow
2118
2119.. program:: clang518
2120.. option:: -fstrict-return, -fno-strict-return
2121
2122Always treat control flow paths that fall off the end of a non-voidfunction as unreachable
2123
2124.. program:: clang519
2125.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
2126
2127Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
2128
2129.. program:: clang520
2130.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
2131
2132.. program:: clang521
2133.. option:: -ftabstop=<arg>
2134
2135.. program:: clang522
2136.. option:: -ftemplate-backtrace-limit=<arg>
2137
2138.. program:: clang523
2139.. option:: -ftemplate-depth-<arg>
2140
2141.. program:: clang524
2142.. option:: -ftemplate-depth=<arg>
2143
2144.. program:: clang525
2145.. option:: -ftest-coverage
2146
2147.. program:: clang526
2148.. option:: -fthinlto-index=<arg>
2149
2150Perform ThinLTO importing using provided function summary index
2151
2152.. program:: clang527
2153.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
2154
2155.. program:: clang528
2156.. option:: -ftime-report
2157
2158.. program:: clang529
2159.. option:: -ftls-model=<arg>
2160
2161.. program:: clang530
2162.. option:: -ftrap-function=<arg>
2163
2164Issue call to specified function rather than a trap instruction
2165
2166.. program:: clang531
2167.. option:: -ftrapping-math, -fno-trapping-math
2168
2169.. program:: clang532
2170.. option:: -ftrapv
2171
2172Trap on integer overflow
2173
2174.. program:: clang533
2175.. option:: -ftrapv-handler <arg>
2176
2177.. program:: clang534
2178.. option:: -ftrapv-handler=<function name>
2179
2180Specify the function to be called on overflow
2181
2182.. program:: clang535
2183.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
2184
2185Process trigraph sequences
2186
2187.. program:: clang536
2188.. option:: -funique-section-names, -fno-unique-section-names
2189
2190Use unique names for text and data sections (ELF Only)
2191
2192.. program:: clang537
2193.. option:: -funit-at-a-time, -fno-unit-at-a-time
2194
2195.. program:: clang538
2196.. option:: -funroll-loops, -fno-unroll-loops
2197
2198Turn on loop unroller
2199
2200.. program:: clang539
2201.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
2202
2203.. program:: clang540
2204.. option:: -funsigned-bitfields
2205
2206.. program:: clang541
2207.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
2208
2209.. program:: clang542
2210.. option:: -funwind-tables, -fno-unwind-tables
2211
2212.. program:: clang543
2213.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
2214
2215.. program:: clang544
2216.. option:: -fuse-init-array, -fno-use-init-array
2217
2218Use .init\_array instead of .ctors
2219
2220.. program:: clang545
2221.. option:: -fuse-ld=<arg>
2222
2223.. program:: clang546
2224.. option:: -fuse-line-directives, -fno-use-line-directives
2225
2226.. program:: clang547
2227.. option:: -fveclib=<arg>
2228
2229Use the given vector functions library
2230
2231.. program:: clang548
2232.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2233
2234Enable the loop vectorization passes
2235
2236.. program:: clang549
2237.. option:: -fverbose-asm, -fno-verbose-asm
2238
2239.. program:: clang550
2240.. option:: -fvisibility-inlines-hidden
2241
2242Give inline C++ member functions default visibility by default
2243
2244.. program:: clang551
2245.. option:: -fvisibility-ms-compat
2246
2247Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2248
2249.. program:: clang552
2250.. option:: -fvisibility=<arg>
2251
2252Set the default symbol visibility for all global declarations
2253
2254.. program:: clang553
2255.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2256
2257Enables whole-program vtable optimization. Requires -flto
2258
2259.. program:: clang554
2260.. option:: -fwrapv, -fno-wrapv
2261
2262Treat signed integer overflow as two's complement
2263
2264.. program:: clang555
2265.. option:: -fwritable-strings
2266
2267Store string literals as writable data
2268
2269.. program:: clang556
2270.. option:: -fxray-instruction-threshold<arg>
2271
2272.. program:: clang557
2273.. option:: -fxray-instruction-threshold=<arg>
2274
2275Sets the minimum function size to instrument with XRay
2276
2277.. program:: clang558
2278.. option:: -fxray-instrument, -fno-xray-instrument
2279
2280Generate XRay instrumentation sleds on function entry and exit
2281
2282.. program:: clang559
2283.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2284
2285.. program:: clang560
2286.. option:: -fzvector, -fno-zvector, -mzvector
2287
2288Enable System z vector language extension
2289
2290.. program:: clang561
2291.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2292
2293.. program:: clang562
2294.. option:: -pedantic-errors, --pedantic-errors
2295
2296OpenCL flags
2297------------
2298.. program:: clang563
2299.. option:: -cl-denorms-are-zero
2300
2301OpenCL only. Allow denormals to be flushed to zero.
2302
2303.. program:: clang564
2304.. option:: -cl-fast-relaxed-math
2305
2306OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2307
2308.. program:: clang565
2309.. option:: -cl-finite-math-only
2310
2311OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2312
2313.. program:: clang566
2314.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2315
2316OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2317
2318.. program:: clang567
2319.. option:: -cl-kernel-arg-info
2320
2321OpenCL only. Generate kernel argument metadata.
2322
2323.. program:: clang568
2324.. option:: -cl-mad-enable
2325
2326OpenCL only. Allow use of less precise MAD computations in the generated binary.
2327
2328.. program:: clang569
2329.. option:: -cl-no-signed-zeros
2330
2331OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2332
2333.. program:: clang570
2334.. option:: -cl-opt-disable
2335
2336OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2337
2338.. program:: clang571
2339.. option:: -cl-single-precision-constant
2340
2341OpenCL only. Treat double precision floating-point constant as single precision constant.
2342
2343.. program:: clang572
2344.. option:: -cl-std=<arg>
2345
2346OpenCL language standard to compile for.
2347
2348.. program:: clang573
2349.. option:: -cl-strict-aliasing
2350
2351OpenCL only. This option is added for compatibility with OpenCL 1.0.
2352
2353.. program:: clang574
2354.. option:: -cl-unsafe-math-optimizations
2355
2356OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.
2357
2358Target-dependent compilation options
2359~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2360.. program:: clang575
2361.. option:: -m16
2362
2363.. program:: clang576
2364.. option:: -m32
2365
2366.. program:: clang577
2367.. option:: -m64
2368
2369.. program:: clang578
2370.. option:: -mabi=<arg>
2371
2372.. program:: clang579
2373.. option:: -mabicalls, -mno-abicalls
2374
2375Enable SVR4-style position-independent code (Mips only)
2376
2377.. program:: clang580
2378.. option:: -malign-double
2379
2380Align doubles to two words in structs (x86 only)
2381
2382.. program:: clang581
2383.. option:: -march=<arg>
2384
2385.. program:: clang582
2386.. option:: -masm=<arg>
2387
2388.. program:: clang583
2389.. option:: -mbackchain, -mno-backchain
2390
2391Link stack frames through backchain on System Z
2392
2393.. program:: clang584
2394.. option:: -mcheck-zero-division, -mno-check-zero-division
2395
2396.. program:: clang585
2397.. option:: -mcmodel=<arg>
2398
2399.. program:: clang586
2400.. option:: -mcompact-branches=<arg>
2401
2402.. program:: clang587
2403.. option:: -mconsole<arg>
2404
2405.. program:: clang588
2406.. option:: -mcpu=<arg>, -mv4 (equivalent to -mcpu=hexagonv4), -mv5 (equivalent to -mcpu=hexagonv5), -mv55 (equivalent to -mcpu=hexagonv55), -mv60 (equivalent to -mcpu=hexagonv60)
2407
2408.. program:: clang589
2409.. option:: -mdll<arg>
2410
2411.. program:: clang590
2412.. option:: -mdouble-float
2413
2414.. program:: clang591
2415.. option:: -mdsp, -mno-dsp
2416
2417.. program:: clang592
2418.. option:: -mdspr2, -mno-dspr2
2419
2420.. program:: clang593
2421.. option:: -mdynamic-no-pic<arg>
2422
2423.. program:: clang594
2424.. option:: -meabi <arg>
2425
2426Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2427
2428.. program:: clang595
2429.. option:: -mfloat-abi=<arg>
2430
2431.. program:: clang596
2432.. option:: -mfp32
2433
2434Use 32-bit floating point registers (MIPS only)
2435
2436.. program:: clang597
2437.. option:: -mfp64
2438
2439Use 64-bit floating point registers (MIPS only)
2440
2441.. program:: clang598
2442.. option:: -mfpmath=<arg>
2443
2444.. program:: clang599
2445.. option:: -mfpu=<arg>
2446
2447.. program:: clang600
2448.. option:: -mglobal-merge, -mno-global-merge
2449
2450Enable merging of globals
2451
2452.. program:: clang601
2453.. option:: -mhard-float
2454
2455.. program:: clang602
2456.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2457
2458.. program:: clang603
2459.. option:: -miamcu, -mno-iamcu
2460
2461Use Intel MCU ABI
2462
2463.. program:: clang604
2464.. option:: -mimplicit-float, -mno-implicit-float
2465
2466.. program:: clang605
2467.. option:: -mimplicit-it=<arg>
2468
2469.. program:: clang606
2470.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2471
2472(integrated-as) Emit an object file which can be used with an incremental linker
2473
2474.. program:: clang607
2475.. option:: -miphoneos-version-min=<arg>, -mios-simulator-version-min=<arg>, -mios-version-min=<arg>, -miphonesimulator-version-min=<arg>
2476
2477.. program:: clang608
2478.. option:: -mips16
2479
2480.. program:: clang609
2481.. option:: -mkernel
2482
2483.. program:: clang610
2484.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2485
2486.. program:: clang611
2487.. option:: -mlong-calls, -mno-long-calls
2488
2489Generate branches with extended addressability, usually via indirect jumps.
2490
2491.. program:: clang612
2492.. option:: -mmacosx-version-min=<arg>
2493
2494Set Mac OS X deployment target
2495
2496.. program:: clang613
2497.. option:: -mmicromips, -mno-micromips
2498
2499.. program:: clang614
2500.. option:: -mms-bitfields, -mno-ms-bitfields
2501
2502Set the default structure layout to be compatible with the Microsoft compiler standard
2503
2504.. program:: clang615
2505.. option:: -mmsa, -mno-msa
2506
2507Enable MSA ASE (MIPS only)
2508
2509.. program:: clang616
2510.. option:: -mnan=<arg>
2511
2512.. program:: clang617
2513.. option:: -mno-mips16
2514
2515.. program:: clang618
2516.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2517
2518Omit frame pointer setup for leaf functions
2519
2520.. program:: clang619
2521.. option:: -moslib=<arg>
2522
2523.. program:: clang620
2524.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2525
2526Use copy relocations support for PIE builds
2527
2528.. program:: clang621
2529.. option:: -mqdsp6-compat
2530
2531Enable hexagon-qdsp6 backward compatibility
2532
2533.. program:: clang622
2534.. option:: -mrecip
2535
2536.. program:: clang623
2537.. option:: -mrecip=<arg1>,<arg2>...
2538
2539.. program:: clang624
2540.. option:: -mred-zone, -mno-red-zone
2541
2542.. program:: clang625
2543.. option:: -mregparm=<arg>
2544
2545.. program:: clang626
2546.. option:: -mrelax-all, -mno-relax-all
2547
2548(integrated-as) Relax all machine instructions
2549
2550.. program:: clang627
2551.. option:: -mrtd, -mno-rtd
2552
2553Make StdCall calling convention the default
2554
2555.. program:: clang628
2556.. option:: -msingle-float
2557
2558.. program:: clang629
2559.. option:: -msmall-data-threshold=<arg>
2560
2561.. program:: clang630
2562.. option:: -msoft-float, -mno-soft-float
2563
2564Use software floating point
2565
2566.. program:: clang631
2567.. option:: -mstack-alignment=<arg>
2568
2569Set the stack alignment
2570
2571.. program:: clang632
2572.. option:: -mstack-probe-size=<arg>
2573
2574Set the stack probe size
2575
2576.. program:: clang633
2577.. option:: -mstackrealign, -mno-stackrealign
2578
2579Force realign the stack at entry to every function
2580
2581.. program:: clang634
2582.. option:: -mthread-model <arg>
2583
2584The thread model to use, e.g. posix, single (posix by default)
2585
2586.. program:: clang635
2587.. option:: -mthreads<arg>
2588
2589.. program:: clang636
2590.. option:: -mthumb, -mno-thumb
2591
2592.. program:: clang637
2593.. option:: -mtune=<arg>
2594
2595.. program:: clang638
2596.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>, -mappletvsimulator-version-min=<arg>, -mtvos-simulator-version-min=<arg>
2597
2598.. program:: clang639
2599.. option:: -municode<arg>
2600
2601.. program:: clang640
2602.. option:: -mvx, -mno-vx
2603
2604.. program:: clang641
2605.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2606
2607.. program:: clang642
2608.. option:: -mwatchos-version-min=<arg>, -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
2609
2610.. program:: clang643
2611.. option:: -mwindows<arg>
2612
2613.. program:: clang644
2614.. option:: -mx32
2615
2616.. program:: clang645
2617.. option:: -mxgot, -mno-xgot
2618
2619AARCH64
2620-------
2621.. program:: clang646
2622.. option:: -ffixed-x18
2623
2624Reserve the x18 register (AArch64 only)
2625
2626.. program:: clang647
2627.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2628
2629Workaround Cortex-A53 erratum 835769 (AArch64 only)
2630
2631.. program:: clang648
2632.. option:: -mgeneral-regs-only
2633
2634Generate code which only uses the general purpose registers (AArch64 only)
2635
2636AMDGPU
2637------
2638ARM
2639---
2640.. program:: clang649
2641.. option:: -ffixed-r9
2642
2643Reserve the r9 register (ARM only)
2644
2645.. program:: clang650
2646.. option:: -mcrc
2647
2648Allow use of CRC instructions (ARM only)
2649
2650.. program:: clang651
2651.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2652
2653Disallow generation of data access to code sections (ARM only)
2654
2655.. program:: clang652
2656.. option:: -mno-movt
2657
2658Disallow use of movt/movw pairs (ARM only)
2659
2660.. program:: clang653
2661.. option:: -mnocrc
2662
2663Disallow use of CRC instructions (ARM only)
2664
2665.. program:: clang654
2666.. option:: -mrestrict-it, -mno-restrict-it
2667
2668Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2669
2670.. program:: clang655
2671.. option:: -munaligned-access, -mno-unaligned-access
2672
2673Allow memory accesses to be unaligned (AArch32/AArch64 only)
2674
2675Hexagon
2676-------
2677.. program:: clang656
2678.. option:: -mhvx, -mno-hvx
2679
2680Enable Hexagon Vector eXtensions
2681
2682.. program:: clang657
2683.. option:: -mhvx-double, -mno-hvx-double
2684
2685Enable Hexagon Double Vector eXtensions
2686
2687.. program:: clang658
2688.. option:: -mieee-rnd-near
2689
2690PowerPC
2691-------
2692.. program:: clang659
2693.. option:: -mcmpb, -mno-cmpb
2694
2695.. program:: clang660
2696.. option:: -mcrbits, -mno-crbits
2697
2698.. program:: clang661
2699.. option:: -mcrypto, -mno-crypto
2700
2701.. program:: clang662
2702.. option:: -mdirect-move, -mno-direct-move
2703
2704.. program:: clang663
2705.. option:: -mfloat128, -mno-float128
2706
2707.. program:: clang664
2708.. option:: -mfprnd, -mno-fprnd
2709
2710.. program:: clang665
2711.. option:: -mhtm, -mno-htm
2712
2713.. program:: clang666
2714.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2715
2716.. program:: clang667
2717.. option:: -misel, -mno-isel
2718
2719.. program:: clang668
2720.. option:: -mlongcall, -mno-longcall
2721
2722.. program:: clang669
2723.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2724
2725.. program:: clang670
2726.. option:: -mpopcntd, -mno-popcntd
2727
2728.. program:: clang671
2729.. option:: -mpower8-vector, -mno-power8-vector
2730
2731.. program:: clang672
2732.. option:: -mpower9-vector, -mno-power9-vector
2733
2734.. program:: clang673
2735.. option:: -mqpx, -mno-qpx
2736
2737.. program:: clang674
2738.. option:: -mvsx, -mno-vsx
2739
2740WebAssembly
2741-----------
2742.. program:: clang675
2743.. option:: -msimd128, -mno-simd128
2744
2745X86
2746---
2747.. program:: clang676
2748.. option:: -m3dnow, -mno-3dnow
2749
2750.. program:: clang677
2751.. option:: -m3dnowa, -mno-3dnowa
2752
2753.. program:: clang678
2754.. option:: -madx, -mno-adx
2755
2756.. program:: clang679
2757.. option:: -maes, -mno-aes
2758
2759.. program:: clang680
2760.. option:: -mavx, -mno-avx
2761
2762.. program:: clang681
2763.. option:: -mavx2, -mno-avx2
2764
2765.. program:: clang682
2766.. option:: -mavx512bw, -mno-avx512bw
2767
2768.. program:: clang683
2769.. option:: -mavx512cd, -mno-avx512cd
2770
2771.. program:: clang684
2772.. option:: -mavx512dq, -mno-avx512dq
2773
2774.. program:: clang685
2775.. option:: -mavx512er, -mno-avx512er
2776
2777.. program:: clang686
2778.. option:: -mavx512f, -mno-avx512f
2779
2780.. program:: clang687
2781.. option:: -mavx512ifma, -mno-avx512ifma
2782
2783.. program:: clang688
2784.. option:: -mavx512pf, -mno-avx512pf
2785
2786.. program:: clang689
2787.. option:: -mavx512vbmi, -mno-avx512vbmi
2788
2789.. program:: clang690
2790.. option:: -mavx512vl, -mno-avx512vl
2791
2792.. program:: clang691
2793.. option:: -mbmi, -mno-bmi
2794
2795.. program:: clang692
2796.. option:: -mbmi2, -mno-bmi2
2797
2798.. program:: clang693
2799.. option:: -mcx16, -mno-cx16
2800
2801.. program:: clang694
2802.. option:: -mf16c, -mno-f16c
2803
2804.. program:: clang695
2805.. option:: -mfma, -mno-fma
2806
2807.. program:: clang696
2808.. option:: -mfma4, -mno-fma4
2809
2810.. program:: clang697
2811.. option:: -mfsgsbase, -mno-fsgsbase
2812
2813.. program:: clang698
2814.. option:: -mfxsr, -mno-fxsr
2815
2816.. program:: clang699
2817.. option:: -mlzcnt, -mno-lzcnt
2818
2819.. program:: clang700
2820.. option:: -mmmx, -mno-mmx
2821
2822.. program:: clang701
2823.. option:: -mmwaitx, -mno-mwaitx
2824
2825.. program:: clang702
2826.. option:: -mpclmul, -mno-pclmul
2827
2828.. program:: clang703
2829.. option:: -mpku, -mno-pku
2830
2831.. program:: clang704
2832.. option:: -mpopcnt, -mno-popcnt
2833
2834.. program:: clang705
2835.. option:: -mprfchw, -mno-prfchw
2836
2837.. program:: clang706
2838.. option:: -mrdrnd, -mno-rdrnd
2839
2840.. program:: clang707
2841.. option:: -mrdseed, -mno-rdseed
2842
2843.. program:: clang708
2844.. option:: -mrtm, -mno-rtm
2845
2846.. program:: clang709
2847.. option:: -msha, -mno-sha
2848
2849.. program:: clang710
2850.. option:: -msse, -mno-sse
2851
2852.. program:: clang711
2853.. option:: -msse2, -mno-sse2
2854
2855.. program:: clang712
2856.. option:: -msse3, -mno-sse3
2857
2858.. program:: clang713
2859.. option:: -msse4.1, -mno-sse4.1
2860
2861.. program:: clang714
2862.. option:: -msse4.2, -mno-sse4.2, -msse4
2863
2864.. program:: clang715
2865.. option:: -msse4a, -mno-sse4a
2866
2867.. program:: clang716
2868.. option:: -mssse3, -mno-ssse3
2869
2870.. program:: clang717
2871.. option:: -mtbm, -mno-tbm
2872
2873.. program:: clang718
2874.. option:: -mx87, -m80387, -mno-x87
2875
2876.. program:: clang719
2877.. option:: -mxop, -mno-xop
2878
2879.. program:: clang720
2880.. option:: -mxsave, -mno-xsave
2881
2882.. program:: clang721
2883.. option:: -mxsavec, -mno-xsavec
2884
2885.. program:: clang722
2886.. option:: -mxsaveopt, -mno-xsaveopt
2887
2888.. program:: clang723
2889.. option:: -mxsaves, -mno-xsaves
2890
2891Optimization level
2892~~~~~~~~~~~~~~~~~~
2893
2894Flags controlling how much optimization should be performed.
2895
2896.. program:: clang724
2897.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2898
2899.. program:: clang725
2900.. option:: -O0
2901
2902.. program:: clang726
2903.. option:: -O4
2904
2905.. program:: clang727
2906.. option:: -Ofast<arg>
2907
2908Debug information generation
2909~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2910
2911Flags controlling how much and what kind of debug information should be
2912generated.
2913
2914Kind and level of debug information
2915-----------------------------------
2916.. program:: clang728
2917.. option:: -g, --debug, --debug=<arg>
2918
2919Generate source-level debug information
2920
2921.. program:: clang729
2922.. option:: -gdwarf-2
2923
2924Generate source-level debug information with dwarf version 2
2925
2926.. program:: clang730
2927.. option:: -gdwarf-3
2928
2929Generate source-level debug information with dwarf version 3
2930
2931.. program:: clang731
2932.. option:: -gdwarf-4, -gdwarf
2933
2934Generate source-level debug information with dwarf version 4
2935
2936.. program:: clang732
2937.. option:: -gdwarf-5
2938
2939Generate source-level debug information with dwarf version 5
2940
2941.. program:: clang733
2942.. option:: -gfull
2943
2944.. program:: clang734
2945.. option:: -gused
2946
2947Debug level
2948___________
2949.. program:: clang735
2950.. option:: -g0
2951
2952.. program:: clang736
2953.. option:: -g2
2954
2955.. program:: clang737
2956.. option:: -g3
2957
2958.. program:: clang738
2959.. option:: -ggdb0
2960
2961.. program:: clang739
2962.. option:: -ggdb1
2963
2964.. program:: clang740
2965.. option:: -ggdb2
2966
2967.. program:: clang741
2968.. option:: -ggdb3
2969
2970.. program:: clang742
2971.. option:: -gline-tables-only, -g1, -gmlt
2972
2973Emit debug line number tables only
2974
2975.. program:: clang743
2976.. option:: -gmodules
2977
2978Generate debug info with external references to clang modules or precompiled headers
2979
2980Debugger to tune debug information for
2981______________________________________
2982.. program:: clang744
2983.. option:: -ggdb
2984
2985.. program:: clang745
2986.. option:: -glldb
2987
2988.. program:: clang746
2989.. option:: -gsce
2990
2991Debug information flags
2992-----------------------
2993.. program:: clang747
2994.. option:: -gcolumn-info, -gno-column-info
2995
2996.. program:: clang748
2997.. option:: -gdwarf-aranges
2998
2999.. program:: clang749
3000.. option:: -ggnu-pubnames
3001
3002.. program:: clang750
3003.. option:: -grecord-gcc-switches, -gno-record-gcc-switches
3004
3005.. program:: clang751
3006.. option:: -gsplit-dwarf
3007
3008.. program:: clang752
3009.. option:: -gstrict-dwarf, -gno-strict-dwarf
3010
3011Linker flags
3012============
3013Flags that are passed on to the linker
3014
3015.. program:: clang753
3016.. option:: -L<arg>, --library-directory <arg>, --library-directory=<arg>
3017
3018.. program:: clang754
3019.. option:: -T<arg>
3020
3021.. program:: clang755
3022.. option:: -Tbss<arg>
3023
3024.. program:: clang756
3025.. option:: -Tdata<arg>
3026
3027.. program:: clang757
3028.. option:: -Ttext<arg>
3029
3030.. program:: clang758
3031.. option:: -Wl,<arg>,<arg2>...
3032
3033Pass the comma separated arguments in <arg> to the linker
3034
3035.. program:: clang759
3036.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3037
3038Pass <arg> to the linker
3039
3040.. program:: clang760
3041.. option:: -Z
3042
3043.. program:: clang761
3044.. option:: -e<arg>, --entry
3045
3046.. program:: clang762
3047.. option:: -filelist <arg>
3048
3049.. program:: clang763
3050.. option:: -l<arg>
3051
3052.. program:: clang764
3053.. option:: -r
3054
3055.. program:: clang765
3056.. option:: -rpath <arg>
3057
3058.. program:: clang766
3059.. option:: -s
3060
3061.. program:: clang767
3062.. option:: -t
3063
3064.. program:: clang768
3065.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3066
3067.. program:: clang769
3068.. option:: -undef
3069
3070undef all system defines
3071
3072.. program:: clang770
3073.. option:: -undefined<arg>, --no-undefined
3074
3075.. program:: clang771
3076.. option:: -z <arg>
3077
3078Pass -z <arg> to the linker
3079
3080Fortran compilation flags
3081=========================
3082
3083Flags that will be passed onto the ``gfortran`` compiler when Clang is given
3084a Fortran input.
3085
3086.. program:: clang772
3087.. option:: -A-<arg>
3088
3089.. program:: clang773
3090.. option:: -J<arg>
3091
3092.. program:: clang774
3093.. option:: -cpp
3094
3095.. program:: clang775
3096.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
3097
3098.. program:: clang776
3099.. option:: -falign-commons, -fno-align-commons
3100
3101.. program:: clang777
3102.. option:: -fall-intrinsics, -fno-all-intrinsics
3103
3104.. program:: clang778
3105.. option:: -fautomatic, -fno-automatic
3106
3107.. program:: clang779
3108.. option:: -fbackslash, -fno-backslash
3109
3110.. program:: clang780
3111.. option:: -fbacktrace, -fno-backtrace
3112
3113.. program:: clang781
3114.. option:: -fblas-matmul-limit=<arg>
3115
3116.. program:: clang782
3117.. option:: -fbounds-check, -fno-bounds-check
3118
3119.. program:: clang783
3120.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
3121
3122.. program:: clang784
3123.. option:: -fcheck=<arg>
3124
3125.. program:: clang785
3126.. option:: -fcoarray=<arg>
3127
3128.. program:: clang786
3129.. option:: -fconvert=<arg>
3130
3131.. program:: clang787
3132.. option:: -fcray-pointer, -fno-cray-pointer
3133
3134.. program:: clang788
3135.. option:: -fd-lines-as-code, -fno-d-lines-as-code
3136
3137.. program:: clang789
3138.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
3139
3140.. program:: clang790
3141.. option:: -fdefault-double-8, -fno-default-double-8
3142
3143.. program:: clang791
3144.. option:: -fdefault-integer-8, -fno-default-integer-8
3145
3146.. program:: clang792
3147.. option:: -fdefault-real-8, -fno-default-real-8
3148
3149.. program:: clang793
3150.. option:: -fdollar-ok, -fno-dollar-ok
3151
3152.. program:: clang794
3153.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
3154
3155.. program:: clang795
3156.. option:: -fdump-fortran-original, -fno-dump-fortran-original
3157
3158.. program:: clang796
3159.. option:: -fdump-parse-tree, -fno-dump-parse-tree
3160
3161.. program:: clang797
3162.. option:: -fexternal-blas, -fno-external-blas
3163
3164.. program:: clang798
3165.. option:: -ff2c, -fno-f2c
3166
3167.. program:: clang799
3168.. option:: -ffixed-form, -fno-fixed-form
3169
3170.. program:: clang800
3171.. option:: -ffixed-line-length-<arg>
3172
3173.. program:: clang801
3174.. option:: -ffpe-trap=<arg>
3175
3176.. program:: clang802
3177.. option:: -ffree-form, -fno-free-form
3178
3179.. program:: clang803
3180.. option:: -ffree-line-length-<arg>
3181
3182.. program:: clang804
3183.. option:: -ffrontend-optimize, -fno-frontend-optimize
3184
3185.. program:: clang805
3186.. option:: -fimplicit-none, -fno-implicit-none
3187
3188.. program:: clang806
3189.. option:: -finit-character=<arg>
3190
3191.. program:: clang807
3192.. option:: -finit-integer=<arg>
3193
3194.. program:: clang808
3195.. option:: -finit-local-zero, -fno-init-local-zero
3196
3197.. program:: clang809
3198.. option:: -finit-logical=<arg>
3199
3200.. program:: clang810
3201.. option:: -finit-real=<arg>
3202
3203.. program:: clang811
3204.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
3205
3206.. program:: clang812
3207.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
3208
3209.. program:: clang813
3210.. option:: -fmax-array-constructor=<arg>
3211
3212.. program:: clang814
3213.. option:: -fmax-errors=<arg>
3214
3215.. program:: clang815
3216.. option:: -fmax-identifier-length, -fno-max-identifier-length
3217
3218.. program:: clang816
3219.. option:: -fmax-stack-var-size=<arg>
3220
3221.. program:: clang817
3222.. option:: -fmax-subrecord-length=<arg>
3223
3224.. program:: clang818
3225.. option:: -fmodule-private, -fno-module-private
3226
3227.. program:: clang819
3228.. option:: -fpack-derived, -fno-pack-derived
3229
3230.. program:: clang820
3231.. option:: -fprotect-parens, -fno-protect-parens
3232
3233.. program:: clang821
3234.. option:: -frange-check, -fno-range-check
3235
3236.. program:: clang822
3237.. option:: -freal-4-real-10, -fno-real-4-real-10
3238
3239.. program:: clang823
3240.. option:: -freal-4-real-16, -fno-real-4-real-16
3241
3242.. program:: clang824
3243.. option:: -freal-4-real-8, -fno-real-4-real-8
3244
3245.. program:: clang825
3246.. option:: -freal-8-real-10, -fno-real-8-real-10
3247
3248.. program:: clang826
3249.. option:: -freal-8-real-16, -fno-real-8-real-16
3250
3251.. program:: clang827
3252.. option:: -freal-8-real-4, -fno-real-8-real-4
3253
3254.. program:: clang828
3255.. option:: -frealloc-lhs, -fno-realloc-lhs
3256
3257.. program:: clang829
3258.. option:: -frecord-marker=<arg>
3259
3260.. program:: clang830
3261.. option:: -frecursive, -fno-recursive
3262
3263.. program:: clang831
3264.. option:: -frepack-arrays, -fno-repack-arrays
3265
3266.. program:: clang832
3267.. option:: -fsecond-underscore, -fno-second-underscore
3268
3269.. program:: clang833
3270.. option:: -fsign-zero, -fno-sign-zero
3271
3272.. program:: clang834
3273.. option:: -fstack-arrays, -fno-stack-arrays
3274
3275.. program:: clang835
3276.. option:: -funderscoring, -fno-underscoring
3277
3278.. program:: clang836
3279.. option:: -fwhole-file, -fno-whole-file
3280
3281.. program:: clang837
3282.. option:: -nocpp
3283
3284.. program:: clang838
3285.. option:: -static-libgfortran
3286
3287