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.. option:: -B<dir>, --prefix <arg>, --prefix=<arg>
22
23Add <dir> to search path for binaries and object files used implicitly
24
25.. option:: -F<arg>
26
27Add directory to framework include search path
28
29.. option:: -ObjC
30
31Treat source input files as Objective-C inputs
32
33.. program:: clang1
34.. option:: -ObjC++
35.. program:: clang
36
37Treat source input files as Objective-C++ inputs
38
39.. option:: -Qn, -fno-ident
40
41Do not emit metadata containing compiler name and version
42
43.. option:: -Qunused-arguments
44
45Don't emit warning for unused driver arguments
46
47.. option:: -Qy, -fident
48
49Emit metadata containing compiler name and version
50
51.. option:: -Wa,<arg>,<arg2>...
52
53Pass the comma separated arguments in <arg> to the assembler
54
55.. option:: -Wlarge-by-value-copy=<arg>
56
57.. option:: -Xarch\_<arg1> <arg2>
58
59.. option:: -Xcuda-fatbinary <arg>
60
61Pass <arg> to fatbinary invocation
62
63.. option:: -Xcuda-ptxas <arg>
64
65Pass <arg> to the ptxas assembler
66
67.. option:: -Xopenmp-target <arg>
68
69Pass <arg> to the target offloading toolchain.
70
71.. program:: clang1
72.. option:: -Xopenmp-target=<triple> <arg>
73.. program:: clang
74
75Pass <arg> to the target offloading toolchain identified by <triple>.
76
77.. option:: -Z<arg>
78
79.. option:: -a<arg>, --profile-blocks
80
81.. option:: -all\_load
82
83.. option:: -allowable\_client <arg>
84
85.. option:: --analyze
86
87Run the static analyzer
88
89.. option:: --analyze-auto
90
91.. option:: --analyzer-no-default-checks
92
93.. option:: --analyzer-output<arg>
94
95Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text).
96
97.. option:: -ansi, --ansi
98
99.. option:: -arch <arg>
100
101.. program:: clang1
102.. option:: -arch\_errors\_fatal
103.. program:: clang
104
105.. program:: clang2
106.. option:: -arch\_only <arg>
107.. program:: clang
108
109.. option:: -arcmt-migrate-emit-errors
110
111Emit ARC errors even if the migrator can fix them
112
113.. option:: -arcmt-migrate-report-output <arg>
114
115Output path for the plist report
116
117.. option:: --autocomplete=<arg>
118
119.. option:: -bind\_at\_load
120
121.. option:: -bundle
122
123.. program:: clang1
124.. option:: -bundle\_loader <arg>
125.. program:: clang
126
127.. option:: -cfguard
128
129Emit tables required for Windows Control Flow Guard.
130
131.. option:: -client\_name<arg>
132
133.. option:: -compatibility\_version<arg>
134
135.. option:: --config <arg>
136
137Specifies configuration file
138
139.. option:: --constant-cfstrings
140
141.. option:: -coverage, --coverage
142
143.. option:: --cuda-compile-host-device
144
145Compile CUDA code for both host and device (default).  Has no effect on non-CUDA compilations.
146
147.. option:: --cuda-device-only
148
149Compile CUDA code for device only
150
151.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
152
153CUDA GPU architecture (e.g. sm\_35).  May be specified more than once.
154
155.. option:: --cuda-host-only
156
157Compile CUDA code for host only.  Has no effect on non-CUDA compilations.
158
159.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg>
160
161Include PTX for the follwing GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once.
162
163.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
164
165Enable device-side debug info generation. Disables ptxas optimizations.
166
167.. option:: -current\_version<arg>
168
169.. option:: -dead\_strip
170
171.. option:: -dependency-dot <arg>
172
173Filename to write DOT-formatted header dependencies to
174
175.. option:: -dependency-file <arg>
176
177Filename (or -) to write dependency output to
178
179.. option:: -dumpmachine
180
181.. option:: -dumpversion
182
183.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
184
185.. option:: -dylib\_file <arg>
186
187.. option:: -dylinker
188
189.. program:: clang1
190.. option:: -dylinker\_install\_name<arg>
191.. program:: clang
192
193.. option:: -dynamic
194
195.. option:: -dynamiclib
196
197.. option:: -emit-ast
198
199Emit Clang AST files for source inputs
200
201.. option:: -exported\_symbols\_list <arg>
202
203.. option:: -faligned-new=<arg>
204
205.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
206
207Use approximate transcendental functions
208
209.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
210
211Flush denormal floating point values to zero in CUDA device mode.
212
213.. option:: -fcuda-rdc, -fno-cuda-rdc
214
215Generate relocatable device code, also known as separate compilation mode.
216
217.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
218
219Use 32-bit pointers for accessing const/local/shared address spaces.
220
221.. option:: -ffixed-r19
222
223Reserve register r19 (Hexagon only)
224
225.. option:: -fheinous-gnu-extensions
226
227.. option:: -flat\_namespace
228
229.. option:: -fopenmp-targets=<arg1>,<arg2>...
230
231Specify comma-separated list of triples OpenMP offloading targets to be supported
232
233.. option:: -force\_cpusubtype\_ALL
234
235.. program:: clang1
236.. option:: -force\_flat\_namespace
237.. program:: clang
238
239.. program:: clang2
240.. option:: -force\_load <arg>
241.. program:: clang
242
243.. option:: -framework <arg>
244
245.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
246
247Add -rpath with architecture-specific resource directory to the linker flags
248
249.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
250
251Use the gcc toolchain at the given directory
252
253.. option:: -gcodeview
254
255Generate CodeView debug information
256
257.. option:: -headerpad\_max\_install\_names<arg>
258
259.. option:: -help, --help
260
261Display available options
262
263.. option:: --help-hidden
264
265Display help for hidden options
266
267.. option:: --hip-link
268
269Link clang-offload-bundler bundles for HIP
270
271.. option:: -image\_base <arg>
272
273.. option:: -index-header-map
274
275Make the next included directory (-I or -F) an indexer header map
276
277.. option:: -init <arg>
278
279.. option:: -install\_name <arg>
280
281.. option:: -keep\_private\_externs
282
283.. option:: -lazy\_framework <arg>
284
285.. program:: clang1
286.. option:: -lazy\_library <arg>
287.. program:: clang
288
289.. option:: -mbig-endian, -EB
290
291.. option:: --migrate
292
293Run the migrator
294
295.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
296
297.. option:: -mlinker-version=<arg>
298
299.. option:: -mlittle-endian, -EL
300
301.. option:: -mllvm <arg>
302
303Additional arguments to forward to LLVM's option processing
304
305.. option:: -module-dependency-dir <arg>
306
307Directory to dump module dependencies to
308
309.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
310
311.. option:: -multi\_module
312
313.. option:: -multiply\_defined <arg>
314
315.. program:: clang1
316.. option:: -multiply\_defined\_unused <arg>
317.. program:: clang
318
319.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
320
321.. option:: --no-cuda-version-check
322
323Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
324
325.. option:: -no-integrated-cpp, --no-integrated-cpp
326
327.. option:: -no\_dead\_strip\_inits\_and\_terms
328
329.. option:: -nobuiltininc
330
331Disable builtin #include directories
332
333.. option:: -nocudainc
334
335.. option:: -nocudalib
336
337.. option:: -nodefaultlibs
338
339.. option:: -nofixprebinding
340
341.. option:: -nolibc
342
343.. option:: -nomultidefs
344
345.. option:: -nopie, -no-pie
346
347.. option:: -noprebind
348
349.. option:: -noseglinkedit
350
351.. option:: -nostartfiles
352
353.. option:: -nostdinc, --no-standard-includes
354
355.. program:: clang1
356.. option:: -nostdinc++
357.. program:: clang
358
359Disable standard #include directories for the C++ standard library
360
361.. option:: -nostdlib, --no-standard-libraries
362
363.. program:: clang1
364.. option:: -nostdlib++
365.. program:: clang
366
367.. option:: -nostdlibinc
368
369.. option:: -o<file>, --output <arg>, --output=<arg>
370
371Write output to <file>
372
373.. option:: -objcmt-atomic-property
374
375Make migration to 'atomic' properties
376
377.. option:: -objcmt-migrate-all
378
379Enable migration to modern ObjC
380
381.. option:: -objcmt-migrate-annotation
382
383Enable migration to property and method annotations
384
385.. option:: -objcmt-migrate-designated-init
386
387Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
388
389.. option:: -objcmt-migrate-instancetype
390
391Enable migration to infer instancetype for method result type
392
393.. option:: -objcmt-migrate-literals
394
395Enable migration to modern ObjC literals
396
397.. option:: -objcmt-migrate-ns-macros
398
399Enable migration to NS\_ENUM/NS\_OPTIONS macros
400
401.. option:: -objcmt-migrate-property
402
403Enable migration to modern ObjC property
404
405.. option:: -objcmt-migrate-property-dot-syntax
406
407Enable migration of setter/getter messages to property-dot syntax
408
409.. option:: -objcmt-migrate-protocol-conformance
410
411Enable migration to add protocol conformance on classes
412
413.. option:: -objcmt-migrate-readonly-property
414
415Enable migration to modern ObjC readonly property
416
417.. option:: -objcmt-migrate-readwrite-property
418
419Enable migration to modern ObjC readwrite property
420
421.. option:: -objcmt-migrate-subscripting
422
423Enable migration to modern ObjC subscripting
424
425.. option:: -objcmt-ns-nonatomic-iosonly
426
427Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
428
429.. option:: -objcmt-returns-innerpointer-property
430
431Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
432
433.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
434
435Only modify files with a filename contained in the provided directory path
436
437.. option:: -object
438
439.. option:: -p, --profile
440
441.. option:: -pagezero\_size<arg>
442
443.. option:: -pg
444
445Enable mcount instrumentation
446
447.. option:: -pie
448
449.. option:: -pipe, --pipe
450
451Use pipes between commands, when possible
452
453.. option:: -prebind
454
455.. program:: clang1
456.. option:: -prebind\_all\_twolevel\_modules
457.. program:: clang
458
459.. option:: -preload
460
461.. option:: --print-diagnostic-categories
462
463.. option:: -print-effective-triple, --print-effective-triple
464
465Print the effective target triple
466
467.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
468
469Print the full library path of <file>
470
471.. option:: -print-ivar-layout
472
473Enable Objective-C Ivar layout bitmap print trace
474
475.. option:: -print-libgcc-file-name, --print-libgcc-file-name
476
477Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
478
479.. option:: -print-multi-directory, --print-multi-directory
480
481.. option:: -print-multi-lib, --print-multi-lib
482
483.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
484
485Print the full program path of <name>
486
487.. option:: -print-resource-dir, --print-resource-dir
488
489Print the resource directory pathname
490
491.. option:: -print-search-dirs, --print-search-dirs
492
493Print the paths used for finding libraries and programs
494
495.. option:: -print-target-triple, --print-target-triple
496
497Print the normalized target triple
498
499.. option:: -private\_bundle
500
501.. option:: -pthread, -no-pthread
502
503Support POSIX threads in generated code
504
505.. option:: -pthreads
506
507.. option:: -rdynamic
508
509.. option:: -read\_only\_relocs <arg>
510
511.. option:: -relocatable-pch, --relocatable-pch
512
513Whether to build a relocatable precompiled header
514
515.. option:: -remap
516
517.. option:: -rewrite-legacy-objc
518
519Rewrite Legacy Objective-C source to C++
520
521.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
522
523Compiler runtime library to use
524
525.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
526
527Save llvm statistics.
528
529.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
530
531Save intermediate compilation results.
532
533.. option:: -sectalign <arg1> <arg2> <arg3>
534
535.. option:: -sectcreate <arg1> <arg2> <arg3>
536
537.. option:: -sectobjectsymbols <arg1> <arg2>
538
539.. option:: -sectorder <arg1> <arg2> <arg3>
540
541.. option:: -seg1addr<arg>
542
543.. option:: -seg\_addr\_table <arg>
544
545.. program:: clang1
546.. option:: -seg\_addr\_table\_filename <arg>
547.. program:: clang
548
549.. option:: -segaddr <arg1> <arg2>
550
551.. option:: -segcreate <arg1> <arg2> <arg3>
552
553.. option:: -seglinkedit
554
555.. option:: -segprot <arg1> <arg2> <arg3>
556
557.. option:: -segs\_read\_<arg>
558
559.. program:: clang1
560.. option:: -segs\_read\_only\_addr <arg>
561.. program:: clang
562
563.. program:: clang2
564.. option:: -segs\_read\_write\_addr <arg>
565.. program:: clang
566
567.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
568
569Serialize compiler diagnostics to a file
570
571.. option:: -shared, --shared
572
573.. option:: -shared-libgcc
574
575.. option:: -shared-libsan, -shared-libasan
576
577Dynamically link the sanitizer runtime
578
579.. option:: -single\_module
580
581.. option:: -specs=<arg>, --specs=<arg>
582
583.. option:: -static, --static
584
585.. option:: -static-libgcc
586
587.. option:: -static-libsan
588
589Statically link the sanitizer runtime
590
591.. option:: -static-libstdc++
592
593.. option:: -std-default=<arg>
594
595.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
596
597C++ standard library to use
598
599.. option:: -sub\_library<arg>
600
601.. program:: clang1
602.. option:: -sub\_umbrella<arg>
603.. program:: clang
604
605.. option:: --sysroot=<arg>, --sysroot <arg>
606
607.. option:: --target-help
608
609.. option:: --target=<arg>, -target <arg>
610
611Generate code for the given target
612
613.. option:: -time
614
615Time individual commands
616
617.. option:: -traditional, --traditional
618
619.. option:: -traditional-cpp, --traditional-cpp
620
621Enable some traditional CPP emulation
622
623.. option:: -twolevel\_namespace
624
625.. program:: clang1
626.. option:: -twolevel\_namespace\_hints
627.. program:: clang
628
629.. option:: -umbrella <arg>
630
631.. option:: -unexported\_symbols\_list <arg>
632
633.. option:: -v, --verbose
634
635Show commands to run and use verbose output
636
637.. option:: --verify-debug-info
638
639Verify the binary representation of debug output
640
641.. option:: --version
642
643Print version information
644
645.. option:: -w, --no-warnings
646
647Suppress all warnings
648
649.. option:: -weak-l<arg>
650
651.. option:: -weak\_framework <arg>
652
653.. program:: clang1
654.. option:: -weak\_library <arg>
655.. program:: clang
656
657.. program:: clang2
658.. option:: -weak\_reference\_mismatches <arg>
659.. program:: clang
660
661.. option:: -whatsloaded
662
663.. option:: -whyload
664
665.. option:: -working-directory<arg>, -working-directory=<arg>
666
667Resolve file paths relative to the specified directory
668
669.. option:: -x<language>, --language <arg>, --language=<arg>
670
671Treat subsequent input files as having type <language>
672
673.. option:: -y<arg>
674
675Actions
676=======
677The action to perform on the input.
678
679.. option:: -E, --preprocess
680
681Only run the preprocessor
682
683.. option:: -S, --assemble
684
685Only run preprocess and compilation steps
686
687.. option:: -c, --compile
688
689Only run preprocess, compile, and assemble steps
690
691.. option:: -emit-llvm
692
693Use the LLVM representation for assembler and object files
694
695.. option:: -fsyntax-only
696
697.. option:: -module-file-info
698
699Provide information about a particular module file
700
701.. option:: --precompile
702
703Only precompile the input
704
705.. option:: -rewrite-objc
706
707Rewrite Objective-C source to C++
708
709.. option:: -verify-pch
710
711Load and verify that a pre-compiled header file is not stale
712
713Compilation flags
714=================
715
716Flags controlling the behavior of Clang during compilation. These flags have
717no effect during actions that do not perform compilation.
718
719.. option:: -Xassembler <arg>
720
721Pass <arg> to the assembler
722
723.. option:: -Xclang <arg>
724
725Pass <arg> to the clang compiler
726
727.. option:: -fclang-abi-compat=<version>
728
729Attempt to match the ABI of Clang <version>
730
731.. option:: -fcomment-block-commands=<arg>,<arg2>...
732
733Treat each comma separated argument in <arg> as a documentation comment block command
734
735.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
736
737Require member pointer base types to be complete if they would be significant under the Microsoft ABI
738
739.. option:: -fcrash-diagnostics-dir=<arg>
740
741.. option:: -fdeclspec, -fno-declspec
742
743Allow \_\_declspec as a keyword
744
745.. option:: -fdepfile-entry=<arg>
746
747.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
748
749.. option:: -fdiagnostics-format=<arg>
750
751.. option:: -fdiagnostics-parseable-fixits
752
753Print fix-its in machine parseable form
754
755.. option:: -fdiagnostics-print-source-range-info
756
757Print source range spans in numeric form
758
759.. option:: -fdiagnostics-show-category=<arg>
760
761.. option:: -fdiscard-value-names, -fno-discard-value-names
762
763Discard value names in LLVM IR
764
765.. option:: -fexperimental-isel, -fno-experimental-isel
766
767Enables the experimental global instruction selector
768
769.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
770
771Enables an experimental new pass manager in LLVM.
772
773.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
774
775Use separate accesses for consecutive bitfield runs with legal widths and alignments.
776
777.. option:: -finline-functions, -fno-inline-functions
778
779Inline suitable functions
780
781.. option:: -finline-hint-functions
782
783Inline functions which are (explicitly or implicitly) marked inline
784
785.. option:: -fno-crash-diagnostics
786
787Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
788
789.. option:: -fno-sanitize-blacklist
790
791Don't use blacklist file for sanitizers
792
793.. option:: -fparse-all-comments
794
795.. option:: -fsanitize-address-field-padding=<arg>
796
797Level of field padding for AddressSanitizer
798
799.. option:: -fsanitize-address-globals-dead-stripping
800
801Enable linker dead stripping of globals in AddressSanitizer
802
803.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
804
805Enable "poisoning" array cookies when allocating arrays with a custom operator new\[\] in Address Sanitizer, preventing accesses to the cookies from user code. An array cookie is a small implementation-defined header added to certain array allocations to record metadata such as the length of the array. Accesses to array cookies from user code are technically allowed by the standard but are more likely to be the result of an out-of-bounds array access.
806
807An operator new\[\] is "custom" if it is not one of the allocation functions provided by the C++ standard library. Array cookies from non-custom allocation functions are always poisoned.
808
809.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
810
811Enable use-after-scope detection in AddressSanitizer
812
813.. option:: -fsanitize-blacklist=<arg>
814
815Path to blacklist file for sanitizers
816
817.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
818
819Enable control flow integrity (CFI) checks for cross-DSO calls.
820
821.. option:: -fsanitize-cfi-icall-generalize-pointers
822
823Generalize pointers in CFI indirect call type signature checks
824
825.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
826
827Specify the type of coverage instrumentation for Sanitizers
828
829.. option:: -fsanitize-link-c++-runtime
830
831.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
832
833Enable origins tracking in MemorySanitizer
834
835.. program:: clang1
836.. option:: -fsanitize-memory-track-origins=<arg>
837.. program:: clang
838
839Enable origins tracking in MemorySanitizer
840
841.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
842
843Enable use-after-destroy detection in MemorySanitizer
844
845.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
846
847.. option:: -fsanitize-recover, -fno-sanitize-recover
848
849.. program:: clang1
850.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
851.. program:: clang
852
853Enable recovery for specified sanitizers
854
855.. option:: -fsanitize-stats, -fno-sanitize-stats
856
857Enable sanitizer statistics gathering.
858
859.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
860
861Enable atomic operations instrumentation in ThreadSanitizer (default)
862
863.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
864
865Enable function entry/exit instrumentation in ThreadSanitizer (default)
866
867.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
868
869Enable memory access instrumentation in ThreadSanitizer (default)
870
871.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
872
873Enable trapping for specified sanitizers
874
875.. option:: -fsanitize-undefined-strip-path-components=<number>
876
877Strip (or keep only, if negative) a given number of path components when emitting check metadata.
878
879.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
880
881.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
882
883Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
884
885.. option:: -moutline, -mno-outline
886
887Enable function outlining (AArch64 only)
888
889.. option:: --param <arg>, --param=<arg>
890
891.. option:: -std=<arg>, --std=<arg>, --std <arg>
892
893Language standard to compile for
894
895Preprocessor flags
896~~~~~~~~~~~~~~~~~~
897
898Flags controlling the behavior of the Clang preprocessor.
899
900.. option:: -C, --comments
901
902Include comments in preprocessed output
903
904.. option:: -CC, --comments-in-macros
905
906Include comments from within macros in preprocessed output
907
908.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
909
910Define <macro> to <value> (or 1 if <value> omitted)
911
912.. option:: -H, --trace-includes
913
914Show header includes and nesting depth
915
916.. option:: -P, --no-line-commands
917
918Disable linemarker output in -E mode
919
920.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
921
922Undefine macro <macro>
923
924.. option:: -Wp,<arg>,<arg2>...
925
926Pass the comma separated arguments in <arg> to the preprocessor
927
928.. option:: -Xpreprocessor <arg>
929
930Pass <arg> to the preprocessor
931
932Include path management
933-----------------------
934
935Flags controlling how ``#include``\s are resolved to files.
936
937.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
938
939Add directory to include search path
940
941.. option:: -I-, --include-barrier
942
943Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
944
945.. option:: --cuda-path-ignore-env
946
947Ignore environment variables to detect CUDA installation
948
949.. option:: --cuda-path=<arg>
950
951CUDA installation path
952
953.. option:: -cxx-isystem<directory>
954
955Add directory to the C++ SYSTEM include search path
956
957.. option:: -fbuild-session-file=<file>
958
959Use the last modification time of <file> as the build session timestamp
960
961.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
962
963Time when the current build session started
964
965.. option:: -fmodule-file=\[<name>=\]<file>
966
967Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
968
969.. option:: -fmodules-cache-path=<directory>
970
971Specify the module cache path
972
973.. option:: -fmodules-disable-diagnostic-validation
974
975Disable validation of the diagnostic options when loading the module
976
977.. option:: -fmodules-prune-after=<seconds>
978
979Specify the interval (in seconds) after which a module file will be considered unused
980
981.. option:: -fmodules-prune-interval=<seconds>
982
983Specify the interval (in seconds) between attempts to prune the module cache
984
985.. option:: -fmodules-user-build-path <directory>
986
987Specify the module user build path
988
989.. option:: -fmodules-validate-once-per-build-session
990
991Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
992
993.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
994
995Validate the system headers that a module depends on when loading the module
996
997.. option:: -fprebuilt-module-path=<directory>
998
999Specify the prebuilt module path
1000
1001.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1002
1003Add directory to AFTER include search path
1004
1005.. option:: -iframework<arg>
1006
1007Add directory to SYSTEM framework search path
1008
1009.. option:: -iframeworkwithsysroot<directory>
1010
1011Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1012
1013.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1014
1015Include macros from file before parsing
1016
1017.. option:: -include<file>, --include<file>, --include=<arg>
1018
1019Include file before parsing
1020
1021.. option:: -include-pch <file>
1022
1023Include precompiled header file
1024
1025.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1026
1027Set the -iwithprefix/-iwithprefixbefore prefix
1028
1029.. option:: -iquote<directory>
1030
1031Add directory to QUOTE include search path
1032
1033.. option:: -isysroot<dir>
1034
1035Set the system root directory (usually /)
1036
1037.. option:: -isystem<directory>
1038
1039Add directory to SYSTEM include search path
1040
1041.. option:: -isystem-after<directory>
1042
1043Add directory to end of the SYSTEM include search path
1044
1045.. option:: -ivfsoverlay<arg>
1046
1047Overlay the virtual filesystem described by file over the real file system
1048
1049.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1050
1051Set directory to SYSTEM include search path with prefix
1052
1053.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1054
1055Set directory to include search path with prefix
1056
1057.. option:: -iwithsysroot<directory>
1058
1059Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1060
1061.. option:: --ptxas-path=<arg>
1062
1063Path to ptxas (used for compiling CUDA code)
1064
1065.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1066
1067Treat all #include paths starting with <prefix> as including a system header.
1068
1069Dependency file generation
1070--------------------------
1071
1072Flags controlling generation of a dependency file for ``make``-like build
1073systems.
1074
1075.. option:: -M, --dependencies
1076
1077Like -MD, but also implies -E and writes to stdout by default
1078
1079.. option:: -MD, --write-dependencies
1080
1081Write a depfile containing user and system headers
1082
1083.. option:: -MF<file>
1084
1085Write depfile output from -MMD, -MD, -MM, or -M to <file>
1086
1087.. option:: -MG, --print-missing-file-dependencies
1088
1089Add missing headers to depfile
1090
1091.. option:: -MJ<arg>
1092
1093Write a compilation database entry per input
1094
1095.. option:: -MM, --user-dependencies
1096
1097Like -MMD, but also implies -E and writes to stdout by default
1098
1099.. option:: -MMD, --write-user-dependencies
1100
1101Write a depfile containing user headers
1102
1103.. option:: -MP
1104
1105Create phony target for each dependency (other than main file)
1106
1107.. option:: -MQ<arg>
1108
1109Specify name of main file output to quote in depfile
1110
1111.. option:: -MT<arg>
1112
1113Specify name of main file output in depfile
1114
1115.. option:: -MV
1116
1117Use NMake/Jom format for the depfile
1118
1119Dumping preprocessor state
1120--------------------------
1121
1122Flags allowing the state of the preprocessor to be dumped in various ways.
1123
1124.. option:: -d
1125
1126.. program:: clang1
1127.. option:: -d<arg>
1128.. program:: clang
1129
1130.. option:: -dA
1131
1132.. option:: -dD
1133
1134Print macro definitions in -E mode in addition to normal output
1135
1136.. option:: -dI
1137
1138Print include directives in -E mode in addition to normal output
1139
1140.. option:: -dM
1141
1142Print macro definitions in -E mode instead of normal output
1143
1144Diagnostic flags
1145~~~~~~~~~~~~~~~~
1146
1147Flags controlling which warnings, errors, and remarks Clang will generate.
1148See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1149
1150.. option:: -R<remark>
1151
1152Enable the specified remark
1153
1154.. option:: -Rpass-analysis=<arg>
1155
1156Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1157
1158.. option:: -Rpass-missed=<arg>
1159
1160Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1161
1162.. option:: -Rpass=<arg>
1163
1164Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1165
1166.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1167
1168Enable the specified warning
1169
1170.. option:: -Wdeprecated, -Wno-deprecated
1171
1172Enable warnings for deprecated constructs and define \_\_DEPRECATED
1173
1174.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1175
1176Target-independent compilation options
1177~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1178.. option:: -Wframe-larger-than=<arg>
1179
1180.. option:: -fPIC, -fno-PIC
1181
1182.. option:: -fPIE, -fno-PIE
1183
1184.. option:: -faccess-control, -fno-access-control
1185
1186.. option:: -faddrsig, -fno-addrsig
1187
1188Emit an address-significance table
1189
1190.. option:: -falign-functions, -fno-align-functions
1191
1192.. program:: clang1
1193.. option:: -falign-functions=<arg>
1194.. program:: clang
1195
1196.. program:: clang1
1197.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
1198.. program:: clang
1199
1200Enable C++17 aligned allocation functions
1201
1202.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1203
1204Treat editor placeholders as valid source code
1205
1206.. option:: -fallow-unsupported
1207
1208.. option:: -faltivec, -fno-altivec
1209
1210.. option:: -fansi-escape-codes
1211
1212Use ANSI escape codes for diagnostics
1213
1214.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1215
1216Use Apple's kernel extensions ABI
1217
1218.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1219
1220Enable Apple gcc-compatible #pragma pack handling
1221
1222.. option:: -fapplication-extension, -fno-application-extension
1223
1224Restrict code to those available for App Extensions
1225
1226.. option:: -fasm, -fno-asm
1227
1228.. option:: -fasm-blocks, -fno-asm-blocks
1229
1230.. option:: -fassociative-math, -fno-associative-math
1231
1232.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1233
1234.. option:: -fast
1235
1236.. option:: -fastcp
1237
1238.. option:: -fastf
1239
1240.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1241
1242.. option:: -fautolink, -fno-autolink
1243
1244.. option:: -fblocks, -fno-blocks
1245
1246Enable the 'blocks' language feature
1247
1248.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1249
1250.. option:: -fborland-extensions, -fno-borland-extensions
1251
1252Accept non-standard constructs supported by the Borland compiler
1253
1254.. option:: -fbracket-depth=<arg>
1255
1256.. option:: -fbuiltin, -fno-builtin
1257
1258.. option:: -fbuiltin-module-map
1259
1260Load the clang builtins module map file.
1261
1262.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1263
1264Enable C++ static destructor registration (the default)
1265
1266.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1267
1268.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1269
1270Instrument control-flow architecture protection. Options: return, branch, full, none.
1271
1272.. option:: -fchar8\_t, -fno-char8\_t
1273
1274Enable C++ builtin type char8\_t
1275
1276.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1277
1278.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1279
1280Use colors in diagnostics
1281
1282.. option:: -fcommon, -fno-common
1283
1284.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1285
1286.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1287
1288.. option:: -fconstant-string-class=<arg>
1289
1290.. option:: -fconstexpr-backtrace-limit=<arg>
1291
1292.. option:: -fconstexpr-depth=<arg>
1293
1294.. option:: -fconstexpr-steps=<arg>
1295
1296.. option:: -fcoroutines-ts, -fno-coroutines-ts
1297
1298Enable support for the C++ Coroutines TS
1299
1300.. option:: -fcoverage-mapping, -fno-coverage-mapping
1301
1302Generate coverage mapping to enable code coverage analysis
1303
1304.. option:: -fcreate-profile
1305
1306.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1307
1308Enable C++ exceptions
1309
1310.. option:: -fcxx-modules, -fno-cxx-modules
1311
1312.. option:: -fdata-sections, -fno-data-sections
1313
1314Place each data in its own section (ELF Only)
1315
1316.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1317
1318Emit extra debug info to make sample profile more accurate.
1319
1320.. option:: -fdebug-macro, -fno-debug-macro
1321
1322Emit macro debug information
1323
1324.. option:: -fdebug-pass-arguments
1325
1326.. option:: -fdebug-pass-structure
1327
1328.. option:: -fdebug-prefix-map=<arg>
1329
1330remap file source paths in debug info
1331
1332.. option:: -fdebug-types-section, -fno-debug-types-section
1333
1334Place debug types in their own section (ELF Only)
1335
1336.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1337
1338Parse templated function definitions at the end of the translation unit
1339
1340.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1341
1342Treat usage of null pointers as undefined behavior.
1343
1344.. option:: -fdenormal-fp-math=<arg>
1345
1346.. option:: -fdiagnostics-absolute-paths
1347
1348Print absolute paths in diagnostics
1349
1350.. option:: -fdiagnostics-color, -fno-diagnostics-color
1351
1352.. program:: clang1
1353.. option:: -fdiagnostics-color=<arg>
1354.. program:: clang
1355
1356.. option:: -fdiagnostics-hotness-threshold=<number>
1357
1358Prevent optimization remarks from being output if they do not have at least this profile count
1359
1360.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1361
1362Enable profile hotness information in diagnostic line
1363
1364.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1365
1366Display include stacks for diagnostic notes
1367
1368.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1369
1370Print option name with mappable diagnostics
1371
1372.. option:: -fdiagnostics-show-template-tree
1373
1374Print a template comparison tree for differing templates
1375
1376.. option:: -fdigraphs, -fno-digraphs
1377
1378Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1379
1380.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1381
1382Allow '$' in identifiers
1383
1384.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1385
1386Enable '\[\[\]\]' attributes in all C and C++ language modes
1387
1388.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1389
1390.. option:: -fdwarf-exceptions
1391
1392Use DWARF style exceptions
1393
1394.. option:: -felide-constructors, -fno-elide-constructors
1395
1396.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1397
1398.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1399
1400Embed LLVM bitcode (option: off, all, bitcode, marker)
1401
1402.. option:: -femit-all-decls
1403
1404Emit all declarations, even if unused
1405
1406.. option:: -femulated-tls, -fno-emulated-tls
1407
1408Use emutls functions to access thread\_local variables
1409
1410.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1411
1412.. option:: -ferror-limit=<arg>
1413
1414.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1415
1416.. option:: -fexceptions, -fno-exceptions
1417
1418Enable support for exception handling
1419
1420.. option:: -fexec-charset=<arg>
1421
1422.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1423
1424.. option:: -ffast-math, -fno-fast-math
1425
1426Allow aggressive, lossy floating-point optimizations
1427
1428.. option:: -ffinite-math-only, -fno-finite-math-only
1429
1430.. option:: -ffixed-point, -fno-fixed-point
1431
1432Enable fixed point types
1433
1434.. option:: -ffor-scope, -fno-for-scope
1435
1436.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1437
1438Emits more virtual tables to improve devirtualization
1439
1440.. option:: -fforce-enable-int128, -fno-force-enable-int128
1441
1442Enable support for int128\_t type
1443
1444.. option:: -ffp-contract=<arg>
1445
1446Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1447
1448.. option:: -ffreestanding
1449
1450Assert that the compilation takes place in a freestanding environment
1451
1452.. option:: -ffunction-sections, -fno-function-sections
1453
1454Place each function in its own section (ELF Only)
1455
1456.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1457
1458.. option:: -fgnu-keywords, -fno-gnu-keywords
1459
1460Allow GNU-extension keywords regardless of language standard
1461
1462.. option:: -fgnu-runtime
1463
1464Generate output compatible with the standard GNU Objective-C runtime
1465
1466.. option:: -fgnu89-inline, -fno-gnu89-inline
1467
1468Use the gnu89 inline semantics
1469
1470.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1471
1472.. option:: -fhonor-nans, -fno-honor-nans
1473
1474.. option:: -fhosted
1475
1476.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1477
1478Implicitly search the file system for module map files.
1479
1480.. option:: -fimplicit-modules, -fno-implicit-modules
1481
1482.. option:: -finput-charset=<arg>
1483
1484.. option:: -finstrument-function-entry-bare
1485
1486Instrument function entry only, after inlining, without arguments to the instrumentation call
1487
1488.. option:: -finstrument-functions
1489
1490Generate calls to instrument function entry and exit
1491
1492.. option:: -finstrument-functions-after-inlining
1493
1494Like -finstrument-functions, but insert the calls after inlining
1495
1496.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1497
1498Enable the integrated assembler
1499
1500.. option:: -fjump-tables, -fno-jump-tables
1501
1502.. option:: -fkeep-static-consts
1503
1504Keep static const variables even if unused
1505
1506.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1507
1508.. option:: -flimited-precision=<arg>
1509
1510.. option:: -flto, -fno-lto
1511
1512Enable LTO in 'full' mode
1513
1514.. option:: -flto-jobs=<arg>
1515
1516Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1517
1518.. program:: clang1
1519.. option:: -flto=<arg>
1520.. program:: clang
1521
1522Set LTO mode to either 'full' or 'thin'
1523
1524.. option:: -fmacro-backtrace-limit=<arg>
1525
1526.. option:: -fmath-errno, -fno-math-errno
1527
1528Require math functions to indicate errors by setting errno
1529
1530.. option:: -fmax-type-align=<arg>
1531
1532Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1533
1534.. option:: -fmerge-all-constants, -fno-merge-all-constants
1535
1536Allow merging of constants
1537
1538.. option:: -fmessage-length=<arg>
1539
1540.. option:: -fmodule-file-deps, -fno-module-file-deps
1541
1542.. option:: -fmodule-map-file=<file>
1543
1544Load this module map file
1545
1546.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1547
1548Specify the name of the module to build
1549
1550.. option:: -fmodules, -fno-modules
1551
1552Enable the 'modules' language feature
1553
1554.. option:: -fmodules-decluse, -fno-modules-decluse
1555
1556Require declaration of modules used within a module
1557
1558.. option:: -fmodules-ignore-macro=<arg>
1559
1560Ignore the definition of the given macro when building and loading modules
1561
1562.. option:: -fmodules-search-all, -fno-modules-search-all
1563
1564Search even non-imported modules to resolve references
1565
1566.. option:: -fmodules-strict-decluse
1567
1568Like -fmodules-decluse but requires all headers to be in modules
1569
1570.. option:: -fmodules-ts
1571
1572Enable support for the C++ Modules TS
1573
1574.. option:: -fms-compatibility, -fno-ms-compatibility
1575
1576Enable full Microsoft Visual C++ compatibility
1577
1578.. option:: -fms-compatibility-version=<arg>
1579
1580Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1581
1582.. option:: -fms-extensions, -fno-ms-extensions
1583
1584Accept some non-standard constructs supported by the Microsoft compiler
1585
1586.. option:: -fms-memptr-rep=<arg>
1587
1588.. option:: -fms-volatile<arg>
1589
1590.. option:: -fmsc-version=<arg>
1591
1592Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1593
1594.. option:: -fmudflap
1595
1596.. option:: -fmudflapth
1597
1598.. option:: -fnested-functions
1599
1600.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1601
1602Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1603
1604.. option:: -fnext-runtime
1605
1606.. option:: -fno-builtin-<arg>
1607
1608Disable implicit builtin knowledge of a specific function
1609
1610.. option:: -fno-elide-type
1611
1612Do not elide types when printing diagnostics
1613
1614.. option:: -fno-max-type-align
1615
1616.. option:: -fno-operator-names
1617
1618Do not treat C++ operator name keywords as synonyms for operators
1619
1620.. option:: -fno-rtti-data
1621
1622Control emission of RTTI data
1623
1624.. option:: -fno-strict-modules-decluse
1625
1626.. option:: -fno-working-directory
1627
1628.. option:: -fnoxray-link-deps
1629
1630.. option:: -fobjc-abi-version=<arg>
1631
1632.. option:: -fobjc-arc, -fno-objc-arc
1633
1634Synthesize retain and release calls for Objective-C pointers
1635
1636.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1637
1638Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1639
1640.. option:: -fobjc-exceptions, -fno-objc-exceptions
1641
1642Enable Objective-C exceptions
1643
1644.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1645
1646.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1647
1648.. option:: -fobjc-link-runtime
1649
1650.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1651
1652.. option:: -fobjc-nonfragile-abi-version=<arg>
1653
1654.. option:: -fobjc-runtime=<arg>
1655
1656Specify the target Objective-C runtime kind and version
1657
1658.. option:: -fobjc-sender-dependent-dispatch
1659
1660.. option:: -fobjc-weak, -fno-objc-weak
1661
1662Enable ARC-style weak references in Objective-C
1663
1664.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1665
1666.. option:: -fopenmp, -fno-openmp
1667
1668Parse OpenMP pragmas and generate parallel code.
1669
1670.. option:: -fopenmp-simd, -fno-openmp-simd
1671
1672Emit OpenMP code only for SIMD-based constructs.
1673
1674.. option:: -fopenmp-version=<arg>
1675
1676.. program:: clang1
1677.. option:: -fopenmp=<arg>
1678.. program:: clang
1679
1680.. option:: -foperator-arrow-depth=<arg>
1681
1682.. option:: -foptimization-record-file=<arg>
1683
1684Specify the file name of any generated YAML optimization record
1685
1686.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1687
1688.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1689
1690.. option:: -fpack-struct, -fno-pack-struct
1691
1692.. program:: clang1
1693.. option:: -fpack-struct=<arg>
1694.. program:: clang
1695
1696Specify the default maximum struct packing alignment
1697
1698.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1699
1700Recognize and construct Pascal-style string literals
1701
1702.. option:: -fpcc-struct-return
1703
1704Override the default ABI to return all structs on the stack
1705
1706.. option:: -fpch-preprocess
1707
1708.. option:: -fpic, -fno-pic
1709
1710.. option:: -fpie, -fno-pie
1711
1712.. option:: -fplt, -fno-plt
1713
1714Use the PLT to make function calls
1715
1716.. option:: -fplugin=<dsopath>
1717
1718Load the named plugin (dynamic shared object)
1719
1720.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1721
1722.. option:: -fprofile-arcs, -fno-profile-arcs
1723
1724.. option:: -fprofile-dir=<arg>
1725
1726.. option:: -fprofile-generate, -fno-profile-generate
1727
1728Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1729
1730.. program:: clang1
1731.. option:: -fprofile-generate=<directory>
1732.. program:: clang
1733
1734Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1735
1736.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1737
1738Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1739
1740.. program:: clang1
1741.. option:: -fprofile-instr-generate=<file>
1742.. program:: clang
1743
1744Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1745
1746.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1747
1748.. program:: clang1
1749.. option:: -fprofile-instr-use=<arg>
1750.. program:: clang
1751
1752Use instrumentation data for profile-guided optimization
1753
1754.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1755
1756Specifies that the sample profile is accurate. If the sample
1757               profile is accurate, callsites without profile samples are marked
1758               as cold. Otherwise, treat callsites without profile samples as if
1759               we have no profile
1760
1761.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1762
1763.. program:: clang1
1764.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
1765.. program:: clang
1766
1767Enable sample-based profile guided optimizations
1768
1769.. program:: clang1
1770.. option:: -fprofile-use=<pathname>
1771.. program:: clang
1772
1773Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1774
1775.. option:: -freciprocal-math, -fno-reciprocal-math
1776
1777Allow division operations to be reassociated
1778
1779.. option:: -freg-struct-return
1780
1781Override the default ABI to return small structs in registers
1782
1783.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1784
1785Use atexit or \_\_cxa\_atexit to register global destructors
1786
1787.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1788
1789Enable C++17 relaxed template template argument matching
1790
1791.. option:: -freroll-loops, -fno-reroll-loops
1792
1793Turn on loop reroller
1794
1795.. option:: -fretain-comments-from-system-headers
1796
1797.. option:: -frewrite-imports, -fno-rewrite-imports
1798
1799.. option:: -frewrite-includes, -fno-rewrite-includes
1800
1801.. option:: -frewrite-map-file <arg>
1802
1803.. program:: clang1
1804.. option:: -frewrite-map-file=<arg>
1805.. program:: clang
1806
1807.. option:: -fropi, -fno-ropi
1808
1809.. option:: -frtti, -fno-rtti
1810
1811.. option:: -frwpi, -fno-rwpi
1812
1813.. option:: -fsave-optimization-record, -fno-save-optimization-record
1814
1815Generate a YAML optimization record file
1816
1817.. option:: -fseh-exceptions
1818
1819Use SEH style exceptions
1820
1821.. option:: -fshort-enums, -fno-short-enums
1822
1823Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1824
1825.. option:: -fshort-wchar, -fno-short-wchar
1826
1827Force wchar\_t to be a short unsigned int
1828
1829.. option:: -fshow-column, -fno-show-column
1830
1831.. option:: -fshow-overloads=<arg>
1832
1833Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1834
1835.. option:: -fshow-source-location, -fno-show-source-location
1836
1837.. option:: -fsignaling-math, -fno-signaling-math
1838
1839.. option:: -fsigned-bitfields
1840
1841.. option:: -fsigned-char, -fno-signed-char, --signed-char
1842
1843.. option:: -fsigned-zeros, -fno-signed-zeros
1844
1845.. option:: -fsized-deallocation, -fno-sized-deallocation
1846
1847Enable C++14 sized global deallocation functions
1848
1849.. option:: -fsjlj-exceptions
1850
1851Use SjLj style exceptions
1852
1853.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1854
1855Enable the superword-level parallelism vectorization passes
1856
1857.. option:: -fspell-checking, -fno-spell-checking
1858
1859.. option:: -fspell-checking-limit=<arg>
1860
1861.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1862
1863Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
1864
1865.. option:: -fsplit-stack
1866
1867.. option:: -fstack-protector, -fno-stack-protector
1868
1869Enable stack protectors for functions potentially vulnerable to stack smashing
1870
1871.. option:: -fstack-protector-all
1872
1873Force the usage of stack protectors for all functions
1874
1875.. option:: -fstack-protector-strong
1876
1877Use a strong heuristic to apply stack protectors to functions
1878
1879.. option:: -fstack-size-section, -fno-stack-size-section
1880
1881Emit section containing metadata on function stack sizes
1882
1883.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1884
1885Emit full debug info for all types used by the program
1886
1887.. option:: -fstrict-aliasing, -fno-strict-aliasing
1888
1889.. option:: -fstrict-enums, -fno-strict-enums
1890
1891Enable optimizations based on the strict definition of an enum's value range
1892
1893.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
1894
1895Assume that overflowing float-to-int casts are undefined (default)
1896
1897.. option:: -fstrict-overflow, -fno-strict-overflow
1898
1899.. option:: -fstrict-return, -fno-strict-return
1900
1901Always treat control flow paths that fall off the end of a non-void function as unreachable
1902
1903.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1904
1905Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1906
1907.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1908
1909.. option:: -ftabstop=<arg>
1910
1911.. option:: -ftemplate-backtrace-limit=<arg>
1912
1913.. option:: -ftemplate-depth-<arg>
1914
1915.. option:: -ftemplate-depth=<arg>
1916
1917.. option:: -ftest-coverage
1918
1919.. option:: -fthinlto-index=<arg>
1920
1921Perform ThinLTO importing using provided function summary index
1922
1923.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1924
1925.. option:: -ftime-report
1926
1927.. option:: -ftls-model=<arg>
1928
1929.. option:: -ftrap-function=<arg>
1930
1931Issue call to specified function rather than a trap instruction
1932
1933.. option:: -ftrapping-math, -fno-trapping-math
1934
1935.. option:: -ftrapv
1936
1937Trap on integer overflow
1938
1939.. option:: -ftrapv-handler <arg>
1940
1941.. program:: clang1
1942.. option:: -ftrapv-handler=<function name>
1943.. program:: clang
1944
1945Specify the function to be called on overflow
1946
1947.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1948
1949Process trigraph sequences
1950
1951.. option:: -funique-section-names, -fno-unique-section-names
1952
1953Use unique names for text and data sections (ELF Only)
1954
1955.. option:: -funit-at-a-time, -fno-unit-at-a-time
1956
1957.. option:: -funroll-loops, -fno-unroll-loops
1958
1959Turn on loop unroller
1960
1961.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
1962
1963.. option:: -funsigned-bitfields
1964
1965.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
1966
1967.. option:: -funwind-tables, -fno-unwind-tables
1968
1969.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
1970
1971.. option:: -fuse-init-array, -fno-use-init-array
1972
1973Use .init\_array instead of .ctors
1974
1975.. option:: -fuse-ld=<arg>
1976
1977.. option:: -fuse-line-directives, -fno-use-line-directives
1978
1979.. option:: -fveclib=<arg>
1980
1981Use the given vector functions library
1982
1983.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
1984
1985Enable the loop vectorization passes
1986
1987.. option:: -fverbose-asm, -fno-verbose-asm
1988
1989.. option:: -fvisibility-inlines-hidden
1990
1991Give inline C++ member functions hidden visibility by default
1992
1993.. option:: -fvisibility-ms-compat
1994
1995Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
1996
1997.. option:: -fvisibility=<arg>
1998
1999Set the default symbol visibility for all global declarations
2000
2001.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2002
2003Enables whole-program vtable optimization. Requires -flto
2004
2005.. option:: -fwrapv, -fno-wrapv
2006
2007Treat signed integer overflow as two's complement
2008
2009.. option:: -fwritable-strings
2010
2011Store string literals as writable data
2012
2013.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2014
2015Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2016
2017.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2018
2019Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2020
2021.. option:: -fxray-always-instrument=<arg>
2022
2023DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2024
2025.. option:: -fxray-attr-list=<arg>
2026
2027Filename defining the list of functions/types for imbuing XRay attributes.
2028
2029.. option:: -fxray-instruction-threshold<arg>
2030
2031.. program:: clang1
2032.. option:: -fxray-instruction-threshold=<arg>
2033.. program:: clang
2034
2035Sets the minimum function size to instrument with XRay
2036
2037.. option:: -fxray-instrument, -fno-xray-instrument
2038
2039Generate XRay instrumentation sleds on function entry and exit
2040
2041.. option:: -fxray-instrumentation-bundle=<arg>
2042
2043Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'.
2044
2045.. option:: -fxray-link-deps
2046
2047Tells clang to add the link dependencies for XRay.
2048
2049.. option:: -fxray-modes=<arg>
2050
2051List of modes to link in by default into XRay instrumented binaries.
2052
2053.. option:: -fxray-never-instrument=<arg>
2054
2055DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
2056
2057.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2058
2059.. option:: -fzvector, -fno-zvector, -mzvector
2060
2061Enable System z vector language extension
2062
2063.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2064
2065.. option:: -pedantic-errors, --pedantic-errors
2066
2067OpenCL flags
2068------------
2069.. option:: -cl-denorms-are-zero
2070
2071OpenCL only. Allow denormals to be flushed to zero.
2072
2073.. option:: -cl-fast-relaxed-math
2074
2075OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2076
2077.. option:: -cl-finite-math-only
2078
2079OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2080
2081.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2082
2083OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2084
2085.. option:: -cl-kernel-arg-info
2086
2087OpenCL only. Generate kernel argument metadata.
2088
2089.. option:: -cl-mad-enable
2090
2091OpenCL only. Allow use of less precise MAD computations in the generated binary.
2092
2093.. option:: -cl-no-signed-zeros
2094
2095OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2096
2097.. option:: -cl-opt-disable
2098
2099OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2100
2101.. option:: -cl-single-precision-constant
2102
2103OpenCL only. Treat double precision floating-point constant as single precision constant.
2104
2105.. option:: -cl-std=<arg>
2106
2107OpenCL language standard to compile for.
2108
2109.. option:: -cl-strict-aliasing
2110
2111OpenCL only. This option is added for compatibility with OpenCL 1.0.
2112
2113.. option:: -cl-uniform-work-group-size
2114
2115OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2116
2117.. option:: -cl-unsafe-math-optimizations
2118
2119OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.
2120
2121Target-dependent compilation options
2122~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2123.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2124
2125Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2126
2127.. option:: -m16
2128
2129.. option:: -m32
2130
2131.. option:: -m64
2132
2133.. option:: -mabi=<arg>
2134
2135.. option:: -malign-double
2136
2137Align doubles to two words in structs (x86 only)
2138
2139.. option:: -march=<arg>
2140
2141.. option:: -masm=<arg>
2142
2143.. option:: -mbackchain, -mno-backchain
2144
2145Link stack frames through backchain on System Z
2146
2147.. option:: -mcmodel=<arg>
2148
2149.. option:: -mconsole<arg>
2150
2151.. 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)
2152
2153.. option:: -mcrc, -mno-crc
2154
2155Allow use of CRC instructions (ARM/Mips only)
2156
2157.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2158
2159.. option:: -mdll<arg>
2160
2161.. option:: -mdynamic-no-pic<arg>
2162
2163.. option:: -meabi <arg>
2164
2165Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2166
2167.. option:: -mfentry
2168
2169Insert calls to fentry at function entry (x86 only)
2170
2171.. option:: -mfloat-abi=<arg>
2172
2173.. option:: -mfpmath=<arg>
2174
2175.. option:: -mfpu=<arg>
2176
2177.. option:: -mglobal-merge, -mno-global-merge
2178
2179Enable merging of globals
2180
2181.. option:: -mhard-float
2182
2183.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2184
2185.. option:: -miamcu, -mno-iamcu
2186
2187Use Intel MCU ABI
2188
2189.. option:: -mimplicit-float, -mno-implicit-float
2190
2191.. option:: -mimplicit-it=<arg>
2192
2193.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2194
2195(integrated-as) Emit an object file which can be used with an incremental linker
2196
2197.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
2198
2199.. option:: -mkernel
2200
2201.. option:: -mlong-calls, -mno-long-calls
2202
2203Generate branches with extended addressability, usually via indirect jumps.
2204
2205.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
2206
2207Set Mac OS X deployment target
2208
2209.. option:: -mmcu=<arg>
2210
2211.. option:: -mms-bitfields, -mno-ms-bitfields
2212
2213Set the default structure layout to be compatible with the Microsoft compiler standard
2214
2215.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2216
2217Omit frame pointer setup for leaf functions
2218
2219.. option:: -moslib=<arg>
2220
2221.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2222
2223Use copy relocations support for PIE builds
2224
2225.. option:: -mprefer-vector-width=<arg>
2226
2227Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2228
2229.. option:: -mqdsp6-compat
2230
2231Enable hexagon-qdsp6 backward compatibility
2232
2233.. option:: -mrecip
2234
2235.. program:: clang1
2236.. option:: -mrecip=<arg1>,<arg2>...
2237.. program:: clang
2238
2239.. option:: -mred-zone, -mno-red-zone
2240
2241.. option:: -mregparm=<arg>
2242
2243.. option:: -mrelax-all, -mno-relax-all
2244
2245(integrated-as) Relax all machine instructions
2246
2247.. option:: -mretpoline, -mno-retpoline
2248
2249.. option:: -mrtd, -mno-rtd
2250
2251Make StdCall calling convention the default
2252
2253.. option:: -msign-return-address=<arg>
2254
2255Select return address signing scope
2256
2257.. option:: -msoft-float, -mno-soft-float
2258
2259Use software floating point
2260
2261.. option:: -mstack-alignment=<arg>
2262
2263Set the stack alignment
2264
2265.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2266
2267Enable stack probes
2268
2269.. option:: -mstack-probe-size=<arg>
2270
2271Set the stack probe size
2272
2273.. option:: -mstackrealign, -mno-stackrealign
2274
2275Force realign the stack at entry to every function
2276
2277.. option:: -mthread-model <arg>
2278
2279The thread model to use, e.g. posix, single (posix by default)
2280
2281.. option:: -mthreads<arg>
2282
2283.. option:: -mthumb, -mno-thumb
2284
2285.. option:: -mtune=<arg>
2286
2287.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
2288
2289.. option:: -municode<arg>
2290
2291.. option:: -mvx, -mno-vx
2292
2293.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2294
2295.. option:: -mwatchos-version-min=<arg>
2296
2297.. option:: -mwindows<arg>
2298
2299.. option:: -mx32
2300
2301AARCH64
2302-------
2303.. option:: -ffixed-x1
2304
2305Reserve the x1 register (AArch64 only)
2306
2307.. option:: -ffixed-x2
2308
2309Reserve the x2 register (AArch64 only)
2310
2311.. option:: -ffixed-x3
2312
2313Reserve the x3 register (AArch64 only)
2314
2315.. option:: -ffixed-x4
2316
2317Reserve the x4 register (AArch64 only)
2318
2319.. option:: -ffixed-x5
2320
2321Reserve the x5 register (AArch64 only)
2322
2323.. option:: -ffixed-x6
2324
2325Reserve the x6 register (AArch64 only)
2326
2327.. option:: -ffixed-x7
2328
2329Reserve the x7 register (AArch64 only)
2330
2331.. option:: -ffixed-x18
2332
2333Reserve the x18 register (AArch64 only)
2334
2335.. option:: -ffixed-x20
2336
2337Reserve the x20 register (AArch64 only)
2338
2339.. option:: -fcall-saved-x8
2340
2341Make the x8 register call-saved (AArch64 only)
2342
2343.. option:: -fcall-saved-x9
2344
2345Make the x9 register call-saved (AArch64 only)
2346
2347.. option:: -fcall-saved-x10
2348
2349Make the x10 register call-saved (AArch64 only)
2350
2351.. option:: -fcall-saved-x11
2352
2353Make the x11 register call-saved (AArch64 only)
2354
2355.. option:: -fcall-saved-x12
2356
2357Make the x12 register call-saved (AArch64 only)
2358
2359.. option:: -fcall-saved-x13
2360
2361Make the x13 register call-saved (AArch64 only)
2362
2363.. option:: -fcall-saved-x14
2364
2365Make the x14 register call-saved (AArch64 only)
2366
2367.. option:: -fcall-saved-x15
2368
2369Make the x15 register call-saved (AArch64 only)
2370
2371.. option:: -fcall-saved-x18
2372
2373Make the x18 register call-saved (AArch64 only)
2374
2375.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2376
2377Workaround Cortex-A53 erratum 835769 (AArch64 only)
2378
2379.. option:: -mgeneral-regs-only
2380
2381Generate code which only uses the general purpose registers (AArch64 only)
2382
2383AMDGPU
2384------
2385.. option:: -mxnack, -mno-xnack
2386
2387Enable XNACK (AMDGPU only)
2388
2389ARM
2390---
2391.. option:: -ffixed-r9
2392
2393Reserve the r9 register (ARM only)
2394
2395.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2396
2397Disallow generation of data access to code sections (ARM only)
2398
2399.. option:: -mno-movt
2400
2401Disallow use of movt/movw pairs (ARM only)
2402
2403.. option:: -mno-neg-immediates
2404
2405Disallow converting instructions with negative immediates to their negation or inversion.
2406
2407.. option:: -mnocrc
2408
2409Disallow use of CRC instructions (ARM only)
2410
2411.. option:: -mrestrict-it, -mno-restrict-it
2412
2413Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2414
2415.. option:: -mtp=<arg>
2416
2417Read thread pointer from coprocessor register (ARM only)
2418
2419.. option:: -munaligned-access, -mno-unaligned-access
2420
2421Allow memory accesses to be unaligned (AArch32/AArch64 only)
2422
2423Hexagon
2424-------
2425.. option:: -mieee-rnd-near
2426
2427.. option:: -mmemops, -mno-memops
2428
2429Enable generation of memop instructions
2430
2431.. option:: -mnvj, -mno-nvj
2432
2433Enable generation of new-value jumps
2434
2435.. option:: -mnvs, -mno-nvs
2436
2437Enable generation of new-value stores
2438
2439.. option:: -mpackets, -mno-packets
2440
2441Enable generation of instruction packets
2442
2443Hexagon
2444-------
2445.. option:: -mhvx, -mno-hvx
2446
2447Enable Hexagon Vector eXtensions
2448
2449.. option:: -mhvx-length=<arg>
2450
2451Set Hexagon Vector Length
2452
2453.. program:: clang1
2454.. option:: -mhvx=<arg>
2455.. program:: clang
2456
2457Enable Hexagon Vector eXtensions
2458
2459MIPS
2460----
2461.. option:: -mabicalls, -mno-abicalls
2462
2463Enable SVR4-style position-independent code (Mips only)
2464
2465.. option:: -mabs=<arg>
2466
2467.. option:: -mcheck-zero-division, -mno-check-zero-division
2468
2469.. option:: -mcompact-branches=<arg>
2470
2471.. option:: -mdouble-float
2472
2473.. option:: -mdsp, -mno-dsp
2474
2475.. option:: -mdspr2, -mno-dspr2
2476
2477.. option:: -membedded-data, -mno-embedded-data
2478
2479Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2480
2481.. option:: -mextern-sdata, -mno-extern-sdata
2482
2483Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2484
2485.. option:: -mfp32
2486
2487Use 32-bit floating point registers (MIPS only)
2488
2489.. option:: -mfp64
2490
2491Use 64-bit floating point registers (MIPS only)
2492
2493.. option:: -mginv, -mno-ginv
2494
2495.. option:: -mgpopt, -mno-gpopt
2496
2497Use GP relative accesses for symbols known to be in a small data section (MIPS)
2498
2499.. option:: -mindirect-jump=<arg>
2500
2501Change indirect jump instructions to inhibit speculation
2502
2503.. option:: -mips16
2504
2505.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2506
2507.. option:: -mlocal-sdata, -mno-local-sdata
2508
2509Extend the -G behaviour to object local data (MIPS)
2510
2511.. option:: -mmadd4, -mno-madd4
2512
2513Enable the generation of 4-operand madd.s, madd.d and related instructions.
2514
2515.. option:: -mmicromips, -mno-micromips
2516
2517.. option:: -mmsa, -mno-msa
2518
2519Enable MSA ASE (MIPS only)
2520
2521.. option:: -mmt, -mno-mt
2522
2523Enable MT ASE (MIPS only)
2524
2525.. option:: -mnan=<arg>
2526
2527.. option:: -mno-mips16
2528
2529.. option:: -msingle-float
2530
2531.. option:: -mvirt, -mno-virt
2532
2533.. option:: -mxgot, -mno-xgot
2534
2535PowerPC
2536-------
2537.. option:: -maltivec, -mno-altivec
2538
2539.. option:: -mcmpb, -mno-cmpb
2540
2541.. option:: -mcrbits, -mno-crbits
2542
2543.. option:: -mcrypto, -mno-crypto
2544
2545.. option:: -mdirect-move, -mno-direct-move
2546
2547.. option:: -mfloat128, -mno-float128
2548
2549.. option:: -mfprnd, -mno-fprnd
2550
2551.. option:: -mhtm, -mno-htm
2552
2553.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2554
2555.. option:: -misel, -mno-isel
2556
2557.. option:: -mlongcall, -mno-longcall
2558
2559.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2560
2561.. option:: -mpopcntd, -mno-popcntd
2562
2563.. option:: -mpower8-vector, -mno-power8-vector
2564
2565.. option:: -mpower9-vector, -mno-power9-vector
2566
2567.. option:: -mqpx, -mno-qpx
2568
2569.. option:: -msecure-plt
2570
2571.. option:: -mvsx, -mno-vsx
2572
2573WebAssembly
2574-----------
2575.. option:: -mexception-handling, -mno-exception-handling
2576
2577.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
2578
2579.. option:: -msign-ext, -mno-sign-ext
2580
2581.. option:: -msimd128, -mno-simd128
2582
2583X86
2584---
2585.. option:: -m3dnow, -mno-3dnow
2586
2587.. option:: -m3dnowa, -mno-3dnowa
2588
2589.. option:: -madx, -mno-adx
2590
2591.. option:: -maes, -mno-aes
2592
2593.. option:: -mavx, -mno-avx
2594
2595.. option:: -mavx2, -mno-avx2
2596
2597.. option:: -mavx512bitalg, -mno-avx512bitalg
2598
2599.. option:: -mavx512bw, -mno-avx512bw
2600
2601.. option:: -mavx512cd, -mno-avx512cd
2602
2603.. option:: -mavx512dq, -mno-avx512dq
2604
2605.. option:: -mavx512er, -mno-avx512er
2606
2607.. option:: -mavx512f, -mno-avx512f
2608
2609.. option:: -mavx512ifma, -mno-avx512ifma
2610
2611.. option:: -mavx512pf, -mno-avx512pf
2612
2613.. option:: -mavx512vbmi, -mno-avx512vbmi
2614
2615.. option:: -mavx512vbmi2, -mno-avx512vbmi2
2616
2617.. option:: -mavx512vl, -mno-avx512vl
2618
2619.. option:: -mavx512vnni, -mno-avx512vnni
2620
2621.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2622
2623.. option:: -mbmi, -mno-bmi
2624
2625.. option:: -mbmi2, -mno-bmi2
2626
2627.. option:: -mcldemote, -mno-cldemote
2628
2629.. option:: -mclflushopt, -mno-clflushopt
2630
2631.. option:: -mclwb, -mno-clwb
2632
2633.. option:: -mclzero, -mno-clzero
2634
2635.. option:: -mcx16, -mno-cx16
2636
2637.. option:: -mf16c, -mno-f16c
2638
2639.. option:: -mfma, -mno-fma
2640
2641.. option:: -mfma4, -mno-fma4
2642
2643.. option:: -mfsgsbase, -mno-fsgsbase
2644
2645.. option:: -mfxsr, -mno-fxsr
2646
2647.. option:: -mgfni, -mno-gfni
2648
2649.. option:: -minvpcid, -mno-invpcid
2650
2651.. option:: -mlwp, -mno-lwp
2652
2653.. option:: -mlzcnt, -mno-lzcnt
2654
2655.. option:: -mmmx, -mno-mmx
2656
2657.. option:: -mmovbe, -mno-movbe
2658
2659.. option:: -mmovdir64b, -mno-movdir64b
2660
2661.. option:: -mmovdiri, -mno-movdiri
2662
2663.. option:: -mmpx, -mno-mpx
2664
2665.. option:: -mmwaitx, -mno-mwaitx
2666
2667.. option:: -mpclmul, -mno-pclmul
2668
2669.. option:: -mpconfig, -mno-pconfig
2670
2671.. option:: -mpku, -mno-pku
2672
2673.. option:: -mpopcnt, -mno-popcnt
2674
2675.. option:: -mprefetchwt1, -mno-prefetchwt1
2676
2677.. option:: -mprfchw, -mno-prfchw
2678
2679.. option:: -mptwrite, -mno-ptwrite
2680
2681.. option:: -mrdpid, -mno-rdpid
2682
2683.. option:: -mrdrnd, -mno-rdrnd
2684
2685.. option:: -mrdseed, -mno-rdseed
2686
2687.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
2688
2689.. option:: -mrtm, -mno-rtm
2690
2691.. option:: -msahf, -mno-sahf
2692
2693.. option:: -msgx, -mno-sgx
2694
2695.. option:: -msha, -mno-sha
2696
2697.. option:: -mshstk, -mno-shstk
2698
2699.. option:: -msse, -mno-sse
2700
2701.. option:: -msse2, -mno-sse2
2702
2703.. option:: -msse3, -mno-sse3
2704
2705.. option:: -msse4.1, -mno-sse4.1
2706
2707.. program:: clang1
2708.. option:: -msse4.2, -mno-sse4.2, -msse4
2709.. program:: clang
2710
2711.. option:: -msse4a, -mno-sse4a
2712
2713.. option:: -mssse3, -mno-ssse3
2714
2715.. option:: -mtbm, -mno-tbm
2716
2717.. option:: -mvaes, -mno-vaes
2718
2719.. option:: -mvpclmulqdq, -mno-vpclmulqdq
2720
2721.. option:: -mwaitpkg, -mno-waitpkg
2722
2723.. option:: -mwbnoinvd, -mno-wbnoinvd
2724
2725.. option:: -mx87, -m80387, -mno-x87
2726
2727.. option:: -mxop, -mno-xop
2728
2729.. option:: -mxsave, -mno-xsave
2730
2731.. option:: -mxsavec, -mno-xsavec
2732
2733.. option:: -mxsaveopt, -mno-xsaveopt
2734
2735.. option:: -mxsaves, -mno-xsaves
2736
2737RISCV
2738-----
2739.. option:: -mrelax, -mno-relax
2740
2741Enable linker relaxation
2742
2743Optimization level
2744~~~~~~~~~~~~~~~~~~
2745
2746Flags controlling how much optimization should be performed.
2747
2748.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2749
2750.. option:: -Ofast<arg>
2751
2752Debug information generation
2753~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2754
2755Flags controlling how much and what kind of debug information should be
2756generated.
2757
2758Kind and level of debug information
2759-----------------------------------
2760.. option:: -g, --debug, --debug=<arg>
2761
2762Generate source-level debug information
2763
2764.. option:: -gdwarf-2
2765
2766Generate source-level debug information with dwarf version 2
2767
2768.. option:: -gdwarf-3
2769
2770Generate source-level debug information with dwarf version 3
2771
2772.. option:: -gdwarf-4, -gdwarf
2773
2774Generate source-level debug information with dwarf version 4
2775
2776.. option:: -gdwarf-5
2777
2778Generate source-level debug information with dwarf version 5
2779
2780.. option:: -gfull
2781
2782.. option:: -gused
2783
2784Debug level
2785___________
2786.. option:: -g0
2787
2788.. option:: -g2
2789
2790.. option:: -g3
2791
2792.. option:: -ggdb0
2793
2794.. option:: -ggdb1
2795
2796.. option:: -ggdb2
2797
2798.. option:: -ggdb3
2799
2800.. option:: -gline-tables-only, -g1, -gmlt
2801
2802Emit debug line number tables only
2803
2804.. option:: -gmodules
2805
2806Generate debug info with external references to clang modules or precompiled headers
2807
2808Debugger to tune debug information for
2809______________________________________
2810.. option:: -ggdb
2811
2812.. option:: -glldb
2813
2814.. option:: -gsce
2815
2816Debug information flags
2817-----------------------
2818.. option:: -gcolumn-info, -gno-column-info
2819
2820.. option:: -gdwarf-aranges
2821
2822.. option:: -gembed-source, -gno-embed-source
2823
2824Embed source text in DWARF debug sections
2825
2826.. option:: -ggnu-pubnames, -gno-gnu-pubnames
2827
2828.. option:: -gpubnames, -gno-pubnames
2829
2830.. option:: -grecord-gcc-switches, -gno-record-gcc-switches
2831
2832.. option:: -gsplit-dwarf
2833
2834.. option:: -gstrict-dwarf, -gno-strict-dwarf
2835
2836.. option:: -gz
2837
2838DWARF debug sections compression type
2839
2840.. program:: clang1
2841.. option:: -gz=<arg>
2842.. program:: clang
2843
2844DWARF debug sections compression type
2845
2846Static analyzer flags
2847=====================
2848
2849Flags controlling the behavior of the Clang Static Analyzer.
2850
2851.. option:: -Xanalyzer <arg>
2852
2853Pass <arg> to the static analyzer
2854
2855Fortran compilation flags
2856=========================
2857
2858Flags that will be passed onto the ``gfortran`` compiler when Clang is given
2859a Fortran input.
2860
2861.. option:: -A<arg>, --assert <arg>, --assert=<arg>
2862
2863.. option:: -A-<arg>
2864
2865.. option:: -J<arg>
2866
2867.. option:: -cpp
2868
2869.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
2870
2871.. option:: -falign-commons, -fno-align-commons
2872
2873.. option:: -fall-intrinsics, -fno-all-intrinsics
2874
2875.. option:: -fautomatic, -fno-automatic
2876
2877.. option:: -fbackslash, -fno-backslash
2878
2879.. option:: -fbacktrace, -fno-backtrace
2880
2881.. option:: -fblas-matmul-limit=<arg>
2882
2883.. option:: -fbounds-check, -fno-bounds-check
2884
2885.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
2886
2887.. option:: -fcheck=<arg>
2888
2889.. option:: -fcoarray=<arg>
2890
2891.. option:: -fconvert=<arg>
2892
2893.. option:: -fcray-pointer, -fno-cray-pointer
2894
2895.. option:: -fd-lines-as-code, -fno-d-lines-as-code
2896
2897.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
2898
2899.. option:: -fdefault-double-8, -fno-default-double-8
2900
2901.. option:: -fdefault-integer-8, -fno-default-integer-8
2902
2903.. option:: -fdefault-real-8, -fno-default-real-8
2904
2905.. option:: -fdollar-ok, -fno-dollar-ok
2906
2907.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
2908
2909.. option:: -fdump-fortran-original, -fno-dump-fortran-original
2910
2911.. option:: -fdump-parse-tree, -fno-dump-parse-tree
2912
2913.. option:: -fexternal-blas, -fno-external-blas
2914
2915.. option:: -ff2c, -fno-f2c
2916
2917.. option:: -ffixed-form, -fno-fixed-form
2918
2919.. option:: -ffixed-line-length-<arg>
2920
2921.. option:: -ffpe-trap=<arg>
2922
2923.. option:: -ffree-form, -fno-free-form
2924
2925.. option:: -ffree-line-length-<arg>
2926
2927.. option:: -ffrontend-optimize, -fno-frontend-optimize
2928
2929.. option:: -fimplicit-none, -fno-implicit-none
2930
2931.. option:: -finit-character=<arg>
2932
2933.. option:: -finit-integer=<arg>
2934
2935.. option:: -finit-local-zero, -fno-init-local-zero
2936
2937.. option:: -finit-logical=<arg>
2938
2939.. option:: -finit-real=<arg>
2940
2941.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
2942
2943.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
2944
2945.. option:: -fmax-array-constructor=<arg>
2946
2947.. option:: -fmax-errors=<arg>
2948
2949.. option:: -fmax-identifier-length, -fno-max-identifier-length
2950
2951.. option:: -fmax-stack-var-size=<arg>
2952
2953.. option:: -fmax-subrecord-length=<arg>
2954
2955.. option:: -fmodule-private, -fno-module-private
2956
2957.. option:: -fpack-derived, -fno-pack-derived
2958
2959.. option:: -fprotect-parens, -fno-protect-parens
2960
2961.. option:: -frange-check, -fno-range-check
2962
2963.. option:: -freal-4-real-10, -fno-real-4-real-10
2964
2965.. option:: -freal-4-real-16, -fno-real-4-real-16
2966
2967.. option:: -freal-4-real-8, -fno-real-4-real-8
2968
2969.. option:: -freal-8-real-10, -fno-real-8-real-10
2970
2971.. option:: -freal-8-real-16, -fno-real-8-real-16
2972
2973.. option:: -freal-8-real-4, -fno-real-8-real-4
2974
2975.. option:: -frealloc-lhs, -fno-realloc-lhs
2976
2977.. option:: -frecord-marker=<arg>
2978
2979.. option:: -frecursive, -fno-recursive
2980
2981.. option:: -frepack-arrays, -fno-repack-arrays
2982
2983.. option:: -fsecond-underscore, -fno-second-underscore
2984
2985.. option:: -fsign-zero, -fno-sign-zero
2986
2987.. option:: -fstack-arrays, -fno-stack-arrays
2988
2989.. option:: -funderscoring, -fno-underscoring
2990
2991.. option:: -fwhole-file, -fno-whole-file
2992
2993.. option:: -imultilib <arg>
2994
2995.. option:: -nocpp
2996
2997.. option:: -static-libgfortran
2998
2999Linker flags
3000============
3001Flags that are passed on to the linker
3002
3003.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3004
3005Add directory to library search path
3006
3007.. option:: -Mach
3008
3009.. option:: -T<script>
3010
3011Specify <script> as linker script
3012
3013.. option:: -Tbss<addr>
3014
3015Set starting address of BSS to <addr>
3016
3017.. option:: -Tdata<addr>
3018
3019Set starting address of DATA to <addr>
3020
3021.. option:: -Ttext<addr>
3022
3023Set starting address of TEXT to <addr>
3024
3025.. option:: -Wl,<arg>,<arg2>...
3026
3027Pass the comma separated arguments in <arg> to the linker
3028
3029.. option:: -X
3030
3031.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3032
3033Pass <arg> to the linker
3034
3035.. program:: clang1
3036.. option:: -Z
3037.. program:: clang
3038
3039.. option:: -e<arg>, --entry
3040
3041.. option:: -filelist <arg>
3042
3043.. option:: --hip-device-lib-path=<arg>
3044
3045HIP device library path
3046
3047.. option:: --hip-device-lib=<arg>
3048
3049HIP device library
3050
3051.. option:: -l<arg>
3052
3053.. option:: -r
3054
3055.. option:: -rpath <arg>
3056
3057.. option:: -s
3058
3059.. option:: -t
3060
3061.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3062
3063.. option:: -undef
3064
3065undef all system defines
3066
3067.. option:: -undefined<arg>, --no-undefined
3068
3069.. option:: -z <arg>
3070
3071Pass -z <arg> to the linker
3072
3073