GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing clang.llvm.org — Clang command line argument reference - Clang Clang command line argument reference#Introduction#This page lists the command line arguments currently supported by the
GCC-compatible
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
Specifies that the argument should only be used if the compilation
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,
Pass <arg> to device compilation in the offloading toolchain
Pass <arg> to host compilation in the offloading toolchain
Pass <arg> to fatbinary invocation
Pass <arg> to the ptxas assembler
Pass <arg> to the static library tool
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
ClangIR: Enable Idiom Recognizer pass
Specify configuration file
C standard library to use. <arg> must be ‘newlib’, ‘picolibc’, ‘llvm-libc’ or ‘system’.
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.
Enable Dynamic Debugging, which allows runtime switching between optimized and unoptimized code in debuggers that support it. Specified optimization level affects only the optimized code. This flag inhibits interprocedural optimizations.
Allow floating-point optimizations that assume arguments and results are not NaNs or +-inf. This defines the \_\_FINITE\MATH\ONLY\\ preprocessor macro.
Time to wait on an implicit module lock before timing out
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
Select hash algorithm for KCFI type IDs (xxHash64, FNV-1a). <arg> must be ‘xxHash64’ or ‘FNV-1a’.
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’.
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.
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
Disable xcselect SDK injection on macOS
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 the C++ standard library selected by the driver
Print the C++ standard library include directories selected by the driver
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
The directory which holds the compiler resource files
Rewrite Legacy Objective-C source to C++
Compiler runtime library to use
Compiler-debugging/testing option to save the intermediate states of dynamic debugging in the same directory as the final output file
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
Set static library member metadata to fixed values so that identical inputs produce identical output (default)
Restrict the static library to the target architecture, ignoring other architectures present in universal inputs (Darwin only)
Warn about static library members that define no symbols
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>
Actions#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
Only precompile the input as a reduced BMI
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>
Put crash-report tarball at <path>
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
Retain documentation comments in the AST even when no diagnostic or language option would otherwise require them (e.g. for tools that query comments after parsing)
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
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
Enable extended coverage to custom allocation functions
Use the AllocToken fast ABI
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
Enable handlers with preserve_all calling convention
Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.
Enable aliasing mode in HWAddressSanitizer
Prevents
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)
Use infinite loops in trapping mode
Enable trapping for specified sanitizers
Always generate function calls for type sanitizer instrumentation
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
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
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
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
Treat an implicitly built module as out of date if a directory it depends on the listing of, such as an umbrella directory, changed after it was built
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
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#
Enable C/C++ library based optimizations (with options). <arg> must be ‘all’.
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
Limit to maximum N allocation tokens (0 = target SIZE_MAX)
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
Run the ClangIR calling-convention lowering pass (x86_64 only)
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’.
Enable compile-time constant NSArray literals
Enable compile-time constant NSDictionary literals
Enable compile-time constant NSNumber literals
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 (0 = no limit)
Enable copy profiling
Minimum C++ object size in bytes to enable CopyProf instrumentation (default: 16).
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
Record the sysroot path in debug info as DW_AT_LLVM_sysroot and in DW_AT_LLVM_include_path (used by LLDB to locate the SDK for Clang module imports).
Place debug types in their own section (ELF Only)
Enable support for the C ‘_Defer’ Technical Specification
Enable predefined target OS macros
When subtracting two pointers, do not assume that the byte difference is an exact multiple of the pointee type size, thereby preventing such subtraction from resulting in undefined behavior. Users should prefer casting pointers to
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.
Log the timing of dependency scanning actions to <file>. Only takes effect while running the dependency scanner.
Enables speculative devirtualization optimization.
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
Show inlining chain notes for [[gnu::warning/error]] diagnostics
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’, ‘dwarf-only’ or ‘default’.
Use Emscripten JavaScript-based C++ exceptions
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’.
Allow the use of the [[clang::pointer_field_protection]] attribute
Emit a call graph section
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
EnableEnable the loop fusion pass
Overrides the _OPENACC macro value for experimental testing during OpenACC support development
Enable pointer field protection on all non-standard layout struct types
Use pointer identity (tag) to discriminate pointers of non-trivially-copyable types
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
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
Keep inline functions whose definition is owned by this translation unit, even if they are inlined into all callers.
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’.
When enabled, mark an object dead after its destructor returns which allows the the optimizer to perform more aggressive optimizations in some cases, particularly dead store elimination.
Enable lifetime safety analysis for C
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
Sets the matrix memory layout (row-major or column-major). <arg> must be ‘row-major’ or ‘column-major’.
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 (MemPGO)
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.
Include module files in dependency output. <arg> must be ‘none’, ‘all’ or ‘direct’.
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.
Mark inline functions and template instantiations defined in the main source file as likely_module_local
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
Enable support for driver managed module builds (experimental)
Ignore the definition of the given macro when building and loading modules
Ignore the given header search path 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 Microsoft anonymous struct/union extension.
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))
Enable support for named loops
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
Do not enforce -fmodules-decluse and private header restrictions for textual headers. This flag will be removed in a future Clang release.
Disable optimizations based on bool bit patterns never being anything other than 0 or 1, specifying a conversion behavior. <arg> must be ‘truncate’ or ‘nonzero’.
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
Enable compile-time constant ObjC literals
Move precondition checks for direct methods into thunks
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.
Use atomic operations for OpenMP GPU cross-team reductions where supported
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
Enable partition static data sections using MemPGO profiles with fall back to PGO (x86 and aarch64 ELF). See LLVM MemPGO doc for usage.
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
preferred alignment for functions
Print subprocess statistics
Save subprocess statistics to the given file
Use absolute paths in gcov notes files (*.gcno)
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
Specifies that the sample profile is accurate. If the sample 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
Apply the same vtable pointer discrimination scheme to VTT entries as to object 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.
Enable C++26 reflection
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
Infer block and edge counts. If the profiles have errors or missing 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.
Set how trap reasons are emitted.
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 bool bit patterns never being anything other than 0 or 1
Enable optimizations based on the strict definition of an enum’s value range
If
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.
Compress -ftime-trace output with the specified algorithm. <arg> must be ‘none’, ‘zstd’ or ‘infer’.
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
Use the given vector functions library. 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
Sets the mechanism to use for Control Flow Guard on Windows. <arg> must be ‘automatic’, ‘dispatch’ or ‘check’.
Set x64 Windows unwind info version. <arg> must be ‘v1’, ‘v2-best-effort’, ‘v2-required’ or ‘v3’.
(Legacy) 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/RISC-V/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
Common Offloading options#
Emit the NVCC-compatible host registration ABI for CUDA.
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. Can be a positive integer or the string ‘jobserver’ to use the make-style jobserver from the environment.
Deprecated; the new driver is always used 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
Select the granularity at which SYCL device code is grouped into device images: kernel (one device image per kernel) | translation_unit (one device image per translation unit) | link_unit (one device image per linking unit). Default is ‘translation_unit’. <arg> must be ‘kernel’, ‘translation_unit’ or ‘link_unit’.
Do not link the SYCL runtime library
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 MIPS GPR 1 register (MIPS only)
Reserve the MIPS GPR 10 register (MIPS only)
Reserve the MIPS GPR 11 register (MIPS only)
Reserve the MIPS GPR 12 register (MIPS only)
Reserve the MIPS GPR 13 register (MIPS only)
Reserve the MIPS GPR 14 register (MIPS only)
Reserve the MIPS GPR 15 register (MIPS only)
Reserve the MIPS GPR 16 register (MIPS only)
Reserve the MIPS GPR 17 register (MIPS only)
Reserve the MIPS GPR 18 register (MIPS only)
Reserve the MIPS GPR 19 register (MIPS only)
Reserve the MIPS GPR 2 register (MIPS only)
Reserve the MIPS GPR 20 register (MIPS only)
Reserve the MIPS GPR 21 register (MIPS only)
Reserve the MIPS GPR 22 register (MIPS only)
Reserve the MIPS GPR 23 register (MIPS only)
Reserve the MIPS GPR 24 register (MIPS only)
Reserve the MIPS GPR 25 register (MIPS only)
Reserve the MIPS GPR 26 register (MIPS only)
Reserve the MIPS GPR 27 register (MIPS only)
Reserve the MIPS GPR 28 register (MIPS only)
Reserve the MIPS GPR 29 register (MIPS only)
Reserve the MIPS GPR 3 register (MIPS only)
Reserve the MIPS GPR 30 register (MIPS only)
Reserve the MIPS GPR 31 register (MIPS only)
Reserve the MIPS GPR 4 register (MIPS only)
Reserve the MIPS GPR 5 register (MIPS only)
Reserve the MIPS GPR 6 register (MIPS only)
Reserve the MIPS GPR 7 register (MIPS only)
Reserve the MIPS GPR 8 register (MIPS only)
Reserve the MIPS GPR 9 register (MIPS only)
Reserve the edi register (x86 only)
Reserve the r10 register (Hexagon/x86_64 only)
Reserve the r11 register (Hexagon/x86_64 only)
Reserve the r12 register (Hexagon/x86_64 only)
Reserve the r13 register (Hexagon/x86_64 only)
Reserve the r14 register (Hexagon/x86_64 only)
Reserve the r15 register (Hexagon/x86_64 only)
Reserve the r16 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r17 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r18 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve register r19 (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r20 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r21 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r22 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r23 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r24 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r25 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r26 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r27 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r28 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r29 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r30 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve the r31 register (Hexagon/x86_64 only; x86_64 requires APX EGPR)
Reserve register r6 (Hexagon only)
Reserve register r7 (Hexagon only)
Reserve the r8 register (Hexagon/x86_64 only)
Reserve the r9 register (ARM/Hexagon/x86_64 only)
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 (RISC-V only)
Reserve the x17 register (RISC-V only)
Reserve the x18 register (AArch64/RISC-V only)
Reserve the x19 register (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 (RISC-V only)
Reserve the x3 register (AArch64/RISC-V only)
Reserve the x30 register (RISC-V only)
Reserve the x31 register (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 (RISC-V only)
Reserve the x9 register (AArch64/RISC-V only)
Set Fuchsia API level
<arg> must be ‘att’ or ‘intel’.
Use the given macro name when suggesting lifetimebound attributes
Skip LifetimeSafety analysis for functions with CFG block count exceeding this threshold. Specify 0 for no limit.
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.
Use ._ptrgl routine for indirect calls (AIX only)
Specify the boundary’s size to align branches
Specify types of branches to align
Align doubles to two words in structs (x86 only)
Expand s_waitcnt instructions to help PC-sampling profilers identify memory stalls. Instead of a single waitcnt(target), emits waitcnt(N-1), waitcnt(N-2), …, waitcnt(target). (AMDGPU 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’
Build as a hybrid ARM64X object/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.
Enable experimental syntax for the ‘-mtune’ flag (RISC-V only)
Insert calls to fentry at function entry (x86/SystemZ only)
<arg> must be ‘soft’, ‘softfp’ or ‘hard’.
Replace returns with jumps to
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 the return address authentication hardening scheme. <arg> must be ‘none’ or ‘load-return-address’.
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
Enable function outlining (AArch64,Arm,RISC-V,X86 only)
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
Reserve the frame pointer register even if the function doesn’t have a frame
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)
Register holding the shadow call stack pointer: one of the callee-saved registers r16-r27, default r18 (Hexagon only). The chosen register must also be reserved with -ffixed-<reg>.
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
Enable SRAMECC (AMDGPU only)
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
Generate a __stack_protector_loc section entry for each load of the stack-protector guard address.
Use the given reg for addressing the stack-protector guard
Use the given symbol for addressing the stack-protector guard
Set the width of the stack-protector guard variable. By default, the width is the same as the pointer width. Currently only supported on AArch64 targets. Only the values “4” and “8” are currently supported. This currently only modifies the size of accesses to the global variable, not the value stored on the stack.
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)
Enable XNACK (AMDGPU only)
Force all Zilsd/Zclsd memory accesses to be 8-byte aligned (RISC-V only)
Allow Zilsd/Zclsd memory accesses to be 4-byte aligned (RISC-V only)
Emit the function name in PPA1 on z/OS
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).
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 eLementwise eXtensions
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
Hexagon HVX#
Enable Hexagon Vector eXtensions
Set Hexagon Vector Length. <arg> must be ‘64B’ or ‘128B’.
Enable Hexagon HVX QFloat instructions
Enable Hexagon HVX QFloat instructions with mode: strict-ieee, ieee, lossy, legacy (v79+)
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)
MIPS#
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)
Enable R5900 short loop erratum fix
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)
PowerPC#
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.
WebAssembly#
WebAssembly Driver#
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’, ‘zu’ or ‘jmpabs’.
RISC-V#
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 Sanitizer Coverage options#
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 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 CodeView 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
Generate source-level debug information with DWARF version 6
Enables DWARF32 format for ELF binaries, if debug information emission is enabled.
Enables DWARF64 format for ELF binaries, if debug information emission is enabled.
Debug level#
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#
Debug information options#
Call site debug info enables various debugger features including detecting tail calls for display in backtraces and displaying some source variable values that reference the call entry value.
Emit compiler path and command line into CodeView debug information
Emit current working directory into CodeView debug information
Emit type record hashes in a .debug$H section
Embed source text in DWARF debug sections
Enable Key Instructions, which reduces the jumpiness of debug stepping in optimized C/C++ code in some debuggers. DWARF only.
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.
On some ABIs (e.g., Itanium), constructors and destructors may have multiple variants. Historically, when generating DWARF, Clang did not attach Enabling this flag results in a better interactive debugging experience (both GDB and LLDB have support for understanding these “unified” linkage names). However, it comes with a significant increase in debug-info size (particularly the
DWARF debug sections compression type Static analyzer options#Flags controlling the behavior of the Clang Static Analyzer.
Pass <arg> to the static analyzer SSAF options#Flags controlling the behavior of the Scalable Static Analysis Framework (SSAF).
Stable identifier used as the CompilationUnit namespace name of every produced SSAF TU summary. Required when ‘–ssaf-tu-summary-file=’ is set.
Comma-separated list of summary names to extract
Path to the WPASuite file containing the whole-program analysis result consumed by the source transformation. The extension selects which file format to use.
Include block-scope (function-local) declarations in extracted SSAF summaries. By default they are omitted.
Stable identifier of the link unit that this compilation unit was linked into.
Display the list of available SSAF summary extractors
Display the list of available SSAF serialization formats
Skip declarations in system headers during SSAF summary extraction
Name of the SSAF source transformation to run. Exactly one transformation per invocation.
Output file for the source edits produced by the source transformation. The output is a YAML document compatible with ‘clang-apply-replacements’.
Output file for the transformation report produced by the source transformation. The output is a SARIF JSON document.
The output file for the extracted summaries. The extension selects which file format to use. Fortran compilation options#Flags that will be passed onto the
Linker options#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 compilers or the ones identified by -<triple>
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
Override entry function root signature with root signature at given macro name.
Root Signature Version. <arg> must be ‘rootsig_1_0’, ‘rootsig_1_1’ or ‘rootsig_1_2’.
Select the packing mode for HLSL semantic signatures (default: prefix-stable). <arg> must be ‘prefix-stable’ or ‘optimized’.
Specify the available SPIR-V extensions. If this option is not specified, then all extensions are available. If KHR is specified, then all KHR extensions will be available. If DXC is specifided, then all extensions implemented by the DirectX Shader compiler will be available. This option is useful for moving from DXC to Clang.
Specify the target environment. <arg> must be ‘vulkan1.2’ or ‘ vulkan1.3’.
Enables agressive flattening
Entry point name for hlsl
SPIRV validator installation path |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |