This page lists the command line arguments currently supported by the GCC-compatible clang
and clang++
drivers.
Search $prefix$file for executables, libraries, and data files. If $prefix is a directory, search $prefix/$file
Add directory to framework include search path
Treat source input files as Objective-C inputs
Treat source input files as Objective-C++ inputs
Do not emit metadata containing compiler name and version
Donât emit warning for unused driver arguments
Emit metadata containing compiler name and version
Pass the comma separated arguments in <arg> to the assembler
target matches the specified architecture. This can be used with the target CPU, triple architecture, or offloading host and device. It is most useful for separating behavior undesirable on one of the targets when combining many compilation jobs, as is common with offloading. For example, -Xarch_x86_64, -Xarch_gfx90a, and -Xarch_device are all valid selectors. -Xarch_device will forward the argument to the offloading device while -Xarch_host will target the host system, which can be used to suppress incompatible GPU arguments.
Pass <arg> to the CUDA/HIP device compilation
Pass <arg> to the CUDA/HIP host compilation
Pass <arg> to fatbinary invocation
Pass <arg> to the ptxas assembler
Run the static analyzer
Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).
Disable CIR transformations pipeline
ClangIR: Disable MLIR module verifier
Specify configuration file
Generate code for an additional runtime variant of the deployment target
Specify the darwin target variant triple
Filename to write DOT-formatted header dependencies to
Filename (or -) to write dependency output to
Directory to output dSYMâs (if any) to
Use <dumpfpx> as a prefix to form auxiliary and dump file names
Display the compilerâs target processor
Display the version of the compiler
Emit Clang AST files for source inputs
Generate additional symbol graphs for extended modules.
Enable linker job to emit a static library.
Generate Extract API information as a side effect of compilation.
Start emitting warnings for unused driver arguments
Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.
Do not assume C++ operator new may not return NULL
Assume all functions may be convergent.
Range reduction is enabled for complex arithmetic operations.
Basic algebraic expansions of complex arithmetic operations involving are enabled.
Allow floating-point optimizations that assume arguments and results are not NaNs or +-inf. This defines the \_\_FINITE\_MATH\_ONLY\_\_ preprocessor macro.
Zero initialize globals without default initialization (default)
Save intermediate module file results when compiling a standard C++ module unit.
Save intermediate module file results when compiling a standard C++ module unit.
Embed the contents of all files read by this compilation into the produced module file.
Generate the reduced BMI
Pass <arg> to plugin <name>
Add -rpath with architecture-specific resource directory to the linker flags. When âhip-link is specified, also add -rpath with HIP runtime library directory to the linker flags
Path to system ignorelist file for sanitizers
Specify the overflow patterns to exclude from arithmetic sanitizer instrumentation. <arg> must be ânoneâ, âallâ, âadd-unsigned-overflow-testâ, âadd-signed-overflow-testâ, ânegated-unsigned-constâ or âunsigned-post-decr-whileâ.
or #pragma once. This flag makes -H show also such includes.
Build this module as a system module. Only used with -emit-module
Use GCC installation in the specified directory. The directory ends with path components like âlib{,32,64}/gcc{,-cross}/$triple/$versionâ. Note: executables (e.g. ld) used by the compiler are not overridden by the selected GCC installation
Specify a directory where Clang can find âincludeâ and âlib{,32,64}/gcc{,-cross}/$triple/$versionâ. Clang will use the GCC installation with the largest version
Search for the GCC installation with the specified triple.
Generate CodeView debug information
Emit compiler path and command line into CodeView debug information
Emit type record hashes in a .debug$H section
Emit reproducer on (option: off, crash (default), error, always)
Link the LLVM C Library for GPUs
Display available options
Display help for hidden options
Additional arguments to forward to LLVMâs option processing
Additional arguments to forward to MLIRâs option processing
Directory to dump module dependencies to
Path to the YAML configuration file to be used for multilib selection
High level qualifier for z/OS C++RT side deck datasets
High level qualifier for z/OS CSSLIB dataset
High level qualifier for z/OS Language Environment datasets
Path to system headers on z/OS
Disable loading default configuration files
Write output to <file>
Set the output <file> for debug infos
Link device libraries for GPU device compilation
Enable mcount instrumentation with prof
Enable mcount instrumentation
Use pipes between commands, when possible
Emit pretty printed symbol graphs
Print all of Clangâs warning options
Print the effective target triple
Print the extensions enabled by the given target and -march/-mcpu options. (AArch64 and RISC-V only)
Print the full library path of <file>
Enable Objective-C Ivar layout bitmap print trace
Print the library path for the currently used compiler runtime library (âlibgcc.aâ or âlibclang_rt.builtins.*.aâ)
Print the path for the C++ Standard library module manifest
Print the flags used for selecting multilibs (experimental)
Print the full program path of <name>
Print the resource directory pathname
Print the paths used for finding ROCm installation
Print the directory pathname containing Clangâs runtime libraries
Print the paths used for finding libraries and programs
Print supported -march extensions (RISC-V, AArch64 and ARM only)
Print the normalized target triple
Print the registered targets
Support POSIX threads in generated code
Whether to build a relocatable precompiled header
Rewrite Legacy Objective-C source to C++
Compiler runtime library to use
Save llvm statistics.
Save intermediate compilation results. <arg> can be set to âcwdâ for current working directory, or âobjâ which will save temporary files in the same directory as the final output file
Serialize compiler diagnostics to a file
Dynamically link the sanitizer runtime
Donât emit warnings about unused arguments for the following arguments
Generate code for statically linking libclosure (BlocksRuntime)
Statically link the sanitizer runtime (Not supported for ASan, TSan or UBSan on darwin)
Use the static host OpenMP runtime while linking.
C++ standard library to use. <arg> must be âlibc++â, âlibstdc++â or âplatformâ.
Directory in which to emit symbol graphs.
Generate code for the given target
Time individual commands
Enable some traditional CPP emulation
Unwind library to use. <arg> must be âlibgccâ, âlibunwindâ or âplatformâ.
Show commands to run and use verbose output
Verify the binary representation of debug output
Print version information
Overlay the virtual filesystem described by file over the real file system. Additionally, pass this overlay file to the linker if it supports it
Suppress all warnings
Resolve file paths relative to the specified directory
Treat subsequent input files as having type <language>
The action to perform on the input.
Only run the preprocessor
Only run preprocess and compilation steps
Only run preprocess, compile, and assemble steps
Build ASTs and then lower to ClangIR
Generate Interface Stub Files.
Use the LLVM representation for assembler and object files
Generate Interface Stub Files, emit merged text not binary.
Extract API information
Only run the driver.
Run the preprocessor, parser and semantic analysis stages
Provide information about a particular module file
Only precompile the input
Rewrite Objective-C source to C++
Load and verify that a pre-compiled header file is not stale
Compilation options¶Flags controlling the behavior of Clang during compilation. These flags have no effect during actions that do not perform compilation.
Pass <arg> to the assembler
Pass <arg> to clang -cc1
Pass <arg> to clang -cc1as
Pass <arg> to the target offloading toolchain.
Pass <arg> to the target offloading toolchain identified by <triple>.
Exclude __builtin_allow_runtime_check for the top hottest code responsible for the given fraction of PGO counters (0.0 [default] = skip none; 1.0 = skip all). Argument format: <value>
Enable external API notes support
Enable module-based external API notes support
Specify the Swift version to use when filtering API notes
C++ ABI to use. This will override the target C++ ABI.
Attempt to match the ABI of Clang <version>. <version> must be â<major>.<minor>â or âlatestâ.
Treat each comma separated argument in <arg> as a documentation comment block command
Require member pointer base types to be complete if they would be significant under the Microsoft ABI
Put crash-report files in <dir>
Set level of crash diagnostic reporting, (option: off, compiler, all)
Allow __declspec as a keyword
Print fix-its in machine parseable form
Print source range spans in numeric form
Discard value names in LLVM IR
Use the experimental C++ class ABI for classes with virtual tables
Enables the use of non-default rounding modes and non-default exception handling on targets that are not currently ready.
Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Enables the global instruction selector
Inline suitable functions
Inline functions which are (explicitly or implicitly) marked inline
Donât use ignorelist file for sanitizers
File holding the seed used by the randomize structure layout feature
The seed used by the randomize structure layout feature
Set the kind of module destructors emitted by AddressSanitizer instrumentation. These destructors are emitted to unregister instrumented global variables when code is unloaded (e.g. via `dlclose()`). <arg> must be ânoneâ or âglobalâ.
Level of field padding for AddressSanitizer
Enable linker dead stripping of globals in AddressSanitizer
Always generate function calls for address sanitizer instrumentation
Enable â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.
An 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.
Select the mode of detecting stack use-after-return in AddressSanitizer. <mode> must be âneverâ, âruntimeâ or âalwaysâ.
Enable use-after-scope detection in AddressSanitizer
Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
Annotate sanitizer instrumentation with extra debug info for the specified sanitizers, if supported
Make the jump table addresses canonical in the symbol table
Enable control flow integrity (CFI) checks for cross-DSO calls.
Normalize integers in CFI indirect call type signature checks
Generalize pointers in CFI indirect call type signature checks
Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones
Disable sanitizer coverage instrumentation for modules and functions that match the provided special case list, even the allowed ones
Use callback for max stack depth tracing with minimum stack depth M
Specify the type of coverage instrumentation for Sanitizers
Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.
Enable aliasing mode in HWAddressSanitizer
Path to ignorelist file for sanitizers
Embed function arity information into the KCFI patchable function prefix
Enable origins tracking in MemorySanitizer
Enable use-after-destroy detection in MemorySanitizer
Set default MTE mode to âsyncâ (default) or âasyncâ
Allow compiler to merge handlers for specified sanitizers
Enable recovery for specified sanitizers
Exclude sanitization for the top hottest code responsible for the given fraction of PGO counters (0.0 [default] = skip none; 1.0 = skip all). Argument format: <sanitizer1>=<value1>,<sanitizer2>=<value2>,â¦
Enable sanitizer statistics gathering.
Enable atomic operations instrumentation in ThreadSanitizer (default)
Enable function entry/exit instrumentation in ThreadSanitizer (default)
Enable memory access instrumentation in ThreadSanitizer (default)
Enable trapping for specified sanitizers
Strip (or keep only, if negative) a given number of path components when emitting check metadata.
Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
Enable version-independent external API notes support
Enable verification of LLVM IR
Disable function multiversioning
Enable function outlining (AArch64 only)
Generate local calls to out-of-line atomic operations
Print supported cpu models for the given target (if target is not specified,it will print the supported cpus for the default target)
Language standard to compile for
Preprocessor options¶Flags controlling the behavior of the Clang preprocessor.
Include comments in preprocessed output
Include comments from within macros in preprocessed output
Define <macro> to <value> (or 1 if <value> omitted)
Show header includes and nesting depth
Disable linemarker output in -E mode
Undefine macro <macro>
Pass the comma separated arguments in <arg> to the preprocessor
Pass <arg> to the preprocessor
Add directory to embed search path
Include path management¶Flags controlling how #include
s are resolved to files.
Add directory to include search path. For C++ inputs, if there are multiple -I options, these directories are searched in the order they are given before the standard system directories are searched. If the same directory is in the SYSTEM include search paths, for example if also specified with -isystem, the -I option will be ignored
Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
Add directory to the C++ SYSTEM include search path
Use the last modification time of <file> as the build session timestamp
Time when the current build session started
Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
Specify the module cache path
Disable validation of the diagnostic options when loading the module
Force validation of user headers when repeatedly loading a module file within single build session
Specify the interval (in seconds) after which a module file will be considered unused
Specify the interval (in seconds) between attempts to prune the module cache
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
Validate the system headers that a module depends on when loading the module
Specify the prebuilt module path
Add directory to the API notes search path referenced by module name
Enable builtin #include directories even when -nostdinc is used before or after -ibuiltininc. Using -nobuiltininc after the option disables it
Add directory to AFTER include search path
Add directory to SYSTEM framework search path
Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
Include macros from file before parsing
Include file before parsing
Include precompiled header file
Set the -iwithprefix/-iwithprefixbefore prefix
Add directory to QUOTE include search path
Set the system root directory (usually /)
Add directory to SYSTEM include search path
Add directory to end of the SYSTEM include search path
Overlay the virtual filesystem described by file over the real file system
Set directory to SYSTEM include search path with prefix
Set directory to include search path with prefix
Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
Path to libomptarget-amdgcn bitcode library
Path to libomptarget-nvptx bitcode library
Path to libomptarget-spirv bitcode library
Disable builtin #include directories only
Do not include the default HIP wrapper headers and include paths
Disable both standard system #include directories and builtin #include directories
Disable standard #include directories for the C++ standard library
Disable standard system #include directories only
Add include paths for CUDA/HIP and include the default CUDA/HIP wrapper headers (default)
Use directory as the C++ standard library include path
Treat all #include paths starting with <prefix> as including a system header.
Dependency file generation¶Flags controlling generation of a dependency file for make
-like build systems.
Like -MD, but also implies -E and writes to stdout by default
Write a depfile containing user and system headers
Write depfile output from -MMD, -MD, -MM, or -M to <file>
Add missing headers to depfile
Write a compilation database entry per input
Like -MMD, but also implies -E and writes to stdout by default
Write a depfile containing user headers
Create phony target for each dependency (other than main file)
Specify name of main file output to quote in depfile
Specify name of main file output in depfile
Use NMake/Jom format for the depfile
Dumping preprocessor state¶Flags allowing the state of the preprocessor to be dumped in various ways.
Print macro definitions in -E mode in addition to normal output
Print include directives in -E mode in addition to normal output
Print macro definitions in -E mode instead of normal output
Diagnostic options¶Flags controlling which warnings, errors, and remarks Clang will generate. See the full list of warning and remark flags.
Enable the specified remark
Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
Report missed transformations by optimization passes whose name matches the given POSIX regular expression
Report transformations performed by optimization passes whose name matches the given POSIX regular expression
Enable the specified warning
File containing diagnostic suppression mappings. See user manual for file format.
Target-independent compilation options¶Use hardened lowering for jump-table dispatch
Emit an address-significance table
N must be a power of two. Align loops to the boundary
Enable C++17 aligned allocation functions
Treat editor placeholders as valid source code
Source-level compatibility for Altivec vectors (for PowerPC targets). This includes results of vector comparison (scalar for âxlâ, vector for âgccâ) as well as behavior when initializing with a scalar (splatting for âxlâ, element zero only for âgccâ). For âmixedâ, the compatibility is as âgccâ for âvector bool/vector pixelâ and as âxlâ for other types. Current default is âmixedâ. <arg> must be âmixedâ, âgccâ or âxlâ.
Use ANSI escape codes for diagnostics
Use Appleâs kernel extensions ABI
Force linking the clang builtins runtime library
Enable Apple gcc-compatible #pragma pack handling
Restrict code to those available for App Extensions
Allow certain math function calls to be replaced with an approximately equivalent calculation
Assume that exception objectsâ destructors are non-throwing
Enable EH Asynchronous exceptions
May have atomic operations on fine-grained memory
Allow atomic operations to ignore denormal mode
May have atomic operations on remote memory
MinGW specific. Enable code generation support for automatic dllimport, and enable support for it in the linker. Enabled by default.
Emit the basic block address map section.
Place each basic block or a subset of basic blocks in its own section. <arg> must be âallâ, ânoneâ or âlist=â.
Produced object files can use all ELF features supported by this binutils version and newer. If -fno-integrated-as is specified, the generated assembly will consider GNU as support. ânoneâ means that all ELF features can be used, regardless of binutils support. Defaults to 2.26.
Enable the âblocksâ language feature
Accept non-standard constructs supported by the Borland compiler
Load the clang builtins module map file.
Controls which variables C++ static destructors are registered for. <arg> must be âallâ, âthread-localâ or ânoneâ.
Set the maximum number of source lines to show in a caret diagnostic (0 = no limit).
Instrument control-flow architecture protection. <arg> must be âreturnâ, âbranchâ, âfullâ or ânoneâ.
<arg> must be âunspecifiedâ, âstandaloneâ, âobjcâ, âswiftâ, âswift-5.0â, âswift-4.2â or âswift-4.1â.
Enable C++ builtin type char8_t
Use the ClangIR pipeline to compile
Emit codegen data into the object file. LLD for MachO (currently) merges them into the specified <path>.
Use codegen data read from the specified <path>.
Enable colors in diagnostics
Place definitions of variables with no storage class and no initializer (tentative definitions) in a common block, instead of generating individual zero-initialized definitions (default -fno-common).
Controls the calculation methods of complex number multiplication and division. <arg> must be âfullâ, âimprovedâ, âpromotedâ or âbasicâ.
Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit)
Set the maximum depth of recursive constexpr function calls
Set the maximum number of steps in constexpr function evaluation
Prefer aligned allocation for C++ Coroutines
Enable support for the C++ Coroutines
The compilation directory to embed in the coverage mapping.
Generate coverage mapping to enable code coverage analysis
Enable MC/DC criteria when generating code coverage
remap file source paths <old> to <new> in coverage mapping. If there are multiple options, prefix replacement is applied in reverse order starting from the last one
Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)
Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)
Enable C++ exceptions
Enable modules for C++
Place each data in its own section
The compilation directory to embed in the debug info
Default DWARF version to use, if a -g option caused DWARF debug info to be produced
Emit extra debug info to make sample profile more accurate
Emit macro debug information
For paths in debug info, remap directory <old> to <new>. If multiple options match a path, the last option wins
Use DWARF base address selection entries in .debug_ranges
Place debug types in their own section (ELF Only)
Enable predefined target OS macros
Parse templated function definitions at the end of the translation unit
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.
Print absolute paths in diagnostics
When to use colors in diagnostics. <arg> must be âautoâ, âalwaysâ or âneverâ.
Prevent optimization remarks from being output if they do not have at least this profile count. Use âautoâ to apply the threshold from profile summary
Prevent misexpect diagnostics from being output if the profile counts are within N% of the expected.
Enable profile hotness information in diagnostic line
Display include stacks for diagnostic notes
Print option name with mappable diagnostics
Print a template comparison tree for differing templates
Enable alternative token representations â<:â, â:>â, â<%â, â%>â, â%:â, â%:%:â (default)
Donât use GOT indirection to reference external data symbols
Disable block signature string)
Allow â$â in identifiers
Use DWARF style exceptions
Do not emit debug info for defined but unused types
Embed LLVM bitcode. <option> must be âoffâ, âallâ, âbitcodeâ or âmarkerâ.
Embed Offloading device-side binary into host object file as a section.
Emit all declarations, even if unused
Try emitting Compact-Unwind for non-canonical entries. Maybe overridden by other constraints
When to emit DWARF unwind (EH frame) info. <arg> must be âalwaysâ, âno-compact-unwindâ or âdefaultâ.
Use emutls functions to access thread_local variables
Enable matrix data type and related builtin functions
Enable support for exception handling
Allows control over excess precision on targets where native support for the precision types is not available. By default, excess precision is used to calculate intermediate results following the rules specified in ISO C99. <arg> must be âstandardâ, âfastâ or ânoneâ.
Enable experimental late parsing of attributes
Control whether unstable and experimental library features are enabled. This option enables various library features that are either experimental (also known as TSes), or have been but are not stable yet in the selected Standard Library implementation. It is not recommended to use this option in production code, since neither ABI nor API stability are guaranteed. This is intended to provide a preview of features that will ship in the future for experimentation purposes
Enable the experimental new constant interpreter
Overrides the _OPENACC macro value for experimental testing during OpenACC support development
Disable sanitizer metadata for modules and functions that match the provided special case list
Specify the type of metadata to emit for binary analysis sanitizers
Controls how scalar integer arguments are extended in calls to unprototyped and varargs functions. <arg> must be â32â or â64â.
Extend the liveness of user variables through optimizations to prevent stale or optimized-out variable values when debugging. <arg> must be âallâ, âthisâ or ânoneâ.
Allow aggressive, lossy floating-point optimizations
Enable fat LTO object support
The compilation directory to embed in the debug info and coverage mapping.
remap file source paths in debug info, coverage mapping, predefined preprocessor macros and __builtin_FILE(). Implies -ffile-reproducible.
Use the targetâs platform-specific path separator character when expanding the __FILE__ macro
Assume all non-trivial loops are finite.
Enable fixed point types
Reserve register r19 (Hexagon only)
Check the input source files from C++20 modules explicitly
Always emit a debug frame section
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.
Enable support for int128_t type
Form fused FP ops (e.g. FMAs): fast (fuses across statements disregarding pragmas) | on (only fuses in the same statement unless dictated by pragmas) | off (never fuses) | fast-honor-pragmas (fuses across statements unless dictated by pragmas). Default is âfastâ for CUDA, âfast-honor-pragmasâ for HIP, and âonâ otherwise. <arg> must be âfastâ, âonâ, âoffâ or âfast-honor-pragmasâ.
Specifies the evaluation method to use for floating-point arithmetic. <arg> must be âsourceâ, âdoubleâ or âextendedâ.
Specifies the exception behavior of floating-point operations. <arg> must be âignoreâ, âmaytrapâ or âstrictâ.
Controls the semantics of floating-point calculations.
Assert that the compilation takes place in a freestanding environment
Place each function in its own section
Allow GNU-extension keywords regardless of language standard
Generate output compatible with the standard GNU Objective-C runtime
Use the gnu89 inline semantics
Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)
Use approximate transcendental functions
Specify that floating-point optimizations are not allowed that assume arguments and results are not +-inf.
Specify that floating-point optimizations are not allowed that assume arguments and results are not NANs.
Enable support for ignoring exception handling constructs
Implicitly search the file system for module map files.
Enable incremental processing extensions such as processing statements on the global scope.
Suppress inlining of functions whose stack size exceeds the given value
Specify the default character set for source files
Instrument function entry only, after inlining, without arguments to the instrumentation call
Generate calls to instrument function entry and exit
Like -finstrument-functions, but insert the calls after inlining
Enable the integrated assembler
Run cc1 in-process
Use internal machine object code emitter.
Enable just-my-code debugging
Use jump tables for lowering switches
Enable keeping all variables that have a persistent storage duration, including global, static and thread-local variables, to guarantee that they can be directly addressed
Keep static const variables even if unused
Instead of expanding system headers when emitting preprocessor output, preserve the #include directive. Useful when producing preprocessed output for test case reduction. May produce incorrect output if preprocessor symbols that control the included content (e.g. _XOPEN_SOURCE) are defined in the including source file. The portability of the resulting source to other compilation environments is not guaranteed.
Only valid with -E.
Enable implicit vector bit-casts. <arg> must be ânoneâ, âintegerâ or âallâ.
Enable the loop interchange pass
Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
Number of partitions to use for parallel full LTO codegen, ld.lld only.
Set LTO mode. <arg> must be âthinâ or âfullâ.
Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit)
remap file source paths in predefined preprocessor macros and __builtin_FILE(). Implies -ffile-reproducible.
Require math functions to indicate errors by setting errno
Max total number of preprocessed tokens for -Wmax-tokens.
Specify the maximum alignment to enforce on pointers lacking an explicit alignment
Enable heap memory profiling
Use memory profile for profile-guided memory optimization
Enable heap memory profiling and dump results into <directory>
Allow merging of constants
Format message diagnostics so that they fit within N columns
Ignore the whitespace from the input file when emitting preprocessor output. It will only contain whitespace when necessary, e.g. to keep two minus signs from merging into to an increment operator. Useful with the -P option to normalize whitespace such that two files with only formatting changes are equal.
Only valid with -E on C-like inputs and incompatible with -traditional-cpp.
Build a C++20 Header Unit from a header
Build a C++20 Header Unit from a header that should be found in the user (fmodule-header=user) or system (fmodule-header=system) search path.
Load this module map file
Specify the name of the module to build
Allow to search for module maps in subdirectories of search paths
Enable the âmodulesâ language feature
Require declaration of modules used within a module
Ignore the definition of the given macro when building and loading modules
Search even non-imported modules to resolve references
Like -fmodules-decluse but requires all headers to be in modules
Validate PCM input files based on content if mtime differs
Enable full Microsoft Visual C++ compatibility
Dot-separated value representing the Microsoft compiler version number to report in _MSC_VER (0 = donât define it (default))
Define â__STDC__â to â1â in MSVC Compatibility mode
Accept some non-standard constructs supported by the Microsoft compiler
Ensure that all functions can be hotpatched at runtime
<arg> must be âsingleâ, âmultipleâ or âvirtualâ.
Specify Visual Studio C runtime library. âstaticâ and âstatic_dbgâ correspond to the cl flags /MT and /MTd which use the multithread, static version. âdllâ and âdll_dbgâ correspond to the cl flags /MD and /MDd which use the multithread, dll version. <arg> must be âstaticâ, âstatic_dbgâ, âdllâ or âdll_dbgâ.
Path to a file that contains a list of mangled names of functions that should be hot-patched for Windows Secure Hot-Patching
List of mangled symbol names of functions that should be hot-patched for Windows Secure Hot-Patching
Volatile loads and stores have acquire and release semantics
Microsoft compiler version number to report in _MSC_VER (0 = donât define it (default))
Specifies the largest alignment guaranteed by â::operator new(size_t)â
Enable treating throwing global C++ operator new as always returning valid memory (annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.
Disable implicit builtin knowledge of a specific function
Do not elide types when printing diagnostics
Disable support for K&R C function declarations
Skip checks for relocated modules when loading PCM files
Do not enforce -fmodules-decluse and private header restrictions for textual headers. This flag will be removed in a future Clang release.
Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes
Synthesize retain and release calls for Objective-C pointers
Use EH-safe code when synthesizing retains and releases in -fobjc-arc
Try to avoid heapifying local blocks
Ignore attribute objc_direct so that direct methods can be tested
Fully encode c++ class template specialization
Enable Objective-C exceptions
Specify the target Objective-C runtime kind and version
Enable ARC-style weak references in Objective-C
Set LTO mode for offload compilation. <arg> must be âthinâ or âfullâ.
Assume that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)
Omit the frame pointer from functions that donât need it. Some stack unwinding cases, such as profilers and sanitizers, may prefer specifying -fno-omit-frame-pointer. On many targets, -O1 and higher omit the frame pointer by default. -m[no-]omit-leaf-frame-pointer takes precedence for leaf functions
Enable OpenACC
Parse OpenMP pragmas and generate parallel code.
Enable all Clang extensions for OpenMP directives and clauses
Force behavior as if the user specified pragma omp requires unified_shared_memory.
Do not create a host fallback if offloading to the device fails.
Emit OpenMP code only for SIMD-based constructs.
Enable debugging in the OpenMP offloading device RTL
Emit code that can be JIT compiled for OpenMP offloading. Implies -foffload-lto=full
Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 51 for Clang
Maximum number of âoperator->âs to call for a member access
Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch <arch> options.
Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)
Specify the default maximum struct packing alignment
Recognize and construct Pascal-style string literals
Load pass plugin from a dynamic shared object file (only with new pass manager).
Generate M NOPs before function entry and N-M NOPs after function entry. If section is specified, use it instead of __patchable_function_entries.
Override the default ABI to return all structs on the stack
Generate code for uses of this PCH that assumes an explicit object file will be built for the PCH
Generate debug info for types in an object file built from this PCH and do not generate them elsewhere
Instantiate templates already while building a PCH
Validate PCH input files based on content if mtime differs
Load the named plugin (dynamic shared object)
Look up implicit modules in the prebuilt module path
Print subprocess statistics
Save subprocess statistics to the given file
Instrument code to produce gcov data files (*.gcda)
Enable continuous instrumentation profiling mode
Instrument only functions from files where names donât match all the regexes separated by a semi-colon
Instrument only functions from files where names match any regex separated by a semi-colon
Partition functions into N groups and select only functions in group i to be instrumented using -fprofile-selected-function-group
Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)
Generate instrumented code to collect coverage info for cold functions into default.profraw file (overridden by â=â form of option or LLVM_PROFILE_FILE env var)
Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)
Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)
Generate instrumented code to collect execution counts into default.profraw file (overridden by â=â form of option or LLVM_PROFILE_FILE env var)
Generate instrumented code to collect execution counts into <file> (overridden by LLVM_PROFILE_FILE env var)
Use instrumentation data for profile-guided optimization
Filename defining the list of functions/files to instrument. The file uses the sanitizer special case list format.
Use the remappings described in <file> to match the profile data against names in the program
profile is accurate, callsites without profile samples are marked as cold. Otherwise, treat callsites without profile samples as if we have no profile
Enable sample-based profile guided optimizations
Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to N-1 inclusive
Set update method of profile counters. <method> must be âatomicâ, âprefer-atomicâ or âsingleâ.
Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
Determines whether the optimizer honors parentheses when floating-point expressions are evaluated
Emit pseudo probes for sample profiling
Enable traps on authentication failures
Enable signing and authentication of block descriptors
Enable signing and authentication of all indirect calls
Enable authentication of pointers from GOT (ELF only)
Enable type discrimination on C function pointers
Enable signing and authentication of indirect goto targets
Enable signing of function pointers in init/fini arrays
Enable address discrimination of function pointers in init/fini arrays
Enable pointer authentication intrinsics
Enable signing and authentication for ObjC class_ro pointers
Enable signing and authentication of Objective-C objectâs âSELâ fields
Enable signing and authentication of Objective-C objectâs âisaâ field
Enable signing and authentication of return addresses
Enable type and address discrimination of vtable pointer of std::type_info
Enable address discrimination of vtable pointers
Enable type discrimination of vtable pointers
Enable raw string literals
Allow division operations to be reassociated
Generate a section named â.GCC.command.lineâ containing the driver command-line. After linking, the section may contain multiple command lines, which will be individually terminated by null bytes. Separate arguments within a command line are combined with spaces; spaces and backslashes within an argument are escaped with backslashes. This format differs from the format of the equivalent section produced by GCC with the -frecord-gcc-switches flag. This option is currently only supported on ELF targets.
Override the default ABI to return small structs in registers
Use atexit or __cxa_atexit to register global destructors
Generate read-only position independent code (ARM only)
On Windows, emit /defaultlib: directives to link compiler-rt libraries (default)
Generate read-write position independent code (ARM only)
Display suggestions to update code associated with -Wunsafe-buffer-usage warnings
blocks caused by sampling, profile inference (profi) can convert basic block counts to branch probabilities to fix them by extended and re-engineered classic MCMF (min-cost max-flow) approach.
Annotate trap blocks in debug info with UBSan trap reasons
Enable detection of uninitialized parameters and return values
Stable ABI instrumentation for sanitizer runtime. Default: Conventional
Generate a YAML optimization record file
Generate an optimization record file in a specific format
Use SEH style exceptions
Enable semantic interposition. Semantic interposition allows for the interposition of a symbol by another at runtime, thus preventing a range of inter-procedural optimisation.
Use separate unique sections for named sections (ELF Only)
Allocate to an enum type only as many bytes as it needs for the declared range of possible values
Force wchar_t to be a short unsigned int
Which overload candidates to show when overload resolution fails. Defaults to âallâ. <arg> must be âbestâ or âallâ.
char is signed
Enable C++14 sized global deallocation functions
Use SjLj style exceptions
Skip ODR checks for decls in the global module fragment.
Enable the superword-level parallelism vectorization passes
Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit)
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
Enables splitting of the LTO unit
Enable late function splitting using profile information (x86 and aarch64 ELF)
Use segmented stack
Instrument stack allocation to prevent stack clash attacks
Enable stack protectors for some functions vulnerable to stack smashing. This uses a loose heuristic which considers functions vulnerable if they contain a char (or 8bit integer) array or constant sized calls to alloca , which are of greater size than ssp-buffer-size (default: 8 bytes). All variable sized calls to alloca are considered vulnerable. A function with a stack protector has a guard value added to the stack frame that is checked on function exit. The guard value must be positioned in the stack frame such that a buffer overflow from a vulnerable variable will overwrite the guard value before overwriting the functionâs return address. The reference stack guard value is stored in a global variable.
Enable stack protectors for all functions
Enable stack protectors for some functions vulnerable to stack smashing. Compared to -fstack-protector, this uses a stronger heuristic that includes functions containing arrays of any size (and any type), as well as any calls to alloca or the taking of an address from a local variable
Emit section containing metadata on function stack sizes
Emit .su file containing information on function stack sizes
Emit full debug info for all types used by the program
Enable optimizations based on strict aliasing rules
Enable optimizations based on the strict definition of an enumâs value range
<n>
is equal to 0, any trailing array member is considered a flexible array.
If <n>
is equal to 1, trailing array members of size 0, 1 or undefined are considered flexible arrays. If <n>
is equal to 2, trailing array members of size 0 or undefined are considered flexible arrays. If <n>
is equal to 3, only trailing array members of undefined size are considered flexible arrays. <n> must be â0â, â1â, â2â or â3â.
Assume that overflowing float-to-int casts are undefined (default)
Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
Control emission of Swift async extended frame info. <option> must be âautoâ, âalwaysâ or âneverâ.
Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit)
Set the maximum depth of recursive template instantiation
Generate instrumented code to collect temporal information
Produce gcov notes files (*.gcno)
Write minimized bitcode to <file> for the ThinLTO thin link only
Path to the ThinLTO distributor process. If specified, ThinLTO backend compilations will be distributed by LLD
Perform ThinLTO importing using provided function summary index
(For new pass manager) âper-passâ: one report for each pass; âper-pass-runâ: one report for each pass invocation. <arg> must be âper-passâ or âper-pass-runâ.
Turn on time profiler. Generates JSON file based on output filename. Results can be analyzed with chrome://tracing or Speedscope App for flamegraph visualization.
Minimum time granularity (in microseconds) traced by time profiler
Make time trace capture verbose event details (e.g. source filenames). This can increase the size of the output by 2-3 times
Similar to -ftime-trace. Specify the JSON file or a directory which will contain the JSON file
<arg> must be âglobal-dynamicâ, âlocal-dynamicâ, âinitial-execâ or âlocal-execâ.
Issue call to specified function rather than a trap instruction
Trap on integer overflow
Specify the function to be called on overflow
Process trigraph sequences
Stop initializing trivial automatic stack variables if var size exceeds the specified number of instances (in bytes)
Stop initializing trivial automatic stack variables after the specified number of instances
Initialize trivial automatic stack variables. Defaults to âuninitializedâ. <arg> must be âuninitializedâ, âzeroâ or âpatternâ.
Use the unified LTO pipeline
Use unique names for basic block sections (ELF Only)
Uniqueify Internal Linkage Symbol Names by appending the MD5 hash of the module path
Specify the source file identifier for -funique-source-file-names; uses the source file path if not specified
Allow the compiler to assume that each translation unit has a unique source file identifier (see -funique-source-file-identifier) at link time
Turn on loop unroller
Allow unsafe floating-point math optimizations which may decrease precision
Use #line in preprocessed output
Compute and store the hash of input files used to build an AST. Files with mismatching mtimeâs are considered valid if both contents is identical
Note: -fveclib={ArmPL,SLEEF,libmvec} implies -fno-math-errno. Note: -fveclib=libmvec on AArch64 requires GLIBC 2.40 or newer. <arg> must be âAccelerateâ, âlibmvecâ, âMASSVâ, âSVMLâ, âSLEEFâ, âDarwin_libsystem_mâ, âArmPLâ, âAMDLIBMâ or ânoneâ.
Enable the loop vectorization passes
Generate verbose assembly output
Enables dead virtual function elimination optimization. Requires -flto=full
The visibility for dllexport definitions. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]. <arg> must be âkeepâ, âhiddenâ, âprotectedâ or âdefaultâ.
The visibility for dllimport external declarations. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]. <arg> must be âkeepâ, âhiddenâ, âprotectedâ or âdefaultâ.
The visibility for external declarations without an explicit DLL storage class. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]. <arg> must be âkeepâ, âhiddenâ, âprotectedâ or âdefaultâ.
Override the visibility of globals based on their final DLL storage class.
Give global C++ operator new and delete declarations hidden visibility
The visibility for global C++ operator new and delete declarations. If âsourceâ is specified the visibility is not adjusted. <arg> must be âforce-defaultâ, âforce-protectedâ, âforce-hiddenâ or âsourceâ.
Give inline C++ member functions hidden visibility by default
When -fvisibility-inlines-hidden is enabled, static variables in inline C++ member functions will also be given hidden visibility by default
Give global types âdefaultâ visibility and global functions and variables âhiddenâ visibility by default
The visibility for definitions without an explicit DLL storage class. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]. <arg> must be âkeepâ, âhiddenâ, âprotectedâ or âdefaultâ.
Set the default symbol visibility for all global definitions. <arg> must be âdefaultâ, âhiddenâ, âinternalâ or âprotectedâ.
Use WebAssembly style exceptions
Enables whole-program vtable optimization. Requires -flto
Generate unwind v2 (epilog) information for x64 Windows. <arg> must be âdisabledâ, âbest-effortâ or ârequiredâ.
Treat signed integer overflow as twoâs complement
Treat pointer overflow as twoâs complement
Store string literals as writable data
Enable IBM XL #pragma pack handling
Always emit __xray_customevent(â¦) calls even if the containing function is not always instrumented
Always emit __xray_typedevent(â¦) calls even if the containing function is not always instrumented
DEPRECATED: Filename defining the whitelist for imbuing the âalways instrumentâ XRay attribute.
Filename defining the list of functions/types for imbuing XRay attributes.
Only instrument 1 of N groups
Donât instrument functions with loops unless they also meet the minimum function size
Sets the minimum function size to instrument with XRay
Generate XRay instrumentation sleds on function entry and exit
Select which XRay instrumentation points to emit. Options: all, none, function-entry, function-exit, function, custom. Default is âallâ. âfunctionâ includes both âfunction-entryâ and âfunction-exitâ.
Link XRay runtime library when -fxray-instrument is specified (default)
List of modes to link in by default into XRay instrumented binaries.
DEPRECATED: Filename defining the whitelist for imbuing the ânever instrumentâ XRay attribute.
When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1
Enable shared library instrumentation with XRay
Clear call-used registers upon function return (AArch64/x86 only). <arg> must be âskipâ, âused-gpr-argâ, âused-gprâ, âused-argâ, âusedâ, âall-gpr-argâ, âall-gprâ, âall-argâ or âallâ.
Accept some non-standard constructs supported by the z/OS compiler
Enable System z vector language extension
Disable precompiled headers, overrides -emit-pch and -include-pch
Warn on language extensions
An ID for compilation unit, which should be the same for the same compilation unit but different for different compilation units. It is used to externalize device-side static variables for single source offloading languages CUDA and HIP so that they can be accessed by the host code of the same compilation unit.
Specify default stream. The default value is âlegacyâ. (CUDA/HIP only). <arg> must be âlegacyâ or âper-threadâ.
Defer host/device related diagnostic messages for CUDA/HIP
Flush denormal floating point values to zero in CUDA/HIP device mode.
Generate relocatable device code, also known as separate compilation mode
Enable sanitizer for supported offloading devices
Template functions or specializations without host, device and global attributes have implicit host device attributes (CUDA/HIP only)
Use LLVM/Offload as portable offloading runtime.
Method to generate IDâs for compilation units for single source offloading languages CUDA and HIP: âhashâ (IDâs generated by hashing file path and command line options) | ârandomâ (IDâs generated as random numbers) | ânoneâ (disabled). Default is âhashâ. This option will be overridden by option â-cuid=[ID]â if it is specified.
Tool used for detecting offloading architectures in the system.
Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). If ânativeâ is used the compiler will detect locally installed architectures. For HIP offloading, the device architecture can be followed by target ID features delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once.
Compress offload device binaries (HIP only)
Only compile for the offloading device.
Compile for both the offloading host and device (default).
Only compile for the offloading host.
Specify the number of threads to use for device offloading tasks during compilation.
Use the new driver for offloading compilation.
Specify a list of target architectures to use for offloading.
OpenCL options¶OpenCL only. Allow denormals to be flushed to zero.
OpenCL only. Enable or disable OpenCL extensions/optional features. The argument is a comma-separated sequence of one or more extension names, each prefixed by â+â or â-â.
OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__.
OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
OpenCL only. Generate kernel argument metadata.
OpenCL only. Allow use of less precise MAD computations in the generated binary.
OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
OpenCL only. Disables all standard includes containing non-native compiler types and functions.
OpenCL only. This option disables all optimizations. By default optimizations are enabled.
OpenCL only. Treat double precision floating-point constant as single precision constant.
OpenCL language standard to compile for. <arg> must be âclâ, âCLâ, âcl1.0â, âCL1.0â, âcl1.1â, âCL1.1â, âcl1.2â, âCL1.2â, âcl2.0â, âCL2.0â, âcl3.0â, âCL3.0â, âclc++â, âCLC++â, âclc++1.0â, âCLC++1.0â, âclc++2021â or âCLC++2021â.
OpenCL only. This option is added for compatibility with OpenCL 1.0.
OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
Namespec of libclc OpenCL bitcode library to link
SYCL options¶Enable SYCL C++ extensions
SYCL language standard to compile for. <arg> must be â2020â, â2017â, â121â, â1.2.1â or âsycl-1.2.1â.
CUDA options¶Manually specify the CUDA feature to use
Include PTX for the following GPU architecture (e.g. sm_35) or âallâ. May be specified more than once.
Enable device-side debug info generation. Disables ptxas optimizations.
Ignore environment variables to detect CUDA installation
CUDA installation path
Use 32-bit pointers for accessing const/local/shared address spaces
Donât error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
Path to ptxas (used for compiling CUDA code)
HIP options¶Allow device side init function in HIP (experimental)
Compile HIP source to relocatable
Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded (HIP device compilation only)
Specify that kernel argument names are preserved (HIP only)
Use new kernel launching API for HIP
Bundle output files of HIP device compilation
Instrument device library for HIP, which is a LLVM bitcode containing __cyg_profile_func_enter and __cyg_profile_func_exit
Default max threads per block for kernel launch bounds for HIP
HIP device library
Link clang-offload-bundler bundles for HIP
HIP runtime installation path, used for finding HIP version and adding HIP include path.
HIP version in the format of major.minor.patch
path to a pass plugin for HIP to SPIR-V passes.
Enable HIP acceleration for standard parallel algorithms
Replace all memory allocation / deallocation calls with hipManagedMalloc / hipFree equivalents
HIP Standard Parallel Algorithm Acceleration library path, used for finding and implicitly including the library header
rocPrim path, required by the HIP Standard Parallel Algorithm Acceleration library, used to implicitly include the rocPrim library
rocThrust path, required by the HIP Standard Parallel Algorithm Acceleration library, used to implicitly include the rocThrust library
Do not link against HIP runtime libraries
ROCm device library path. Alternative to rocm-path.
ROCm installation path, used for finding and automatically linking required bitcode libraries.
HLSL options¶Enables strict availability diagnostic mode for HLSL built-in functions.
Target-dependent compilation options¶Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
Reserve the x1 register (AArch64/RISC-V only)
Reserve the x10 register (AArch64/RISC-V only)
Reserve the x11 register (AArch64/RISC-V only)
Reserve the x12 register (AArch64/RISC-V only)
Reserve the x13 register (AArch64/RISC-V only)
Reserve the x14 register (AArch64/RISC-V only)
Reserve the x15 register (AArch64/RISC-V only)
Reserve the x16 register (AArch64/RISC-V only)
Reserve the x17 register (AArch64/RISC-V only)
Reserve the x18 register (AArch64/RISC-V only)
Reserve the x19 register (AArch64/RISC-V only)
Reserve the x2 register (AArch64/RISC-V only)
Reserve the x20 register (AArch64/RISC-V only)
Reserve the x21 register (AArch64/RISC-V only)
Reserve the x22 register (AArch64/RISC-V only)
Reserve the x23 register (AArch64/RISC-V only)
Reserve the x24 register (AArch64/RISC-V only)
Reserve the x25 register (AArch64/RISC-V only)
Reserve the x26 register (AArch64/RISC-V only)
Reserve the x27 register (AArch64/RISC-V only)
Reserve the x28 register (AArch64/RISC-V only)
Reserve the x29 register (AArch64/RISC-V only)
Reserve the x3 register (AArch64/RISC-V only)
Reserve the x30 register (AArch64/RISC-V only)
Reserve the x31 register (AArch64/RISC-V only)
Reserve the x4 register (AArch64/RISC-V only)
Reserve the x5 register (AArch64/RISC-V only)
Reserve the x6 register (AArch64/RISC-V only)
Reserve the x7 register (AArch64/RISC-V only)
Reserve the x8 register (AArch64/RISC-V only)
Reserve the x9 register (AArch64/RISC-V only)
Set Fuchsia API level
<arg> must be âattâ or âintelâ.
Enable quadword atomics ABI on AIX (AIX PPC64 only). Uses lqarx/stqcx. instructions.
Override the default ABI for 32-bit targets to return all structs in memory, as in the Power 32-bit ABI for Linux (2011), and on AIX and Darwin.
Specify the boundaryâs size to align branches
Specify types of branches to align
Align doubles to two words in structs (x86 only)
Sets the IEEE bit in the expected default floating point mode register. Floating point opcodes that support exception flag gathering quiet and propagate signaling NaN inputs per IEEE 754-2008. This option changes the ABI. (AMDGPU only)
Enable precise memory mode (AMDGPU only)
Enable use of GPR32 in inline assembly for APX
For a list of available architectures for the target use â-mcpu=helpâ
Link as a hybrid ARM64X image
Link stack frames through backchain on System Z
Enforce targets of indirect branches and function returns
Align selected branches (fused, jcc, jmp) within 32-byte boundary
Select label scheme for branch control-flow architecture protection. <arg> must be âunlabeledâ or âfunc-sigâ.
Specify code object ABI version. Defaults to 6. (AMDGPU only). <arg> must be ânoneâ, â4â, â5â or â6â.
Enable emitting complete constructors and destructors as aliases when possible
For a list of available CPUs for the target use â-mcpu=helpâ
Allow use of CRC instructions (ARM/Mips only)
Globally set the denormals-are-zero (DAZ) and flush-to-zero (FTZ) bits in the floating-point control register on program startup
Mapping between default visibility and export. <arg> must be ânoneâ, âexplicitâ or âallâ.
Force double to be <n> bits. <n must be â32â or â64â.
Set EABI type. Default depends on triple). <arg> must be âdefaultâ, â4â, â5â or âgnuâ.
Enable use of experimental RISC-V extensions.
Insert calls to fentry at function entry (x86/SystemZ only)
<arg> must be âsoftâ, âsoftfpâ or âhardâ.
Replace returns with jumps to ``__x86_return_thunk`` (x86 only, error otherwise). <arg> must be âkeepâ or âthunk-externâ.
Generate code which only uses the general purpose registers (AArch64/x86 only)
Enable merging of globals
Enable or disable Control Flow Guard checks and guard tables emission. <arg> must be ânoneâ, âcfâ or âcf-nochecksâ.
Select straight-line speculation hardening scope (ARM/AArch64/X86 only). <arg> must be: all, none, retbr(ARM/AArch64), blr(ARM/AArch64), comdat(ARM/AArch64), nocomdat(ARM/AArch64), return(X86), indirect-jmp(X86)
Use Intel MCU ABI
Not emit the visibility attribute for asm in AIX OS or give all symbols âunspecifiedâ visibility in XCOFF object file
Generate implicit floating point or vector instructions
(integrated-as) Emit an object file which can be used with an incremental linker
Add cs prefix to call and jmp to indirect thunk
Set iOS deployment target
Link builtin bitcodes after the optimization pipeline
Generate branches with extended addressability, usually via indirect jumps.
Enable only control-flow mitigations for Load Value Injection (LVI)
Enable all mitigations for Load Value Injection (LVI)
Set macOS deployment target
Set the default structure layout to be compatible with the Microsoft compiler standard
Disable generation of gather instructions in auto-vectorization(x86 only)
Disable generation of scatter instructions in auto-vectorization(x86 only)
Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.
Omit frame pointer setup for leaf functions
Use packed stack layout (SystemZ only).
Specify maximum number of prefixes to use for padding
Assume data segments are relative to text segment
Specifies preferred vector width for auto-vectorization. Defaults to ânoneâ which allows target specific decisions.
Specify the printf lowering scheme (AMDGPU only), allowed values are âhostcallâ(printing happens during kernel execution, this scheme relies on hostcalls which require system to support pcie atomics) and âbufferedâ(printing happens after all kernel threads exit, this uses a printf buffer and does not rely on pcie atomic support). <arg> must be âhostcallâ or âbufferedâ.
Enable hexagon-qdsp6 backward compatibility
Equivalent to â-mrecip=allâ
Control use of approximate reciprocal and reciprocal square root instructions followed by <n> iterations of Newton-Raphson refinement. <value> = ( [â!â] [âvec-â] (ârcpâ|âsqrtâ) [(âhâ|âsâ|âdâ)] [â:â<n>] ) | âallâ | âdefaultâ | ânoneâ
Generate a __mcount_loc section entry for each __fentry__ call.
Use full register names when writing assembly output
Enable linker relaxation
(integrated-as) Relax all machine instructions
Make StdCall calling convention the default
Specify the size in bits of an RVV vector register. Defaults to the vector length agnostic value of âscalableâ. Accepts power of 2 values between 64 and 65536. Also accepts âzvlâ to use the value implied by -march/-mcpu. The value will be reflected in __riscv_v_fixed_vlen preprocessor define (RISC-V only)
Save arguments passed by registers to ABI-defined stack positions
Force all scalar memory accesses to be aligned (RISC-V only)
Enable speculative execution side effect suppression (SESES). Includes LVI control flow integrity mitigations
Select return address signing scope. <arg> must be ânoneâ, âallâ or ânon-leafâ.
Skip setting up RAX register when passing variable arguments (x86 only)
Use software floating point
Specify that the assembler should encode SSE instructions with VEX prefix
Set the stack alignment
Enable stack probes
Set the stack probe size
Use the given offset for addressing the stack-protector guard
Use the given reg for addressing the stack-protector guard
Use the given symbol for addressing the stack-protector guard
Use the given guard (global, tls) for addressing the stack-protector guard
Force realign the stack at entry to every function
Force all memory accesses to be aligned (AArch64/LoongArch/RISC-V only)
Override the default ABI for 32-bit targets to return small structs in registers, as in the System V ABI (1995).
Set the deployment target to be the specified OS and OS version
The thread model to use. Defaults to âposixâ). <arg> must be âposixâ or âsingleâ.
Which thread-local storage dialect to use for dynamic accesses of TLS variables
Enable direct TLS access through segment registers (default)
Specify bit size of immediate TLS offsets (AArch64 ELF only): 12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)
All suitable variables will have the TOC data transformation applied
Specifies a list of variables to which the TOC data transformation will be applied.
Only supported on AArch64, PowerPC, RISC-V, SPARC, SystemZ, and X86
Allow memory accesses to be unaligned (AArch32/MIPSr6 only)
Expect external char-aligned symbols to be without ABI alignment (SystemZ only)
Force all vector memory accesses to be aligned (RISC-V only)
Specify wavefront size 64 mode (AMDGPU only)
Place constant objects with relocatable address values in the RO data section and add -bforceimprw to the linker flags (AIX only)
Set the z/OS release of the runtime environment
Set __regcall4 as a default calling convention to respect __regcall ABI v.4
Enable the wasm-opt optimizer (default)
AARCH64¶Make the x10 register call-saved (AArch64 only)
Make the x11 register call-saved (AArch64 only)
Make the x12 register call-saved (AArch64 only)
Make the x13 register call-saved (AArch64 only)
Make the x14 register call-saved (AArch64 only)
Make the x15 register call-saved (AArch64 only)
Make the x18 register call-saved (AArch64 only)
Make the x8 register call-saved (AArch64 only)
Make the x9 register call-saved (AArch64 only)
Work around Cortex-A53 erratum 835769 (AArch64 only)
Work around Cortex-A53 erratum 843419 (AArch64 only)
Do not allocate the LR register for general purpose usage, only for calls. (AArch64 only)
Add .note.gnu.property with BTI to assembly files (AArch64 only)
Specify the size in bits of an SVE vector register in streaming mode. Defaults to the vector length agnostic value of âscalableâ. (AArch64 only)
Specify the size in bits of an SVE vector register. Defaults to the vector length agnostic value of âscalableâ. (AArch64 only)
AMDGPU¶Specify CU wavefront execution mode (AMDGPU only)
Enable threadgroup split execution mode (AMDGPU only)
ARM¶Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).
Follow the AAPCS standard requirement stating that volatile bit-field width is dictated by the field container type. (ARM only).
Reserve the r9 register (ARM only)
Allow use of CMSE (Armv8-M Security Extensions)
Disallow generation of data access to code sections (AArch64/ARM only)
Work around VLLDM erratum CVE-2021-35465 (ARM only)
Work around Cortex-A57 Erratum 1742098 (ARM only)
Select the frame chain model used to emit frame records (Arm only). <arg> must be ânoneâ, âaapcsâ or âaapcs+leafâ.
Do not add a BTI instruction after a setjmp or other return-twice construct (Arm/AArch64 only)
Disallow use of movt/movw pairs (ARM only)
Disallow converting instructions with negative immediates to their negation or inversion.
Disallow use of CRC instructions (ARM only)
Disallow generation of complex IT blocks. It is off by default.
Thread pointer access method. For AArch32: âsoftâ uses a function call, or âtpidrurwâ, âtpidruroâ or âtpidrprwâ use the three CP15 registers. âcp15â is an alias for âtpidruroâ. For AArch64: âtpidr_el0â, âtpidr_el1â, âtpidr_el2â, âtpidr_el3â or âtpidrro_el0â use the five system registers. âelNâ is an alias for âtpidr_elNâ. <arg> must be âsoftâ, âcp15â, âtpidrurwâ, âtpidruroâ, âtpidrprwâ, âel0â, âel1â, âel2â, âel3â, âtpidr_el0â, âtpidr_el1â, âtpidr_el2â, âtpidr_el3â, âtpidrro_el0â or âautoâ.
Hexagon¶Enable CABAC instructions
Enable Hexagon HVX IEEE floating-point
Enable generation of memop instructions
Enable generation of new-value jumps
Enable generation of new-value stores
Enable generation of instruction packets
SPARC¶Reserve the G1 register (SPARC only)
Reserve the G2 register (SPARC only)
Reserve the G3 register (SPARC only)
Reserve the G4 register (SPARC only)
Reserve the G5 register (SPARC only)
Reserve the G6 register (SPARC only)
Reserve the G7 register (SPARC only)
Reserve the I0 register (SPARC only)
Reserve the I1 register (SPARC only)
Reserve the I2 register (SPARC only)
Reserve the I3 register (SPARC only)
Reserve the I4 register (SPARC only)
Reserve the I5 register (SPARC only)
Reserve the L0 register (SPARC only)
Reserve the L1 register (SPARC only)
Reserve the L2 register (SPARC only)
Reserve the L3 register (SPARC only)
Reserve the L4 register (SPARC only)
Reserve the L5 register (SPARC only)
Reserve the L6 register (SPARC only)
Reserve the L7 register (SPARC only)
Reserve the O0 register (SPARC only)
Reserve the O1 register (SPARC only)
Reserve the O2 register (SPARC only)
Reserve the O3 register (SPARC only)
Reserve the O4 register (SPARC only)
Reserve the O5 register (SPARC only)
Enable workarounds for GR712RC errata
Enable workarounds for UT700 errata
Enable V8+ mode, allowing use of 64-bit V9 instructions in 32-bit code
Enable Hexagon Vector eXtensions
Set Hexagon Vector Length. <arg> must be â64Bâ or â128Bâ.
Enable Hexagon HVX QFloat instructions
Enable Hexagon Vector eXtensions
M68k¶Reserve the a0 register (M68k only)
Reserve the a1 register (M68k only)
Reserve the a2 register (M68k only)
Reserve the a3 register (M68k only)
Reserve the a4 register (M68k only)
Reserve the a5 register (M68k only)
Reserve the a6 register (M68k only)
Reserve the d0 register (M68k only)
Reserve the d1 register (M68k only)
Reserve the d2 register (M68k only)
Reserve the d3 register (M68k only)
Reserve the d4 register (M68k only)
Reserve the d5 register (M68k only)
Reserve the d6 register (M68k only)
Reserve the d7 register (M68k only)
Enable SVR4-style position-independent code (Mips only)
Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
Use 32-bit floating point registers (MIPS only)
Use 64-bit floating point registers (MIPS only)
Use GP relative accesses for symbols known to be in a small data section (MIPS)
Change indirect jump instructions to inhibit speculation
Extend the -G behaviour to object local data (MIPS)
Enable the generation of 4-operand madd.s, madd.d and related instructions.
Enable MSA ASE (MIPS only)
Enable MT ASE (MIPS only)
For shared library loaded with the main program, change local-dynamic access(es) to initial-exec access(es) at the function level (AIX 64-bit only).
Produce a faster access sequence for local-dynamic TLS variables where the offset from the TLS base is encoded as an immediate operand (AIX 64-bit only). This access sequence is not used for variables larger than 32KB.
Produce a faster access sequence for local-exec TLS variables where the offset from the TLS base is encoded as an immediate operand (AIX 64-bit only). This access sequence is not used for variables larger than 32KB.
Enable AltiVec vector initializer syntax
Control the CR-bit tracking feature on PowerPC. ``-mcrbits`` (the enablement of CR-bit tracking support) is the default for POWER8 and above, as well as for all other CPUs when optimization is applied (-O2 and above).
Select between âcommandâ and âreactorâ executable models. Commands have a main-function which scopes the lifetime of the program. Reactors are activated and remain active until explicitly terminated. <arg> must be âcommandâ or âreactorâ.
X86¶Enable features of APX. <arg> must be âegprâ, âpush2pop2â, âppxâ, ânddâ, âccmpâ, ânfâ, âcfâ or âzuâ.
Enable using library calls for save and restore
VE¶Emit VPU instructions for VE
LoongArch¶Enable annotate table jump instruction to correlate it with the jump table.
Use div.w[u] and mod.w[u] instructions with input not sign-extended.
Enable frecipe.{s/d} and frsqrte.{s/d}
Enable amswap[_db].{b/h} and amadd[_db].{b/h}
Enable amcas[_db].{b/h/w/d}
Enable Loongson Advanced SIMD Extension (LASX).
Do not generate same-address load-load barrier instructions (dbar 0x700)
Enable Loongson SIMD Extension (LSX).
Enable sc.q instruction.
Select the SIMD extension(s) to be enabled in LoongArch either ânoneâ, âlsxâ, âlasxâ.
Long double options¶Selects the long double implementation
Force long double to be 128 bits
Force long double to be 64 bits
Force long double to be 80 bits, padded to 128 bits for storage
Optimization level¶Flags controlling how much optimization should be performed.
Deprecated; use â-O3 -ffast-mathâ for the same behavior, or â-O3â to enable only conforming optimizations
Debug information generation¶Flags controlling how much and what kind of debug information should be generated.
Kind and level of debug information¶Generate source-level debug information
Generate source-level debug information with the default dwarf version
Generate source-level debug information with dwarf version 2
Generate source-level debug information with dwarf version 3
Generate source-level debug information with dwarf version 4
Generate source-level debug information with dwarf version 5
Enables DWARF32 format for ELF binaries, if debug information emission is enabled.
Enables DWARF64 format for ELF binaries, if debug information emission is enabled.
Enable Key Instructions, which reduces the jumpiness of debug stepping in optimized C/C++ code in some debuggers. DWARF only. Implies -g.
Emit debug line info directives only
Emit debug line number tables only
Generate debug info with external references to clang modules or precompiled headers
Debugger to tune debug information for¶Embed source text in DWARF debug sections
Set DWARF fission mode. <arg> must be âsplitâ or âsingleâ.
Restrict DWARF features to those defined in the specified version, avoiding features from later versions.
DWARF debug sections compression type
Static analyzer options¶Flags controlling the behavior of the Clang Static Analyzer.
Pass <arg> to the static analyzer
Fortran compilation options¶Flags that will be passed onto the gfortran
compiler when Clang is given a Fortran input.
Flags that are passed on to the linker
Add directory to library search path
Specify <script> as linker script
Pass the comma separated arguments in <arg> to the linker
Pass <arg> to the linker
Pass <arg> to the offload linkers or the ones identified by -<triple>
Pass <arg> to the ThinLTO distributor process. Can be specified multiple times or with comma-separated values.
Pass -b <arg> to the linker on AIX
On AIX, request creation of a build-id string, â0xHEXSTRINGâ, in the string table of the loader section inside the linked binary
Use the new offloading linker to perform the link job.
undef all system defines
Pass -z <arg> to the linker
clang-dxc options¶dxc compatibility options.
DXIL validator installation path
Root Signature Version. <arg> must be ârootsig_1_0â or ârootsig_1_1â.
Specify the available SPIR-V extensions. If this option is not specified, then all extensions are available.
Specify the target environment. <arg> must be âvulkan1.2â or â vulkan1.3â.
Entry point name for hlsl
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4