From 9e0150bf562dfaaf59b71636a59c084c030183de Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 27 Jan 2017 02:08:37 +0000 Subject: [docs] Add help text and refine grouping for various options. Also accept -G= (and -msmall-data-threshold=) as an alias for -G on MIPS as well as Hexagon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293254 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ClangCommandLineReference.rst | 248 +++++++++++++++++++------------------ 1 file changed, 129 insertions(+), 119 deletions(-) (limited to 'docs/ClangCommandLineReference.rst') diff --git a/docs/ClangCommandLineReference.rst b/docs/ClangCommandLineReference.rst index e39d983954..7d4cc5d2c1 100644 --- a/docs/ClangCommandLineReference.rst +++ b/docs/ClangCommandLineReference.rst @@ -18,30 +18,14 @@ GCC-compatible ``clang`` and ``clang++`` drivers. .. program:: clang -.. option:: -A, --assert , --assert= - -.. option:: -B, --prefix , --prefix= +.. option:: -B, --prefix , --prefix= -.. option:: -C, --comments - -.. option:: -CC, --comments-in-macros +Add to search path for binaries and object files used implicitly .. option:: -F Add directory to framework include search path -.. option:: -G - -.. program:: clang1 -.. option:: -G= -.. program:: clang - -.. option:: -H, --trace-includes - -Show header includes and nesting depth - -.. option:: -Mach - .. option:: -ObjC Treat source input files as Objective-C inputs @@ -52,14 +36,6 @@ Treat source input files as Objective-C inputs Treat source input files as Objective-C++ inputs -.. option:: -P, --no-line-commands - -Disable linemarker output in -E mode - -.. option:: -Q - -.. option:: -Qn - .. option:: -Qunused-arguments Don't emit warning for unused driver arguments @@ -70,26 +46,8 @@ Pass the comma separated arguments in to the assembler .. option:: -Wlarge-by-value-copy= -.. option:: -Wp,,... - -Pass the comma separated arguments in to the preprocessor - -.. option:: -X - -.. program:: clang1 -.. option:: -X -.. program:: clang - -.. option:: -Xanalyzer - -Pass to the static analyzer - .. option:: -Xarch\_ -.. option:: -Xassembler - -Pass to the assembler - .. option:: -Xcuda-fatbinary Pass to fatbinary invocation @@ -98,10 +56,6 @@ Pass to fatbinary invocation Pass to the ptxas assembler -.. option:: -Xpreprocessor - -Pass to the preprocessor - .. option:: -Z .. option:: -a, --profile-blocks @@ -150,10 +104,6 @@ Output path for the plist report .. option:: -bundle\_loader .. program:: clang -.. option:: -c, --compile - -Only run preprocess, compile, and assemble steps - .. option:: -client\_name .. option:: -compatibility\_version @@ -650,6 +600,10 @@ Only run the preprocessor Only run preprocess and compilation steps +.. option:: -c, --compile + +Only run preprocess, compile, and assemble steps + .. option:: -emit-llvm Use the LLVM representation for assembler and object files @@ -678,9 +632,9 @@ Compilation flags Flags controlling the behavior of Clang during compilation. These flags have no effect during actions that do not perform compilation. -.. option:: -D, --define-macro , --define-macro= +.. option:: -Xassembler -.. option:: -U, --undefine-macro , --undefine-macro= +Pass to the assembler .. option:: -Xclang @@ -810,17 +764,56 @@ Turn on runtime checks for various forms of undefined or suspicious behavior. Se Language standard to compile for +Preprocessor flags +~~~~~~~~~~~~~~~~~~ + +Flags controlling the behavior of the Clang preprocessor. + +.. option:: -C, --comments + +Include comments in preprocessed output + +.. option:: -CC, --comments-in-macros + +Include comments from within macros in preprocessed output + +.. option:: -D=, --define-macro , --define-macro= + +Define to (or 1 if omitted) + +.. option:: -H, --trace-includes + +Show header includes and nesting depth + +.. option:: -P, --no-line-commands + +Disable linemarker output in -E mode + +.. option:: -U, --undefine-macro , --undefine-macro= + +Undefine macro + +.. option:: -Wp,,... + +Pass the comma separated arguments in to the preprocessor + +.. option:: -Xpreprocessor + +Pass to the preprocessor + Include path management -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- Flags controlling how ``#include``\s are resolved to files. -.. option:: -I, --include-directory , --include-directory= +.. option:: -I, --include-directory , --include-directory= Add directory to include search path .. option:: -I-, --include-barrier +Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path + .. option:: --cuda-path= CUDA installation path @@ -936,7 +929,7 @@ Path to ptxas (used for compiling CUDA code) Treat all #include paths starting with as including a system header. Dependency file generation -~~~~~~~~~~~~~~~~~~~~~~~~~~ +-------------------------- Flags controlling generation of a dependency file for ``make``-like build systems. @@ -986,7 +979,7 @@ 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. @@ -1036,18 +1029,12 @@ Report transformations performed by optimization passes whose name matches the g Enable the specified warning -.. option:: -WCL4 - -.. option:: -Wall, --all-warnings - .. option:: -Wdeprecated, -Wno-deprecated -.. option:: -Wextra +Enable warnings for deprecated constructs and define \_\_DEPRECATED .. option:: -Wnonportable-cfstrings, -Wno-nonportable-cfstrings -.. option:: -Wwrite-strings, -Wno-write-strings - Target-independent compilation options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. option:: -Wframe-larger-than= @@ -1852,6 +1839,10 @@ OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-sig Target-dependent compilation options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. option:: -G, -G=, -msmall-data-threshold= + +Put objects of at most bytes into small data section (MIPS / Hexagon) + .. option:: -m16 .. option:: -m32 @@ -1998,8 +1989,6 @@ Make StdCall calling convention the default .. option:: -msingle-float -.. option:: -msmall-data-threshold= - .. option:: -msoft-float, -mno-soft-float Use software floating point @@ -2245,10 +2234,6 @@ Flags controlling how much optimization should be performed. .. option:: -O, -O (equivalent to -O2), --optimize, --optimize= -.. option:: -O0 - -.. option:: -O4 - .. option:: -Ofast Debug information generation @@ -2329,57 +2314,14 @@ Debug information flags .. option:: -gstrict-dwarf, -gno-strict-dwarf -Linker flags -============ -Flags that are passed on to the linker - -.. option:: -L, --library-directory , --library-directory= - -.. option:: -T - -.. option:: -Tbss +Static analyzer flags +===================== -.. option:: -Tdata +Flags controlling the behavior of the Clang Static Analyzer. -.. option:: -Ttext - -.. option:: -Wl,,... - -Pass the comma separated arguments in to the linker - -.. option:: -Xlinker , --for-linker , --for-linker= - -Pass to the linker - -.. program:: clang1 -.. option:: -Z -.. program:: clang - -.. option:: -e, --entry - -.. option:: -filelist - -.. option:: -l - -.. option:: -r - -.. option:: -rpath - -.. option:: -s - -.. option:: -t - -.. option:: -u, --force-link , --force-link= - -.. option:: -undef - -undef all system defines - -.. option:: -undefined, --no-undefined - -.. option:: -z +.. option:: -Xanalyzer -Pass -z to the linker +Pass to the static analyzer Fortran compilation flags ========================= @@ -2387,6 +2329,8 @@ Fortran compilation flags Flags that will be passed onto the ``gfortran`` compiler when Clang is given a Fortran input. +.. option:: -A, --assert , --assert= + .. option:: -A- .. option:: -J @@ -2521,3 +2465,69 @@ a Fortran input. .. option:: -static-libgfortran +Linker flags +============ +Flags that are passed on to the linker + +.. option:: -L, --library-directory , --library-directory= + +Add directory to library search path + +.. option:: -Mach + +.. option:: -T