From 9d48ebf07bbc676c3198ba528c0f8a729d2569ba Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 24 Jan 2017 19:39:46 +0000 Subject: [docs] Add TableGen-based generator for command line argument documentation, and generate documentation for all (non-hidden) options supported by the 'clang' driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292968 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ClangCommandLineReference.rst | 3286 ++++++++++++++++++++++++++++++++++++ 1 file changed, 3286 insertions(+) create mode 100644 docs/ClangCommandLineReference.rst (limited to 'docs/ClangCommandLineReference.rst') diff --git a/docs/ClangCommandLineReference.rst b/docs/ClangCommandLineReference.rst new file mode 100644 index 0000000000..215b3ab71e --- /dev/null +++ b/docs/ClangCommandLineReference.rst @@ -0,0 +1,3286 @@ +.. + ------------------------------------------------------------------- + NOTE: This file is automatically generated by running clang-tblgen + -gen-opt-docs. Do not edit this file by hand!! + ------------------------------------------------------------------- + +===================================== +Clang command line argument reference +===================================== +.. contents:: + :local: + +Introduction +============ + +This page lists the command line arguments currently supported by the +GCC-compatible ``clang`` and ``clang++`` drivers. + + +.. program:: clang +.. program:: clang0 +.. option:: -A, --assert , --assert= + +.. program:: clang1 +.. option:: -B, --prefix , --prefix= + +.. program:: clang2 +.. option:: -C, --comments + +.. program:: clang3 +.. option:: -CC, --comments-in-macros + +.. program:: clang4 +.. option:: -F + +Add directory to framework include search path + +.. program:: clang5 +.. option:: -G + +.. program:: clang6 +.. option:: -G= + +.. program:: clang7 +.. option:: -H, --trace-includes + +Show header includes and nesting depth + +.. program:: clang8 +.. option:: -Mach + +.. program:: clang9 +.. option:: -ObjC + +Treat source input files as Objective-C inputs + +.. program:: clang10 +.. option:: -ObjC++ + +Treat source input files as Objective-C++ inputs + +.. program:: clang11 +.. option:: -P, --no-line-commands + +Disable linemarker output in -E mode + +.. program:: clang12 +.. option:: -Q + +.. program:: clang13 +.. option:: -Qn + +.. program:: clang14 +.. option:: -Qunused-arguments + +Don't emit warning for unused driver arguments + +.. program:: clang15 +.. option:: -Wa,,... + +Pass the comma separated arguments in to the assembler + +.. program:: clang16 +.. option:: -Wlarge-by-value-copy= + +.. program:: clang17 +.. option:: -Wp,,... + +Pass the comma separated arguments in to the preprocessor + +.. program:: clang18 +.. option:: -X + +.. program:: clang19 +.. option:: -X + +.. program:: clang20 +.. option:: -Xanalyzer + +Pass to the static analyzer + +.. program:: clang21 +.. option:: -Xarch\_ + +.. program:: clang22 +.. option:: -Xassembler + +Pass to the assembler + +.. program:: clang23 +.. option:: -Xcuda-fatbinary + +Pass to fatbinary invocation + +.. program:: clang24 +.. option:: -Xcuda-ptxas + +Pass to the ptxas assembler + +.. program:: clang25 +.. option:: -Xpreprocessor + +Pass to the preprocessor + +.. program:: clang26 +.. option:: -Z + +.. program:: clang27 +.. option:: -a, --profile-blocks + +.. program:: clang28 +.. option:: -all\_load + +.. program:: clang29 +.. option:: -allowable\_client + +.. program:: clang30 +.. option:: --analyze + +Run the static analyzer + +.. program:: clang31 +.. option:: --analyze-auto + +.. program:: clang32 +.. option:: --analyzer-no-default-checks + +.. program:: clang33 +.. option:: --analyzer-output + +Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text). + +.. program:: clang34 +.. option:: -ansi, --ansi + +.. program:: clang35 +.. option:: -arch + +.. program:: clang36 +.. option:: -arch\_errors\_fatal + +.. program:: clang37 +.. option:: -arch\_only + +.. program:: clang38 +.. option:: -arcmt-migrate-emit-errors + +Emit ARC errors even if the migrator can fix them + +.. program:: clang39 +.. option:: -arcmt-migrate-report-output + +Output path for the plist report + +.. program:: clang40 +.. option:: -bind\_at\_load + +.. program:: clang41 +.. option:: -bundle + +.. program:: clang42 +.. option:: -bundle\_loader + +.. program:: clang43 +.. option:: -c, --compile + +Only run preprocess, compile, and assemble steps + +.. program:: clang44 +.. option:: -client\_name + +.. program:: clang45 +.. option:: -compatibility\_version + +.. program:: clang46 +.. option:: --constant-cfstrings + +.. program:: clang47 +.. option:: -coverage, --coverage + +.. program:: clang48 +.. option:: --cuda-compile-host-device + +Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations. + +.. program:: clang49 +.. option:: --cuda-device-only + +Compile CUDA code for device only + +.. program:: clang50 +.. option:: --cuda-gpu-arch=, --no-cuda-gpu-arch= + +CUDA GPU architecture (e.g. sm\_35). May be specified more than once. + +.. program:: clang51 +.. option:: --cuda-host-only + +Compile CUDA code for host only. Has no effect on non-CUDA compilations. + +.. program:: clang52 +.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug + +Enable device-side debug info generation. Disables ptxas optimizations. + +.. program:: clang53 +.. option:: -current\_version + +.. program:: clang54 +.. option:: -dead\_strip + +.. program:: clang55 +.. option:: -dependency-dot + +Filename to write DOT-formatted header dependencies to + +.. program:: clang56 +.. option:: -dependency-file + +Filename (or -) to write dependency output to + +.. program:: clang57 +.. option:: -dumpmachine + +.. program:: clang58 +.. option:: -dumpversion + +.. program:: clang59 +.. option:: --dyld-prefix=, --dyld-prefix + +.. program:: clang60 +.. option:: -dylib\_file + +.. program:: clang61 +.. option:: -dylinker + +.. program:: clang62 +.. option:: -dylinker\_install\_name + +.. program:: clang63 +.. option:: -dynamic + +.. program:: clang64 +.. option:: -dynamiclib + +.. program:: clang65 +.. option:: -emit-ast + +Emit Clang AST files for source inputs + +.. program:: clang66 +.. option:: -exported\_symbols\_list + +.. program:: clang67 +.. option:: -faligned-new= + +.. program:: clang68 +.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals + +Use approximate transcendental functions + +.. program:: clang69 +.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero + +Flush denormal floating point values to zero in CUDA device mode. + +.. program:: clang70 +.. option:: -fheinous-gnu-extensions + +.. program:: clang71 +.. option:: -flat\_namespace + +.. program:: clang72 +.. option:: -fopenmp-targets=,... + +Specify comma-separated list of triples OpenMP offloading targets to be supported + +.. program:: clang73 +.. option:: -force\_cpusubtype\_ALL + +.. program:: clang74 +.. option:: -force\_flat\_namespace + +.. program:: clang75 +.. option:: -force\_load + +.. program:: clang76 +.. option:: -framework + +.. program:: clang77 +.. option:: --gcc-toolchain=, -gcc-toolchain + +Use the gcc toolchain at the given directory + +.. program:: clang78 +.. option:: -gcodeview + +Generate CodeView debug information + +.. program:: clang79 +.. option:: -headerpad\_max\_install\_names + +.. program:: clang80 +.. option:: -help, --help + +Display available options + +.. program:: clang81 +.. option:: --help-hidden + +.. program:: clang82 +.. option:: -image\_base + +.. program:: clang83 +.. option:: -index-header-map + +Make the next included directory (-I or -F) an indexer header map + +.. program:: clang84 +.. option:: -init + +.. program:: clang85 +.. option:: -install\_name + +.. program:: clang86 +.. option:: -keep\_private\_externs + +.. program:: clang87 +.. option:: -lazy\_framework + +.. program:: clang88 +.. option:: -lazy\_library + +.. program:: clang89 +.. option:: -mbig-endian, -EB + +.. program:: clang90 +.. option:: --migrate + +Run the migrator + +.. program:: clang91 +.. option:: -mlinker-version= + +.. program:: clang92 +.. option:: -mlittle-endian, -EL + +.. program:: clang93 +.. option:: -mllvm + +Additional arguments to forward to LLVM's option processing + +.. program:: clang94 +.. option:: -module-dependency-dir + +Directory to dump module dependencies to + +.. program:: clang95 +.. option:: -multi\_module + +.. program:: clang96 +.. option:: -multiply\_defined + +.. program:: clang97 +.. option:: -multiply\_defined\_unused + +.. program:: clang98 +.. option:: --no-cuda-version-check + +Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture. + +.. program:: clang99 +.. option:: -no-integrated-cpp, --no-integrated-cpp + +.. program:: clang100 +.. option:: -no\_dead\_strip\_inits\_and\_terms + +.. program:: clang101 +.. option:: -nobuiltininc + +Disable builtin #include directories + +.. program:: clang102 +.. option:: -nocudainc + +.. program:: clang103 +.. option:: -nocudalib + +.. program:: clang104 +.. option:: -nodefaultlibs + +.. program:: clang105 +.. option:: -nofixprebinding + +.. program:: clang106 +.. option:: -nolibc + +.. program:: clang107 +.. option:: -nomultidefs + +.. program:: clang108 +.. option:: -nopie + +.. program:: clang109 +.. option:: -noprebind + +.. program:: clang110 +.. option:: -noseglinkedit + +.. program:: clang111 +.. option:: -nostartfiles + +.. program:: clang112 +.. option:: -nostdinc, --no-standard-includes + +.. program:: clang113 +.. option:: -nostdinc++ + +Disable standard #include directories for the C++ standard library + +.. program:: clang114 +.. option:: -nostdlib, --no-standard-libraries + +.. program:: clang115 +.. option:: -nostdlibinc + +.. program:: clang116 +.. option:: -o, --output , --output= + +Write output to + +.. program:: clang117 +.. option:: -objcmt-atomic-property + +Make migration to 'atomic' properties + +.. program:: clang118 +.. option:: -objcmt-migrate-all + +Enable migration to modern ObjC + +.. program:: clang119 +.. option:: -objcmt-migrate-annotation + +Enable migration to property and method annotations + +.. program:: clang120 +.. option:: -objcmt-migrate-designated-init + +Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods + +.. program:: clang121 +.. option:: -objcmt-migrate-instancetype + +Enable migration to infer instancetype for method result type + +.. program:: clang122 +.. option:: -objcmt-migrate-literals + +Enable migration to modern ObjC literals + +.. program:: clang123 +.. option:: -objcmt-migrate-ns-macros + +Enable migration to NS\_ENUM/NS\_OPTIONS macros + +.. program:: clang124 +.. option:: -objcmt-migrate-property + +Enable migration to modern ObjC property + +.. program:: clang125 +.. option:: -objcmt-migrate-property-dot-syntax + +Enable migration of setter/getter messages to property-dot syntax + +.. program:: clang126 +.. option:: -objcmt-migrate-protocol-conformance + +Enable migration to add protocol conformance on classes + +.. program:: clang127 +.. option:: -objcmt-migrate-readonly-property + +Enable migration to modern ObjC readonly property + +.. program:: clang128 +.. option:: -objcmt-migrate-readwrite-property + +Enable migration to modern ObjC readwrite property + +.. program:: clang129 +.. option:: -objcmt-migrate-subscripting + +Enable migration to modern ObjC subscripting + +.. program:: clang130 +.. option:: -objcmt-ns-nonatomic-iosonly + +Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute + +.. program:: clang131 +.. option:: -objcmt-returns-innerpointer-property + +Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER + +.. program:: clang132 +.. option:: -objcmt-whitelist-dir-path=, -objcmt-white-list-dir-path= + +Only modify files with a filename contained in the provided directory path + +.. program:: clang133 +.. option:: -object + +.. program:: clang134 +.. option:: -p, --profile + +.. program:: clang135 +.. option:: -pagezero\_size + +.. program:: clang136 +.. option:: -pg + +Enable mcount instrumentation + +.. program:: clang137 +.. option:: -pie + +.. program:: clang138 +.. option:: -pipe, --pipe + +Use pipes between commands, when possible + +.. program:: clang139 +.. option:: -prebind + +.. program:: clang140 +.. option:: -prebind\_all\_twolevel\_modules + +.. program:: clang141 +.. option:: -preload + +.. program:: clang142 +.. option:: --print-diagnostic-categories + +.. program:: clang143 +.. option:: -print-file-name=, --print-file-name=, --print-file-name + +Print the full library path of + +.. program:: clang144 +.. option:: -print-ivar-layout + +Enable Objective-C Ivar layout bitmap print trace + +.. program:: clang145 +.. option:: -print-libgcc-file-name, --print-libgcc-file-name + +Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a") + +.. program:: clang146 +.. option:: -print-multi-directory, --print-multi-directory + +.. program:: clang147 +.. option:: -print-multi-lib, --print-multi-lib + +.. program:: clang148 +.. option:: -print-prog-name=, --print-prog-name=, --print-prog-name + +Print the full program path of + +.. program:: clang149 +.. option:: -print-search-dirs, --print-search-dirs + +Print the paths used for finding libraries and programs + +.. program:: clang150 +.. option:: -private\_bundle + +.. program:: clang151 +.. option:: -pthread, -no-pthread + +Support POSIX threads in generated code + +.. program:: clang152 +.. option:: -pthreads + +.. program:: clang153 +.. option:: -rdynamic + +.. program:: clang154 +.. option:: -read\_only\_relocs + +.. program:: clang155 +.. option:: -relocatable-pch, --relocatable-pch + +Whether to build a relocatable precompiled header + +.. program:: clang156 +.. option:: -remap + +.. program:: clang157 +.. option:: -rewrite-legacy-objc + +Rewrite Legacy Objective-C source to C++ + +.. program:: clang158 +.. option:: -rtlib=, --rtlib=, --rtlib + +Compiler runtime library to use + +.. program:: clang159 +.. option:: -save-stats=, --save-stats=, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd) + +Save llvm statistics. + +.. program:: clang160 +.. option:: -save-temps=, --save-temps=, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd) + +Save intermediate compilation results. + +.. program:: clang161 +.. option:: -sectalign + +.. program:: clang162 +.. option:: -sectcreate + +.. program:: clang163 +.. option:: -sectobjectsymbols + +.. program:: clang164 +.. option:: -sectorder + +.. program:: clang165 +.. option:: -seg1addr + +.. program:: clang166 +.. option:: -seg\_addr\_table + +.. program:: clang167 +.. option:: -seg\_addr\_table\_filename + +.. program:: clang168 +.. option:: -segaddr + +.. program:: clang169 +.. option:: -segcreate + +.. program:: clang170 +.. option:: -seglinkedit + +.. program:: clang171 +.. option:: -segprot + +.. program:: clang172 +.. option:: -segs\_read\_ + +.. program:: clang173 +.. option:: -segs\_read\_only\_addr + +.. program:: clang174 +.. option:: -segs\_read\_write\_addr + +.. program:: clang175 +.. option:: -serialize-diagnostics , --serialize-diagnostics + +Serialize compiler diagnostics to a file + +.. program:: clang176 +.. option:: -shared, --shared + +.. program:: clang177 +.. option:: -shared-libasan + +.. program:: clang178 +.. option:: -shared-libgcc + +.. program:: clang179 +.. option:: -single\_module + +.. program:: clang180 +.. option:: -specs=, --specs= + +.. program:: clang181 +.. option:: -static, --static + +.. program:: clang182 +.. option:: -static-libgcc + +.. program:: clang183 +.. option:: -static-libstdc++ + +.. program:: clang184 +.. option:: -std-default= + +.. program:: clang185 +.. option:: -stdlib=, --stdlib=, --stdlib + +C++ standard library to use + +.. program:: clang186 +.. option:: -sub\_library + +.. program:: clang187 +.. option:: -sub\_umbrella + +.. program:: clang188 +.. option:: --sysroot=, --sysroot + +.. program:: clang189 +.. option:: --target-help + +.. program:: clang190 +.. option:: --target=, -target + +Generate code for the given target + +.. program:: clang191 +.. option:: -time + +Time individual commands + +.. program:: clang192 +.. option:: -traditional, --traditional + +.. program:: clang193 +.. option:: -traditional-cpp, --traditional-cpp + +Enable some traditional CPP emulation + +.. program:: clang194 +.. option:: -twolevel\_namespace + +.. program:: clang195 +.. option:: -twolevel\_namespace\_hints + +.. program:: clang196 +.. option:: -umbrella + +.. program:: clang197 +.. option:: -unexported\_symbols\_list + +.. program:: clang198 +.. option:: -v, --verbose + +Show commands to run and use verbose output + +.. program:: clang199 +.. option:: --verify-debug-info + +Verify the binary representation of debug output + +.. program:: clang200 +.. option:: --version + +.. program:: clang201 +.. option:: -w, --no-warnings + +Suppress all warnings + +.. program:: clang202 +.. option:: -weak-l + +.. program:: clang203 +.. option:: -weak\_framework + +.. program:: clang204 +.. option:: -weak\_library + +.. program:: clang205 +.. option:: -weak\_reference\_mismatches + +.. program:: clang206 +.. option:: -whatsloaded + +.. program:: clang207 +.. option:: -whyload + +.. program:: clang208 +.. option:: -working-directory, -working-directory= + +Resolve file paths relative to the specified directory + +.. program:: clang209 +.. option:: -x, --language , --language= + +Treat subsequent input files as having type + +.. program:: clang210 +.. option:: -y + +Actions +======= +The action to perform on the input. + +.. program:: clang211 +.. option:: -E, --preprocess + +Only run the preprocessor + +.. program:: clang212 +.. option:: -S, --assemble + +Only run preprocess and compilation steps + +.. program:: clang213 +.. option:: -emit-llvm + +Use the LLVM representation for assembler and object files + +.. program:: clang214 +.. option:: -fsyntax-only + +.. program:: clang215 +.. option:: -module-file-info + +Provide information about a particular module file + +.. program:: clang216 +.. option:: --precompile + +Only precompile the input + +.. program:: clang217 +.. option:: -rewrite-objc + +Rewrite Objective-C source to C++ + +.. program:: clang218 +.. option:: -verify-pch + +Load and verify that a pre-compiled header file is not stale + +Compilation flags +================= + +Flags controlling the behavior of Clang during compilation. These flags have +no effect during actions that do not perform compilation. + +.. program:: clang219 +.. option:: -D, --define-macro , --define-macro= + +.. program:: clang220 +.. option:: -U, --undefine-macro , --undefine-macro= + +.. program:: clang221 +.. option:: -Xclang + +Pass to the clang compiler + +.. program:: clang222 +.. option:: -fcomment-block-commands=,... + +Treat each comma separated argument in as a documentation comment block command + +.. program:: clang223 +.. option:: -fdeclspec, -fno-declspec + +Allow \_\_declspec as a keyword + +.. program:: clang224 +.. option:: -fdepfile-entry= + +.. program:: clang225 +.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info + +.. program:: clang226 +.. option:: -fdiagnostics-format= + +.. program:: clang227 +.. option:: -fdiagnostics-parseable-fixits + +Print fix-its in machine parseable form + +.. program:: clang228 +.. option:: -fdiagnostics-print-source-range-info + +Print source range spans in numeric form + +.. program:: clang229 +.. option:: -fdiagnostics-show-category= + +.. program:: clang230 +.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager + +Enables an experimental new pass manager in LLVM. + +.. program:: clang231 +.. option:: -finline-functions, -fno-inline-functions + +Inline suitable functions + +.. program:: clang232 +.. option:: -finline-hint-functions + +Inline functions which are (explicitly or implicitly) marked inline + +.. program:: clang233 +.. option:: -fno-crash-diagnostics + +.. program:: clang234 +.. option:: -fno-sanitize-blacklist + +Don't use blacklist file for sanitizers + +.. program:: clang235 +.. option:: -fparse-all-comments + +.. program:: clang236 +.. option:: -fsanitize-address-field-padding= + +Level of field padding for AddressSanitizer + +.. program:: clang237 +.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope + +Enable use-after-scope detection in AddressSanitizer + +.. program:: clang238 +.. option:: -fsanitize-blacklist= + +Path to blacklist file for sanitizers + +.. program:: clang239 +.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso + +Enable control flow integrity (CFI) checks for cross-DSO calls. + +.. program:: clang240 +.. option:: -fsanitize-coverage=,..., -fno-sanitize-coverage=,... + +Specify the type of coverage instrumentation for Sanitizers + +.. program:: clang241 +.. option:: -fsanitize-link-c++-runtime + +.. program:: clang242 +.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins + +Enable origins tracking in MemorySanitizer + +.. program:: clang243 +.. option:: -fsanitize-memory-track-origins= + +Enable origins tracking in MemorySanitizer + +.. program:: clang244 +.. option:: -fsanitize-memory-use-after-dtor + +Enable use-after-destroy detection in MemorySanitizer + +.. program:: clang245 +.. option:: -fsanitize-recover, -fno-sanitize-recover + +.. program:: clang246 +.. option:: -fsanitize-recover=,..., -fno-sanitize-recover=,... + +Enable recovery for specified sanitizers + +.. program:: clang247 +.. option:: -fsanitize-stats, -fno-sanitize-stats + +Enable sanitizer statistics gathering. + +.. program:: clang248 +.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics + +Enable atomic operations instrumentation in ThreadSanitizer (default) + +.. program:: clang249 +.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit + +Enable function entry/exit instrumentation in ThreadSanitizer (default) + +.. program:: clang250 +.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access + +Enable memory access instrumentation in ThreadSanitizer (default) + +.. program:: clang251 +.. option:: -fsanitize-trap=,..., -fno-sanitize-trap=,... + +Enable trapping for specified sanitizers + +.. program:: clang252 +.. option:: -fsanitize-undefined-strip-path-components= + +Strip (or keep only, if negative) a given number of path components when emitting check metadata. + +.. program:: clang253 +.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error + +.. program:: clang254 +.. option:: -fsanitize=,..., -fno-sanitize=,... + +Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks + +.. program:: clang255 +.. option:: --param , --param= + +.. program:: clang256 +.. option:: -std=, --std=, --std + +Language standard to compile for + +Include path management +~~~~~~~~~~~~~~~~~~~~~~~ + +Flags controlling how ``#include``\s are resolved to files. + +.. program:: clang257 +.. option:: -I, --include-directory , --include-directory= + +Add directory to include search path + +.. program:: clang258 +.. option:: -I-, --include-barrier + +.. program:: clang259 +.. option:: --cuda-path= + +CUDA installation path + +.. program:: clang260 +.. option:: -cxx-isystem + +Add directory to the C++ SYSTEM include search path + +.. program:: clang261 +.. option:: -fbuild-session-file= + +Use the last modification time of as the build session timestamp + +.. program:: clang262 +.. option:: -fbuild-session-timestamp=