1f4a2713aSLionel Sambuc=pod 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc=head1 NAME 4f4a2713aSLionel Sambuc 5f4a2713aSLionel Sambucclang - the Clang C, C++, and Objective-C compiler 6f4a2713aSLionel Sambuc 7f4a2713aSLionel Sambuc=head1 SYNOPSIS 8f4a2713aSLionel Sambuc 9f4a2713aSLionel SambucB<clang> [B<-c>|B<-S>|B<-E>] B<-std=>I<standard> B<-g> 10f4a2713aSLionel Sambuc [B<-O0>|B<-O1>|B<-O2>|B<-O3>|B<-Ofast>|B<-Os>|B<-Oz>|B<-O>|B<-O4>] 11f4a2713aSLionel Sambuc B<-W>I<warnings...> B<-pedantic> 12f4a2713aSLionel Sambuc B<-I>I<dir...> B<-L>I<dir...> 13f4a2713aSLionel Sambuc B<-D>I<macro[=defn]> 14f4a2713aSLionel Sambuc B<-f>I<feature-option...> 15f4a2713aSLionel Sambuc B<-m>I<machine-option...> 16f4a2713aSLionel Sambuc B<-o> I<output-file> 17f4a2713aSLionel Sambuc B<-stdlib=>I<library> 18f4a2713aSLionel Sambuc I<input-filenames> 19f4a2713aSLionel Sambuc 20f4a2713aSLionel Sambuc=head1 DESCRIPTION 21f4a2713aSLionel Sambuc 22f4a2713aSLionel SambucB<clang> is a C, C++, and Objective-C compiler which encompasses preprocessing, 23f4a2713aSLionel Sambucparsing, optimization, code generation, assembly, and linking. Depending on 24f4a2713aSLionel Sambucwhich high-level mode setting is passed, Clang will stop before doing a full 25f4a2713aSLionel Sambuclink. While Clang is highly integrated, it is important to understand the 26f4a2713aSLionel Sambucstages of compilation, to understand how to invoke it. These stages are: 27f4a2713aSLionel Sambuc 28f4a2713aSLionel Sambuc=over 29f4a2713aSLionel Sambuc 30f4a2713aSLionel Sambuc=item B<Driver> 31f4a2713aSLionel Sambuc 32f4a2713aSLionel SambucThe B<clang> executable is actually a small driver which controls the overall 33f4a2713aSLionel Sambucexecution of other tools such as the compiler, assembler and linker. Typically 34f4a2713aSLionel Sambucyou do not need to interact with the driver, but you transparently use it to run 35f4a2713aSLionel Sambucthe other tools. 36f4a2713aSLionel Sambuc 37f4a2713aSLionel Sambuc=item B<Preprocessing> 38f4a2713aSLionel Sambuc 39f4a2713aSLionel SambucThis stage handles tokenization of the input source file, macro expansion, 40f4a2713aSLionel Sambuc#include expansion and handling of other preprocessor directives. The output of 41f4a2713aSLionel Sambucthis stage is typically called a ".i" (for C), ".ii" (for C++), ".mi" (for 42f4a2713aSLionel SambucObjective-C) , or ".mii" (for Objective-C++) file. 43f4a2713aSLionel Sambuc 44f4a2713aSLionel Sambuc=item B<Parsing and Semantic Analysis> 45f4a2713aSLionel Sambuc 46f4a2713aSLionel SambucThis stage parses the input file, translating preprocessor tokens into a parse 47f4a2713aSLionel Sambuctree. Once in the form of a parser tree, it applies semantic analysis to compute 48f4a2713aSLionel Sambuctypes for expressions as well and determine whether the code is well formed. This 49f4a2713aSLionel Sambucstage is responsible for generating most of the compiler warnings as well as 50f4a2713aSLionel Sambucparse errors. The output of this stage is an "Abstract Syntax Tree" (AST). 51f4a2713aSLionel Sambuc 52f4a2713aSLionel Sambuc=item B<Code Generation and Optimization> 53f4a2713aSLionel Sambuc 54f4a2713aSLionel SambucThis stage translates an AST into low-level intermediate code (known as "LLVM 55f4a2713aSLionel SambucIR") and ultimately to machine code. This phase is responsible for optimizing 56f4a2713aSLionel Sambucthe generated code and handling target-specific code generation. The output of 57f4a2713aSLionel Sambucthis stage is typically called a ".s" file or "assembly" file. 58f4a2713aSLionel Sambuc 59f4a2713aSLionel SambucClang also supports the use of an integrated assembler, in which the code 60f4a2713aSLionel Sambucgenerator produces object files directly. This avoids the overhead of generating 61f4a2713aSLionel Sambucthe ".s" file and of calling the target assembler. 62f4a2713aSLionel Sambuc 63f4a2713aSLionel Sambuc=item B<Assembler> 64f4a2713aSLionel Sambuc 65f4a2713aSLionel SambucThis stage runs the target assembler to translate the output of the compiler 66f4a2713aSLionel Sambucinto a target object file. The output of this stage is typically called a ".o" 67f4a2713aSLionel Sambucfile or "object" file. 68f4a2713aSLionel Sambuc 69f4a2713aSLionel Sambuc=item B<Linker> 70f4a2713aSLionel Sambuc 71f4a2713aSLionel SambucThis stage runs the target linker to merge multiple object files into an 72f4a2713aSLionel Sambucexecutable or dynamic library. The output of this stage is typically called an 73f4a2713aSLionel Sambuc"a.out", ".dylib" or ".so" file. 74f4a2713aSLionel Sambuc 75f4a2713aSLionel Sambuc=back 76f4a2713aSLionel Sambuc 77f4a2713aSLionel SambucThe Clang compiler supports a large number of options to control each of these 78f4a2713aSLionel Sambucstages. In addition to compilation of code, Clang also supports other tools: 79f4a2713aSLionel Sambuc 80f4a2713aSLionel SambucB<Clang Static Analyzer> 81f4a2713aSLionel Sambuc 82f4a2713aSLionel SambucThe Clang Static Analyzer is a tool that scans source code to try to find bugs 83f4a2713aSLionel Sambucthrough code analysis. This tool uses many parts of Clang and is built into the 84f4a2713aSLionel Sambucsame driver. Please see L<http://clang-analyzer.llvm.org> for more details 85f4a2713aSLionel Sambucon how to use the static analyzer. 86f4a2713aSLionel Sambuc 87f4a2713aSLionel Sambuc 88f4a2713aSLionel Sambuc=head1 OPTIONS 89f4a2713aSLionel Sambuc 90f4a2713aSLionel Sambuc=head2 Stage Selection Options 91f4a2713aSLionel Sambuc 92f4a2713aSLionel Sambuc=over 93f4a2713aSLionel Sambuc 94f4a2713aSLionel Sambuc=item B<-E> 95f4a2713aSLionel Sambuc 96f4a2713aSLionel SambucRun the preprocessor stage. 97f4a2713aSLionel Sambuc 98f4a2713aSLionel Sambuc=item B<-fsyntax-only> 99f4a2713aSLionel Sambuc 100f4a2713aSLionel SambucRun the preprocessor, parser and type checking stages. 101f4a2713aSLionel Sambuc 102f4a2713aSLionel Sambuc=item B<-S> 103f4a2713aSLionel Sambuc 104f4a2713aSLionel SambucRun the previous stages as well as LLVM generation and optimization stages and 105f4a2713aSLionel Sambuctarget-specific code generation, producing an assembly file. 106f4a2713aSLionel Sambuc 107f4a2713aSLionel Sambuc=item B<-c> 108f4a2713aSLionel Sambuc 109f4a2713aSLionel SambucRun all of the above, plus the assembler, generating a target ".o" object file. 110f4a2713aSLionel Sambuc 111f4a2713aSLionel Sambuc=item B<no stage selection option> 112f4a2713aSLionel Sambuc 113f4a2713aSLionel SambucIf no stage selection option is specified, all stages above are run, and the 114f4a2713aSLionel Sambuclinker is run to combine the results into an executable or shared library. 115f4a2713aSLionel Sambuc 116f4a2713aSLionel Sambuc=back 117f4a2713aSLionel Sambuc 118f4a2713aSLionel Sambuc 119f4a2713aSLionel Sambuc 120f4a2713aSLionel Sambuc=head2 Language Selection and Mode Options 121f4a2713aSLionel Sambuc 122f4a2713aSLionel Sambuc=over 123f4a2713aSLionel Sambuc 124f4a2713aSLionel Sambuc=item B<-x> I<language> 125f4a2713aSLionel Sambuc 126f4a2713aSLionel SambucTreat subsequent input files as having type I<language>. 127f4a2713aSLionel Sambuc 128f4a2713aSLionel Sambuc=item B<-std>=I<language> 129f4a2713aSLionel Sambuc 130f4a2713aSLionel SambucSpecify the language standard to compile for. 131f4a2713aSLionel Sambuc 132f4a2713aSLionel Sambuc=item B<-stdlib>=I<library> 133f4a2713aSLionel Sambuc 134f4a2713aSLionel SambucSpecify the C++ standard library to use; supported options are libstdc++ and 135f4a2713aSLionel Sambuclibc++. 136f4a2713aSLionel Sambuc 137f4a2713aSLionel Sambuc=item B<-ansi> 138f4a2713aSLionel Sambuc 139f4a2713aSLionel SambucSame as B<-std=c89>. 140f4a2713aSLionel Sambuc 141f4a2713aSLionel Sambuc=item B<-ObjC++> 142f4a2713aSLionel Sambuc 143f4a2713aSLionel SambucTreat source input files as Objective-C++ inputs. 144f4a2713aSLionel Sambuc 145f4a2713aSLionel Sambuc=item B<-ObjC> 146f4a2713aSLionel Sambuc 147f4a2713aSLionel SambucTreat source input files as Objective-C inputs. 148f4a2713aSLionel Sambuc 149f4a2713aSLionel Sambuc=item B<-trigraphs> 150f4a2713aSLionel Sambuc 151f4a2713aSLionel SambucEnable trigraphs. 152f4a2713aSLionel Sambuc 153f4a2713aSLionel Sambuc=item B<-ffreestanding> 154f4a2713aSLionel Sambuc 155f4a2713aSLionel SambucIndicate that the file should be compiled for a freestanding, not a hosted, 156f4a2713aSLionel Sambucenvironment. 157f4a2713aSLionel Sambuc 158f4a2713aSLionel Sambuc=item B<-fno-builtin> 159f4a2713aSLionel Sambuc 160f4a2713aSLionel SambucDisable special handling and optimizations of builtin functions like strlen and 161f4a2713aSLionel Sambucmalloc. 162f4a2713aSLionel Sambuc 163f4a2713aSLionel Sambuc=item B<-fmath-errno> 164f4a2713aSLionel Sambuc 165f4a2713aSLionel SambucIndicate that math functions should be treated as updating errno. 166f4a2713aSLionel Sambuc 167f4a2713aSLionel Sambuc=item B<-fpascal-strings> 168f4a2713aSLionel Sambuc 169f4a2713aSLionel SambucEnable support for Pascal-style strings with "\pfoo". 170f4a2713aSLionel Sambuc 171f4a2713aSLionel Sambuc=item B<-fms-extensions> 172f4a2713aSLionel Sambuc 173f4a2713aSLionel SambucEnable support for Microsoft extensions. 174f4a2713aSLionel Sambuc 175f4a2713aSLionel Sambuc=item B<-fmsc-version=> 176f4a2713aSLionel Sambuc 177f4a2713aSLionel SambucSet _MSC_VER. Defaults to 1300 on Windows. Not set otherwise. 178f4a2713aSLionel Sambuc 179f4a2713aSLionel Sambuc=item B<-fborland-extensions> 180f4a2713aSLionel Sambuc 181f4a2713aSLionel SambucEnable support for Borland extensions. 182f4a2713aSLionel Sambuc 183f4a2713aSLionel Sambuc=item B<-fwritable-strings> 184f4a2713aSLionel Sambuc 185f4a2713aSLionel SambucMake all string literals default to writable. This disables uniquing of 186f4a2713aSLionel Sambucstrings and other optimizations. 187f4a2713aSLionel Sambuc 188f4a2713aSLionel Sambuc=item B<-flax-vector-conversions> 189f4a2713aSLionel Sambuc 190f4a2713aSLionel SambucAllow loose type checking rules for implicit vector conversions. 191f4a2713aSLionel Sambuc 192f4a2713aSLionel Sambuc=item B<-fblocks> 193f4a2713aSLionel Sambuc 194f4a2713aSLionel SambucEnable the "Blocks" language feature. 195f4a2713aSLionel Sambuc 196f4a2713aSLionel Sambuc=item B<-fobjc-gc-only> 197f4a2713aSLionel Sambuc 198f4a2713aSLionel SambucIndicate that Objective-C code should be compiled in GC-only mode, which only 199f4a2713aSLionel Sambucworks when Objective-C Garbage Collection is enabled. 200f4a2713aSLionel Sambuc 201f4a2713aSLionel Sambuc=item B<-fobjc-gc> 202f4a2713aSLionel Sambuc 203f4a2713aSLionel SambucIndicate that Objective-C code should be compiled in hybrid-GC mode, which works 204f4a2713aSLionel Sambucwith both GC and non-GC mode. 205f4a2713aSLionel Sambuc 206f4a2713aSLionel Sambuc=item B<-fobjc-abi-version>=I<version> 207f4a2713aSLionel Sambuc 208f4a2713aSLionel SambucSelect the Objective-C ABI version to use. Available versions are 1 (legacy 209f4a2713aSLionel Sambuc"fragile" ABI), 2 (non-fragile ABI 1), and 3 (non-fragile ABI 2). 210f4a2713aSLionel Sambuc 211f4a2713aSLionel Sambuc=item B<-fobjc-nonfragile-abi-version>=I<version> 212f4a2713aSLionel Sambuc 213f4a2713aSLionel SambucSelect the Objective-C non-fragile ABI version to use by default. This will only 214f4a2713aSLionel Sambucbe used as the Objective-C ABI when the non-fragile ABI is enabled (either via 215f4a2713aSLionel Sambuc-fobjc-nonfragile-abi, or because it is the platform default). 216f4a2713aSLionel Sambuc 217f4a2713aSLionel Sambuc=item B<-fobjc-nonfragile-abi> 218f4a2713aSLionel Sambuc 219f4a2713aSLionel SambucEnable use of the Objective-C non-fragile ABI. On platforms for which this is 220f4a2713aSLionel Sambucthe default ABI, it can be disabled with B<-fno-objc-nonfragile-abi>. 221f4a2713aSLionel Sambuc 222f4a2713aSLionel Sambuc=back 223f4a2713aSLionel Sambuc 224f4a2713aSLionel Sambuc 225f4a2713aSLionel Sambuc 226f4a2713aSLionel Sambuc=head2 Target Selection Options 227f4a2713aSLionel Sambuc 228f4a2713aSLionel SambucClang fully supports cross compilation as an inherent part of its design. 229f4a2713aSLionel SambucDepending on how your version of Clang is configured, it may have support for 230f4a2713aSLionel Sambuca number of cross compilers, or may only support a native target. 231f4a2713aSLionel Sambuc 232f4a2713aSLionel Sambuc=over 233f4a2713aSLionel Sambuc 234f4a2713aSLionel Sambuc=item B<-arch> I<architecture> 235f4a2713aSLionel Sambuc 236f4a2713aSLionel SambucSpecify the architecture to build for. 237f4a2713aSLionel Sambuc 238f4a2713aSLionel Sambuc=item B<-mmacosx-version-min>=I<version> 239f4a2713aSLionel Sambuc 240*0a6a1f1dSLionel SambucWhen building for Mac OS X, specify the minimum version supported by your 241f4a2713aSLionel Sambucapplication. 242f4a2713aSLionel Sambuc 243f4a2713aSLionel Sambuc=item B<-miphoneos-version-min> 244f4a2713aSLionel Sambuc 245f4a2713aSLionel SambucWhen building for iPhone OS, specify the minimum version supported by your 246f4a2713aSLionel Sambucapplication. 247f4a2713aSLionel Sambuc 248f4a2713aSLionel Sambuc 249f4a2713aSLionel Sambuc=item B<-march>=I<cpu> 250f4a2713aSLionel Sambuc 251f4a2713aSLionel SambucSpecify that Clang should generate code for a specific processor family member 252f4a2713aSLionel Sambucand later. For example, if you specify -march=i486, the compiler is allowed to 253f4a2713aSLionel Sambucgenerate instructions that are valid on i486 and later processors, but which 254f4a2713aSLionel Sambucmay not exist on earlier ones. 255f4a2713aSLionel Sambuc 256f4a2713aSLionel Sambuc=back 257f4a2713aSLionel Sambuc 258f4a2713aSLionel Sambuc 259f4a2713aSLionel Sambuc=head2 Code Generation Options 260f4a2713aSLionel Sambuc 261f4a2713aSLionel Sambuc=over 262f4a2713aSLionel Sambuc 263f4a2713aSLionel Sambuc=item B<-O0> B<-O1> B<-O2> B<-O3> B<-Ofast> B<-Os> B<-Oz> B<-O> B<-O4> 264f4a2713aSLionel Sambuc 265f4a2713aSLionel SambucSpecify which optimization level to use: 266f4a2713aSLionel Sambuc 267f4a2713aSLionel Sambuc=over 268f4a2713aSLionel Sambuc 269f4a2713aSLionel Sambuc=item B<-O0> 270f4a2713aSLionel Sambuc 271f4a2713aSLionel SambucMeans "no optimization": this level compiles the fastest and 272f4a2713aSLionel Sambucgenerates the most debuggable code. 273f4a2713aSLionel Sambuc 274f4a2713aSLionel Sambuc=item B<-O1> 275f4a2713aSLionel Sambuc 276f4a2713aSLionel SambucSomewhere between B<-O0> and B<-O2>. 277f4a2713aSLionel Sambuc 278f4a2713aSLionel Sambuc=item B<-O2> 279f4a2713aSLionel Sambuc 280f4a2713aSLionel SambucModerate level of optimization which enables most optimizations. 281f4a2713aSLionel Sambuc 282f4a2713aSLionel Sambuc=item B<-O3> 283f4a2713aSLionel Sambuc 284f4a2713aSLionel SambucLike B<-O2>, except that it enables optimizations that take longer to perform 285f4a2713aSLionel Sambucor that may generate larger code (in an attempt to make the program run faster). 286f4a2713aSLionel Sambuc 287f4a2713aSLionel Sambuc=item B<-Ofast> 288f4a2713aSLionel Sambuc 289f4a2713aSLionel SambucEnables all the optimizations from B<-O3> along with other aggressive 290f4a2713aSLionel Sambucoptimizations that may violate strict compliance with language standards. 291f4a2713aSLionel Sambuc 292f4a2713aSLionel Sambuc=item B<-Os> 293f4a2713aSLionel Sambuc 294f4a2713aSLionel SambucLike B<-O2> with extra optimizations to reduce code size. 295f4a2713aSLionel Sambuc 296f4a2713aSLionel Sambuc=item B<-Oz> 297f4a2713aSLionel Sambuc 298f4a2713aSLionel SambucLike B<-Os> (and thus B<-O2>), but reduces code size further. 299f4a2713aSLionel Sambuc 300f4a2713aSLionel Sambuc=item B<-O> 301f4a2713aSLionel Sambuc 302f4a2713aSLionel SambucEquivalent to B<-O2>. 303f4a2713aSLionel Sambuc 304f4a2713aSLionel Sambuc=item B<-O4> and higher 305f4a2713aSLionel Sambuc 306f4a2713aSLionel SambucCurrently equivalent to B<-O3> 307f4a2713aSLionel Sambuc 308f4a2713aSLionel Sambuc=back 309f4a2713aSLionel Sambuc 310f4a2713aSLionel Sambuc=item B<-g> 311f4a2713aSLionel Sambuc 312f4a2713aSLionel SambucGenerate debug information. Note that Clang debug information works best at 313*0a6a1f1dSLionel SambucB<-O0>. 314*0a6a1f1dSLionel Sambuc 315*0a6a1f1dSLionel Sambuc=item B<-fstandalone-debug> B<-fno-standalone-debug> 316*0a6a1f1dSLionel Sambuc 317*0a6a1f1dSLionel SambucClang supports a number of optimizations to reduce the size of debug 318*0a6a1f1dSLionel Sambucinformation in the binary. They work based on the assumption that the 319*0a6a1f1dSLionel Sambucdebug type information can be spread out over multiple compilation 320*0a6a1f1dSLionel Sambucunits. For instance, Clang will not emit type definitions for types 321*0a6a1f1dSLionel Sambucthat are not needed by a module and could be replaced with a forward 322*0a6a1f1dSLionel Sambucdeclaration. Further, Clang will only emit type info for a dynamic 323*0a6a1f1dSLionel SambucC++ class in the module that contains the vtable for the class. 324*0a6a1f1dSLionel Sambuc 325*0a6a1f1dSLionel SambucThe B<-fstandalone-debug> option turns off these optimizations. This 326*0a6a1f1dSLionel Sambucis useful when working with 3rd-party libraries that don't come with 327*0a6a1f1dSLionel Sambucdebug information. This is the default on Darwin. Note that Clang 328*0a6a1f1dSLionel Sambucwill never emit type information for types that are not referenced at 329*0a6a1f1dSLionel Sambucall by the program. 330f4a2713aSLionel Sambuc 331f4a2713aSLionel Sambuc=item B<-fexceptions> 332f4a2713aSLionel Sambuc 333f4a2713aSLionel SambucEnable generation of unwind information, this allows exceptions to be thrown 334f4a2713aSLionel Sambucthrough Clang compiled stack frames. This is on by default in x86-64. 335f4a2713aSLionel Sambuc 336f4a2713aSLionel Sambuc=item B<-ftrapv> 337f4a2713aSLionel Sambuc 338f4a2713aSLionel SambucGenerate code to catch integer overflow errors. Signed integer overflow is 339f4a2713aSLionel Sambucundefined in C, with this flag, extra code is generated to detect this and abort 340f4a2713aSLionel Sambucwhen it happens. 341f4a2713aSLionel Sambuc 342f4a2713aSLionel Sambuc 343f4a2713aSLionel Sambuc=item B<-fvisibility> 344f4a2713aSLionel Sambuc 345f4a2713aSLionel SambucThis flag sets the default visibility level. 346f4a2713aSLionel Sambuc 347f4a2713aSLionel Sambuc=item B<-fcommon> 348f4a2713aSLionel Sambuc 349f4a2713aSLionel SambucThis flag specifies that variables without initializers get common linkage. It 350f4a2713aSLionel Sambuccan be disabled with B<-fno-common>. 351f4a2713aSLionel Sambuc 352f4a2713aSLionel Sambuc=item B<-ftls-model> 353f4a2713aSLionel Sambuc 354f4a2713aSLionel SambucSet the default thread-local storage (TLS) model to use for thread-local 355f4a2713aSLionel Sambucvariables. Valid values are: "global-dynamic", "local-dynamic", "initial-exec" 356f4a2713aSLionel Sambucand "local-exec". The default is "global-dynamic". The default model can be 357f4a2713aSLionel Sambucoverridden with the tls_model attribute. The compiler will try to choose a more 358f4a2713aSLionel Sambucefficient model if possible. 359f4a2713aSLionel Sambuc 360f4a2713aSLionel Sambuc=item B<-flto> B<-emit-llvm> 361f4a2713aSLionel Sambuc 362f4a2713aSLionel SambucGenerate output files in LLVM formats, suitable for link time optimization. When 363f4a2713aSLionel Sambucused with B<-S> this generates LLVM intermediate language assembly files, 364f4a2713aSLionel Sambucotherwise this generates LLVM bitcode format object files (which may be passed 365f4a2713aSLionel Sambucto the linker depending on the stage selection options). 366f4a2713aSLionel Sambuc 367f4a2713aSLionel Sambuc=cut 368f4a2713aSLionel Sambuc 369f4a2713aSLionel Sambuc##=item B<-fnext-runtime> B<-fobjc-nonfragile-abi> B<-fgnu-runtime> 370f4a2713aSLionel Sambuc##These options specify which Objective-C runtime the code generator should 371f4a2713aSLionel Sambuc##target. FIXME: we don't want people poking these generally. 372f4a2713aSLionel Sambuc 373f4a2713aSLionel Sambuc=pod 374f4a2713aSLionel Sambuc 375f4a2713aSLionel Sambuc=back 376f4a2713aSLionel Sambuc 377f4a2713aSLionel Sambuc 378f4a2713aSLionel Sambuc=head2 Driver Options 379f4a2713aSLionel Sambuc 380f4a2713aSLionel Sambuc=over 381f4a2713aSLionel Sambuc 382f4a2713aSLionel Sambuc=item B<-###> 383f4a2713aSLionel Sambuc 384*0a6a1f1dSLionel SambucPrint (but do not run) the commands to run for this compilation. 385f4a2713aSLionel Sambuc 386f4a2713aSLionel Sambuc=item B<--help> 387f4a2713aSLionel Sambuc 388f4a2713aSLionel SambucDisplay available options. 389f4a2713aSLionel Sambuc 390f4a2713aSLionel Sambuc=item B<-Qunused-arguments> 391f4a2713aSLionel Sambuc 392f4a2713aSLionel SambucDon't emit warning for unused driver arguments. 393f4a2713aSLionel Sambuc 394f4a2713aSLionel Sambuc=item B<-Wa,>I<args> 395f4a2713aSLionel Sambuc 396f4a2713aSLionel SambucPass the comma separated arguments in I<args> to the assembler. 397f4a2713aSLionel Sambuc 398f4a2713aSLionel Sambuc=item B<-Wl,>I<args> 399f4a2713aSLionel Sambuc 400f4a2713aSLionel SambucPass the comma separated arguments in I<args> to the linker. 401f4a2713aSLionel Sambuc 402f4a2713aSLionel Sambuc=item B<-Wp,>I<args> 403f4a2713aSLionel Sambuc 404f4a2713aSLionel SambucPass the comma separated arguments in I<args> to the preprocessor. 405f4a2713aSLionel Sambuc 406f4a2713aSLionel Sambuc=item B<-Xanalyzer> I<arg> 407f4a2713aSLionel Sambuc 408f4a2713aSLionel SambucPass I<arg> to the static analyzer. 409f4a2713aSLionel Sambuc 410f4a2713aSLionel Sambuc=item B<-Xassembler> I<arg> 411f4a2713aSLionel Sambuc 412f4a2713aSLionel SambucPass I<arg> to the assembler. 413f4a2713aSLionel Sambuc 414f4a2713aSLionel Sambuc=item B<-Xlinker> I<arg> 415f4a2713aSLionel Sambuc 416f4a2713aSLionel SambucPass I<arg> to the linker. 417f4a2713aSLionel Sambuc 418f4a2713aSLionel Sambuc=item B<-Xpreprocessor> I<arg> 419f4a2713aSLionel Sambuc 420f4a2713aSLionel SambucPass I<arg> to the preprocessor. 421f4a2713aSLionel Sambuc 422f4a2713aSLionel Sambuc=item B<-o> I<file> 423f4a2713aSLionel Sambuc 424f4a2713aSLionel SambucWrite output to I<file>. 425f4a2713aSLionel Sambuc 426f4a2713aSLionel Sambuc=item B<-print-file-name>=I<file> 427f4a2713aSLionel Sambuc 428f4a2713aSLionel SambucPrint the full library path of I<file>. 429f4a2713aSLionel Sambuc 430f4a2713aSLionel Sambuc=item B<-print-libgcc-file-name> 431f4a2713aSLionel Sambuc 432f4a2713aSLionel SambucPrint the library path for "libgcc.a". 433f4a2713aSLionel Sambuc 434f4a2713aSLionel Sambuc=item B<-print-prog-name>=I<name> 435f4a2713aSLionel Sambuc 436f4a2713aSLionel SambucPrint the full program path of I<name>. 437f4a2713aSLionel Sambuc 438f4a2713aSLionel Sambuc=item B<-print-search-dirs> 439f4a2713aSLionel Sambuc 440f4a2713aSLionel SambucPrint the paths used for finding libraries and programs. 441f4a2713aSLionel Sambuc 442f4a2713aSLionel Sambuc=item B<-save-temps> 443f4a2713aSLionel Sambuc 444f4a2713aSLionel SambucSave intermediate compilation results. 445f4a2713aSLionel Sambuc 446f4a2713aSLionel Sambuc=item B<-integrated-as> B<-no-integrated-as> 447f4a2713aSLionel Sambuc 448f4a2713aSLionel SambucUsed to enable and disable, respectively, the use of the integrated 449f4a2713aSLionel Sambucassembler. Whether the integrated assembler is on by default is target 450f4a2713aSLionel Sambucdependent. 451f4a2713aSLionel Sambuc 452f4a2713aSLionel Sambuc=item B<-time> 453f4a2713aSLionel Sambuc 454f4a2713aSLionel SambucTime individual commands. 455f4a2713aSLionel Sambuc 456f4a2713aSLionel Sambuc=item B<-ftime-report> 457f4a2713aSLionel Sambuc 458f4a2713aSLionel SambucPrint timing summary of each stage of compilation. 459f4a2713aSLionel Sambuc 460f4a2713aSLionel Sambuc=item B<-v> 461f4a2713aSLionel Sambuc 462f4a2713aSLionel SambucShow commands to run and use verbose output. 463f4a2713aSLionel Sambuc 464f4a2713aSLionel Sambuc=back 465f4a2713aSLionel Sambuc 466f4a2713aSLionel Sambuc 467f4a2713aSLionel Sambuc=head2 Diagnostics Options 468f4a2713aSLionel Sambuc 469f4a2713aSLionel Sambuc=over 470f4a2713aSLionel Sambuc 471f4a2713aSLionel Sambuc=item B<-fshow-column> 472f4a2713aSLionel SambucB<-fshow-source-location> 473f4a2713aSLionel SambucB<-fcaret-diagnostics> 474f4a2713aSLionel SambucB<-fdiagnostics-fixit-info> 475f4a2713aSLionel SambucB<-fdiagnostics-parseable-fixits> 476f4a2713aSLionel SambucB<-fdiagnostics-print-source-range-info> 477f4a2713aSLionel SambucB<-fprint-source-range-info> 478f4a2713aSLionel SambucB<-fdiagnostics-show-option> 479f4a2713aSLionel SambucB<-fmessage-length> 480f4a2713aSLionel Sambuc 481f4a2713aSLionel SambucThese options control how Clang prints out information about diagnostics (errors 482f4a2713aSLionel Sambucand warnings). Please see the Clang User's Manual for more information. 483f4a2713aSLionel Sambuc 484f4a2713aSLionel Sambuc=back 485f4a2713aSLionel Sambuc 486f4a2713aSLionel Sambuc 487f4a2713aSLionel Sambuc=head2 Preprocessor Options 488f4a2713aSLionel Sambuc 489f4a2713aSLionel Sambuc=over 490f4a2713aSLionel Sambuc 491f4a2713aSLionel Sambuc=item B<-D>I<macroname=value> 492f4a2713aSLionel Sambuc 493f4a2713aSLionel SambucAdds an implicit #define into the predefines buffer which is read before the 494f4a2713aSLionel Sambucsource file is preprocessed. 495f4a2713aSLionel Sambuc 496f4a2713aSLionel Sambuc=item B<-U>I<macroname> 497f4a2713aSLionel Sambuc 498f4a2713aSLionel SambucAdds an implicit #undef into the predefines buffer which is read before the 499f4a2713aSLionel Sambucsource file is preprocessed. 500f4a2713aSLionel Sambuc 501f4a2713aSLionel Sambuc=item B<-include> I<filename> 502f4a2713aSLionel Sambuc 503f4a2713aSLionel SambucAdds an implicit #include into the predefines buffer which is read before the 504f4a2713aSLionel Sambucsource file is preprocessed. 505f4a2713aSLionel Sambuc 506f4a2713aSLionel Sambuc=item B<-I>I<directory> 507f4a2713aSLionel Sambuc 508f4a2713aSLionel SambucAdd the specified directory to the search path for include files. 509f4a2713aSLionel Sambuc 510f4a2713aSLionel Sambuc=item B<-F>I<directory> 511f4a2713aSLionel Sambuc 512f4a2713aSLionel SambucAdd the specified directory to the search path for framework include files. 513f4a2713aSLionel Sambuc 514f4a2713aSLionel Sambuc=item B<-nostdinc> 515f4a2713aSLionel Sambuc 516f4a2713aSLionel SambucDo not search the standard system directories or compiler builtin directories 517f4a2713aSLionel Sambucfor include files. 518f4a2713aSLionel Sambuc 519f4a2713aSLionel Sambuc=item B<-nostdlibinc> 520f4a2713aSLionel Sambuc 521f4a2713aSLionel SambucDo not search the standard system directories for include files, but do search 522f4a2713aSLionel Sambuccompiler builtin include directories. 523f4a2713aSLionel Sambuc 524f4a2713aSLionel Sambuc=item B<-nobuiltininc> 525f4a2713aSLionel Sambuc 526f4a2713aSLionel SambucDo not search clang's builtin directory for include files. 527f4a2713aSLionel Sambuc 528f4a2713aSLionel Sambuc=cut 529f4a2713aSLionel Sambuc 530f4a2713aSLionel Sambuc## TODO, but do we really want people using this stuff? 531f4a2713aSLionel Sambuc#=item B<-idirafter>I<directory> 532f4a2713aSLionel Sambuc#=item B<-iquote>I<directory> 533f4a2713aSLionel Sambuc#=item B<-isystem>I<directory> 534f4a2713aSLionel Sambuc#=item B<-iprefix>I<directory> 535f4a2713aSLionel Sambuc#=item B<-iwithprefix>I<directory> 536f4a2713aSLionel Sambuc#=item B<-iwithprefixbefore>I<directory> 537f4a2713aSLionel Sambuc#=item B<-isysroot> 538f4a2713aSLionel Sambuc 539f4a2713aSLionel Sambuc=pod 540f4a2713aSLionel Sambuc 541f4a2713aSLionel Sambuc 542f4a2713aSLionel Sambuc=back 543f4a2713aSLionel Sambuc 544f4a2713aSLionel Sambuc 545f4a2713aSLionel Sambuc 546f4a2713aSLionel Sambuc=cut 547f4a2713aSLionel Sambuc 548f4a2713aSLionel Sambuc### TODO someday. 549f4a2713aSLionel Sambuc#=head2 Warning Control Options 550f4a2713aSLionel Sambuc#=over 551f4a2713aSLionel Sambuc#=back 552f4a2713aSLionel Sambuc#=head2 Code Generation and Optimization Options 553f4a2713aSLionel Sambuc#=over 554f4a2713aSLionel Sambuc#=back 555f4a2713aSLionel Sambuc#=head2 Assembler Options 556f4a2713aSLionel Sambuc#=over 557f4a2713aSLionel Sambuc#=back 558f4a2713aSLionel Sambuc#=head2 Linker Options 559f4a2713aSLionel Sambuc#=over 560f4a2713aSLionel Sambuc#=back 561f4a2713aSLionel Sambuc#=head2 Static Analyzer Options 562f4a2713aSLionel Sambuc#=over 563f4a2713aSLionel Sambuc#=back 564f4a2713aSLionel Sambuc 565f4a2713aSLionel Sambuc=pod 566f4a2713aSLionel Sambuc 567f4a2713aSLionel Sambuc 568f4a2713aSLionel Sambuc=head1 ENVIRONMENT 569f4a2713aSLionel Sambuc 570f4a2713aSLionel Sambuc=over 571f4a2713aSLionel Sambuc 572f4a2713aSLionel Sambuc=item B<TMPDIR>, B<TEMP>, B<TMP> 573f4a2713aSLionel Sambuc 574f4a2713aSLionel SambucThese environment variables are checked, in order, for the location to 575f4a2713aSLionel Sambucwrite temporary files used during the compilation process. 576f4a2713aSLionel Sambuc 577f4a2713aSLionel Sambuc=item B<CPATH> 578f4a2713aSLionel Sambuc 579f4a2713aSLionel SambucIf this environment variable is present, it is treated as a delimited 580f4a2713aSLionel Sambuclist of paths to be added to the default system include path list. The 581f4a2713aSLionel Sambucdelimiter is the platform dependent delimitor, as used in the I<PATH> 582f4a2713aSLionel Sambucenvironment variable. 583f4a2713aSLionel Sambuc 584f4a2713aSLionel SambucEmpty components in the environment variable are ignored. 585f4a2713aSLionel Sambuc 586f4a2713aSLionel Sambuc=item B<C_INCLUDE_PATH>, B<OBJC_INCLUDE_PATH>, B<CPLUS_INCLUDE_PATH>, 587f4a2713aSLionel SambucB<OBJCPLUS_INCLUDE_PATH> 588f4a2713aSLionel Sambuc 589f4a2713aSLionel SambucThese environment variables specify additional paths, as for CPATH, 590f4a2713aSLionel Sambucwhich are only used when processing the appropriate language. 591f4a2713aSLionel Sambuc 592f4a2713aSLionel Sambuc=item B<MACOSX_DEPLOYMENT_TARGET> 593f4a2713aSLionel Sambuc 594f4a2713aSLionel SambucIf -mmacosx-version-min is unspecified, the default deployment target 595f4a2713aSLionel Sambucis read from this environment variable. This option only affects darwin 596f4a2713aSLionel Sambuctargets. 597f4a2713aSLionel Sambuc 598f4a2713aSLionel Sambuc=back 599f4a2713aSLionel Sambuc 600f4a2713aSLionel Sambuc=head1 BUGS 601f4a2713aSLionel Sambuc 602f4a2713aSLionel SambucTo report bugs, please visit L<http://llvm.org/bugs/>. Most bug reports should 603f4a2713aSLionel Sambucinclude preprocessed source files (use the B<-E> option) and the full output of 604f4a2713aSLionel Sambucthe compiler, along with information to reproduce. 605f4a2713aSLionel Sambuc 606f4a2713aSLionel Sambuc=head1 SEE ALSO 607f4a2713aSLionel Sambuc 608f4a2713aSLionel Sambuc as(1), ld(1) 609f4a2713aSLionel Sambuc 610f4a2713aSLionel Sambuc=head1 AUTHOR 611f4a2713aSLionel Sambuc 612f4a2713aSLionel SambucMaintained by the Clang / LLVM Team (L<http://clang.llvm.org>). 613f4a2713aSLionel Sambuc 614f4a2713aSLionel Sambuc=cut 615