diff options
Diffstat (limited to 'docs/ClangCommandLineReference.rst')
-rw-r--r-- | docs/ClangCommandLineReference.rst | 212 |
1 files changed, 185 insertions, 27 deletions
diff --git a/docs/ClangCommandLineReference.rst b/docs/ClangCommandLineReference.rst index 4d095883a4b79..5c15482cb251d 100644 --- a/docs/ClangCommandLineReference.rst +++ b/docs/ClangCommandLineReference.rst @@ -36,10 +36,18 @@ Treat source input files as Objective-C inputs Treat source input files as Objective-C++ inputs +.. option:: -Qn + +Do not emit metadata containing compiler name and version + .. option:: -Qunused-arguments Don't emit warning for unused driver arguments +.. option:: -Qy + +Emit metadata containing compiler name and version + .. option:: -Wa,<arg>,<arg2>... Pass the comma separated arguments in <arg> to the assembler @@ -61,10 +69,10 @@ Pass <arg> to the ptxas assembler Pass <arg> to the target offloading toolchain. .. program:: clang1 -.. option:: -Xopenmp-target=<arg> <arg2> +.. option:: -Xopenmp-target=<triple> <arg> .. program:: clang -Pass <arg> to the specified target offloading toolchain. The triple that identifies the toolchain must be provided after the equals sign. +Pass <arg> to the target offloading toolchain identified by <triple>. .. option:: -Z<arg> @@ -116,10 +124,18 @@ Output path for the plist report .. option:: -bundle\_loader <arg> .. program:: clang +.. option:: -cfguard + +Emit tables required for Windows Control Flow Guard. + .. option:: -client\_name<arg> .. option:: -compatibility\_version<arg> +.. option:: --config <arg> + +Specifies configuration file + .. option:: --constant-cfstrings .. option:: -coverage, --coverage @@ -140,6 +156,10 @@ CUDA GPU architecture (e.g. sm\_35). May be specified more than once. Compile CUDA code for host only. Has no effect on non-CUDA compilations. +.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg> + +Include PTX for the follwing GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once. + .. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug Enable device-side debug info generation. Disables ptxas optimizations. @@ -190,6 +210,14 @@ Use approximate transcendental functions Flush denormal floating point values to zero in CUDA device mode. +.. option:: -fcuda-rdc, -fno-cuda-rdc + +Generate relocatable device code, also known as separate compilation mode. + +.. option:: -ffixed-r19 + +Reserve the r19 register (Hexagon only) + .. option:: -fheinous-gnu-extensions .. option:: -flat\_namespace @@ -230,6 +258,8 @@ Display available options .. option:: --help-hidden +Display help for hidden options + .. option:: -image\_base <arg> .. option:: -index-header-map @@ -702,6 +732,14 @@ Print source range spans in numeric form .. option:: -fdiagnostics-show-category=<arg> +.. option:: -fdiscard-value-names, -fno-discard-value-names + +Discard value names in LLVM IR + +.. option:: -fexperimental-isel, -fno-experimental-isel + +Enables the experimental global instruction selector + .. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager Enables an experimental new pass manager in LLVM. @@ -736,6 +774,10 @@ Level of field padding for AddressSanitizer Enable linker dead stripping of globals in AddressSanitizer +.. option:: -fsanitize-address-poison-class-member-array-new-cookie, -fno-sanitize-address-poison-class-member-array-new-cookie + +Enable poisoning array cookies when using class member operator new\[\] in AddressSanitizer + .. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope Enable use-after-scope detection in AddressSanitizer @@ -868,6 +910,10 @@ Add directory to include search path Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path +.. option:: --cuda-path-ignore-env + +Ignore environment variables to detect CUDA installation + .. option:: --cuda-path=<arg> CUDA installation path @@ -912,7 +958,7 @@ Specify the module user build path Don't verify input files for the modules if the module has been successfully validated or loaded during this build session -.. option:: -fmodules-validate-system-headers +.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers Validate the system headers that a module depends on when loading the module @@ -920,8 +966,6 @@ Validate the system headers that a module depends on when loading the module Specify the prebuilt module path -.. option:: -i<arg> - .. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg> Add directory to AFTER include search path @@ -1107,6 +1151,12 @@ Target-independent compilation options .. option:: -faccess-control, -fno-access-control +.. option:: -falign-functions, -fno-align-functions + +.. program:: clang1 +.. option:: -falign-functions=<arg> +.. program:: clang + .. program:: clang1 .. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation .. program:: clang @@ -1175,6 +1225,10 @@ Load the clang builtins module map file. .. option:: -fcaret-diagnostics, -fno-caret-diagnostics +.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full) + +Instrument control-flow architecture protection. Options: return, branch, full, none. + .. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg> .. option:: -fcolor-diagnostics, -fno-color-diagnostics @@ -1305,6 +1359,8 @@ Use emutls functions to access thread\_local variables .. option:: -ferror-limit=<arg> +.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls + .. option:: -fexceptions, -fno-exceptions Enable support for exception handling @@ -1321,6 +1377,10 @@ Allow aggressive, lossy floating-point optimizations .. option:: -ffor-scope, -fno-for-scope +.. option:: -fforce-enable-int128, -fno-force-enable-int128 + +Enable support for int128\_t type + .. option:: -ffp-contract=<arg> Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse) @@ -1409,6 +1469,8 @@ Specify the maximum alignment to enforce on pointers lacking an explicit alignme .. option:: -fmerge-all-constants, -fno-merge-all-constants +Allow merging of constants + .. option:: -fmessage-length=<arg> .. option:: -fmodule-file-deps, -fno-module-file-deps @@ -1481,6 +1543,14 @@ Specifies the largest alignment guaranteed by '::operator new(size\_t)' Disable implicit builtin knowledge of a specific function +.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks + +When enabled, treat null pointer dereference, creation of a reference to null, +or passing a null pointer to a function parameter annotated with the "nonnull" +attribute as undefined behavior. (And, thus the optimizer may assume that any +pointer used in such a way must not have been null and optimize away the +branches accordingly.) On by default. + .. option:: -fno-elide-type Do not elide types when printing diagnostics @@ -1491,15 +1561,15 @@ Do not elide types when printing diagnostics Do not treat C++ operator name keywords as synonyms for operators -.. option:: -fno-strict-modules-decluse +.. option:: -fno-rtti-data -.. option:: -fno-working-directory +Control emission of RTTI data -.. option:: -fnoopenmp-relocatable-target +.. option:: -fno-strict-modules-decluse -Do not compile OpenMP target code as relocatable. +.. option:: -fno-working-directory -.. option:: -fnoopenmp-use-tls +.. option:: -fnoxray-link-deps .. option:: -fobjc-abi-version=<arg> @@ -1539,13 +1609,11 @@ Enable ARC-style weak references in Objective-C .. option:: -fopenmp, -fno-openmp -.. option:: -fopenmp-dump-offload-linker-script - -.. option:: -fopenmp-relocatable-target +Parse OpenMP pragmas and generate parallel code. -OpenMP target code is compiled as relocatable using the -c flag. For OpenMP targets the code is relocatable by default. +.. option:: -fopenmp-simd, -fno-openmp-simd -.. option:: -fopenmp-use-tls +Emit OpenMP code only for SIMD-based constructs. .. option:: -fopenmp-version=<arg> @@ -1656,6 +1724,10 @@ Allow division operations to be reassociated Override the default ABI to return small structs in registers +.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit + +Use atexit or \_\_cxa\_atexit to register global destructors + .. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args Enable C++17 relaxed template template argument matching @@ -1732,7 +1804,7 @@ Enable the superword-level parallelism vectorization passes .. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining -Place debug types in their own section (ELF Only) +Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF .. option:: -fsplit-stack @@ -1748,6 +1820,10 @@ Force the usage of stack protectors for all functions Use a strong heuristic to apply stack protectors to functions +.. option:: -fstack-size-section, -fno-stack-size-section + +Emit section containing metadata on function stack sizes + .. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug Emit full debug info for all types used by the program @@ -1852,7 +1928,7 @@ Enable the loop vectorization passes .. option:: -fvisibility-inlines-hidden -Give inline C++ member functions default visibility by default +Give inline C++ member functions hidden visibility by default .. option:: -fvisibility-ms-compat @@ -1866,6 +1942,12 @@ Set the default symbol visibility for all global declarations Enables whole-program vtable optimization. Requires -flto +.. option:: -fforce-emit-vtables, -fno-force-emit-vtables + +In order to improve devirtualization, forces emitting of vtables even in +modules where it isn't necessary. It causes more inline virtual functions +to be emitted. + .. option:: -fwrapv, -fno-wrapv Treat signed integer overflow as two's complement @@ -1878,9 +1960,17 @@ Store string literals as writable data Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented. +.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents + +Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented. + .. option:: -fxray-always-instrument=<arg> -Filename defining the whitelist for imbuing the 'always instrument' XRay attribute. +DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute. + +.. option:: -fxray-attr-list=<arg> + +Filename defining the list of functions/types for imbuing XRay attributes. .. option:: -fxray-instruction-threshold<arg> @@ -1894,9 +1984,21 @@ Sets the minimum function size to instrument with XRay Generate XRay instrumentation sleds on function entry and exit +.. option:: -fxray-instrumentation-bundle=<arg> + +Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'. + +.. option:: -fxray-link-deps + +Tells clang to add the link dependencies for XRay. + +.. option:: -fxray-modes=<arg> + +List of modes to link in by default into XRay instrumented binaries. + .. option:: -fxray-never-instrument=<arg> -Filename defining the whitelist for imbuing the 'never instrument' XRay attribute. +DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute. .. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss @@ -1954,6 +2056,10 @@ OpenCL language standard to compile for. OpenCL only. This option is added for compatibility with OpenCL 1.0. +.. option:: -cl-uniform-work-group-size + +OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel + .. option:: -cl-unsafe-math-optimizations OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable. @@ -1998,7 +2104,7 @@ Link stack frames through backchain on System Z .. option:: -mconsole<arg> -.. option:: -mcpu=<arg>, -mv4 (equivalent to -mcpu=hexagonv4), -mv5 (equivalent to -mcpu=hexagonv5), -mv55 (equivalent to -mcpu=hexagonv55), -mv60 (equivalent to -mcpu=hexagonv60), -mv62 (equivalent to -mcpu=hexagonv62) +.. option:: -mcpu=<arg>, -mv4 (equivalent to -mcpu=hexagonv4), -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) .. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg> @@ -2066,6 +2172,10 @@ Use Intel MCU ABI (integrated-as) Emit an object file which can be used with an incremental linker +.. option:: -mindirect-jump=<arg> + +Change indirect jump instructions to inhibit speculation + .. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg> .. option:: -mips16 @@ -2156,6 +2266,10 @@ Use software floating point Set the stack alignment +.. option:: -mstack-arg-probe, -mno-stack-arg-probe + +Enable stack probes + .. option:: -mstack-probe-size=<arg> Set the stack probe size @@ -2196,6 +2310,10 @@ AARCH64 Reserve the x18 register (AArch64 only) +.. option:: -ffixed-x20 + +Reserve the x20 register (AArch64 only) + .. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769 Workaround Cortex-A53 erratum 835769 (AArch64 only) @@ -2252,16 +2370,16 @@ Hexagon ------- .. option:: -mieee-rnd-near +.. option:: -mpackets, -mno-packets + +Enable generation of instruction packets + Hexagon ------- .. option:: -mhvx, -mno-hvx Enable Hexagon Vector eXtensions -.. option:: -mhvx-double, -mno-hvx-double - -Enable Hexagon Double Vector eXtensions - .. option:: -mhvx-length=<arg> Set Hexagon Vector Length @@ -2306,12 +2424,18 @@ PowerPC .. option:: -mqpx, -mno-qpx +.. option:: -msecure-plt + .. option:: -mvsx, -mno-vsx WebAssembly ----------- +.. option:: -mexception-handling, -mno-exception-handling + .. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint +.. option:: -msign-ext, -mno-sign-ext + .. option:: -msimd128, -mno-simd128 X86 @@ -2328,6 +2452,8 @@ X86 .. option:: -mavx2, -mno-avx2 +.. option:: -mavx512bitalg, -mno-avx512bitalg + .. option:: -mavx512bw, -mno-avx512bw .. option:: -mavx512cd, -mno-avx512cd @@ -2344,14 +2470,20 @@ X86 .. option:: -mavx512vbmi, -mno-avx512vbmi +.. option:: -mavx512vbmi2, -mno-avx512vbmi2 + .. option:: -mavx512vl, -mno-avx512vl +.. option:: -mavx512vnni, -mno-avx512vnni + .. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq .. option:: -mbmi, -mno-bmi .. option:: -mbmi2, -mno-bmi2 +.. option:: -mcldemote, -mno-cldemote + .. option:: -mclflushopt, -mno-clflushopt .. option:: -mclwb, -mno-clwb @@ -2370,7 +2502,7 @@ X86 .. option:: -mfxsr, -mno-fxsr -.. option:: -mibt, -mno-ibt +.. option:: -mgfni, -mno-gfni .. option:: -mlwp, -mno-lwp @@ -2380,6 +2512,10 @@ X86 .. option:: -mmovbe, -mno-movbe +.. option:: -mmovdiri, -mno-movdiri + +.. option:: -mmovdir64b, -mno-movdir64b + .. option:: -mmpx, -mno-mpx .. option:: -mmwaitx, -mno-mwaitx @@ -2394,12 +2530,20 @@ X86 .. option:: -mprfchw, -mno-prfchw +.. option:: -mrdpid, -mno-rdpid + .. option:: -mrdrnd, -mno-rdrnd .. option:: -mrdseed, -mno-rdseed +.. option:: -mretpoline, -mno-retpoline + +.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk + .. option:: -mrtm, -mno-rtm +.. option:: -msahf, -mno-sahf + .. option:: -msgx, -mno-sgx .. option:: -msha, -mno-sha @@ -2424,6 +2568,14 @@ X86 .. option:: -mtbm, -mno-tbm +.. option:: -mvaes, -mno-vaes + +.. option:: -mvpclmulqdq, -mno-vpclmulqdq + +.. option:: -mwaitpkg, -mno-waitpkg + +.. option:: -mwbnoinvd, -mno-wbnoinvd + .. option:: -mx87, -m80387, -mno-x87 .. option:: -mxop, -mno-xop @@ -2515,6 +2667,10 @@ Debug information flags .. option:: -gdwarf-aranges +.. option:: -gembed-source, -gno-embed-source + +Embed source text in DWARF debug sections + .. option:: -ggnu-pubnames .. option:: -grecord-gcc-switches, -gno-record-gcc-switches @@ -2680,6 +2836,8 @@ a Fortran input. .. option:: -fwhole-file, -fno-whole-file +.. option:: -imultilib <arg> + .. option:: -nocpp .. option:: -static-libgfortran @@ -2704,11 +2862,11 @@ Set starting address of BSS to <addr> .. option:: -Tdata<addr> -Set starting address of BSS to <addr> +Set starting address of DATA to <addr> .. option:: -Ttext<addr> -Set starting address of BSS to <addr> +Set starting address of TEXT to <addr> .. option:: -Wl,<arg>,<arg2>... |