Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 1 | =pod |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 5 | clang - the Clang C and Objective-C compiler |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 6 | |
| 7 | =head1 SYNOPSIS |
| 8 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 9 | B<clang> [B<-c>|B<-S>|B<-E>] B<-std=>I<standard> B<-g> |
| 10 | [B<-O0>|B<-O1>|B<-O2>|B<-Os>|B<-O3>|B<-O4>] |
| 11 | B<-W>I<warnings...> B<-pedantic> |
| 12 | B<-I>I<dir...> B<-L>I<dir...> |
| 13 | B<-D>I<macro[=defn]> |
| 14 | B<-f>I<feature-option...> |
| 15 | B<-m>I<machine-option...> |
| 16 | B<-o> I<output-file> |
| 17 | I<input-filenames> |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 18 | |
| 19 | =head1 DESCRIPTION |
| 20 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 21 | B<clang> is a C and Objective-C compiler which encompasses preprocessing, |
| 22 | parsing, optimization, code generation, assembly, and linking. Depending on |
| 23 | which high-level mode setting is passed, Clang will stop before doing a full |
| 24 | link. While Clang is highly integrated, it is important to understand the |
| 25 | stages of compilation, to understand how to invoke it. These stages are: |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 26 | |
| 27 | =over |
| 28 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 29 | =item B<Driver> |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 30 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 31 | The B<clang> executable is actually a small driver which controls the overall |
| 32 | execution of other tools such as the compiler, assembler and linker. Typically |
| 33 | you do not need to interact with the driver, but you transparently use it to run |
| 34 | the other tools. |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 35 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 36 | =item B<Preprocessing> |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 37 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 38 | This stage handles tokenization of the input source file, macro expansion, |
| 39 | #include expansion and handling of other preprocessor directives. The output of |
| 40 | this stage is typically called a ".i" (for C) or ".mi" (for Objective-C) file. |
| 41 | |
| 42 | =item B<Parsing and Semantic Analysis> |
| 43 | |
| 44 | This stage parses the input file, translating preprocessor tokens into a parse |
| 45 | tree. Once in the form of a parser tree, it applies semantic analysis to compute |
| 46 | types for expressions as well and determine whether the code is well formed. This |
| 47 | stage is responsible for generating most of the compiler warnings as well as |
| 48 | parse errors. The output of this stage is an "Abstract Syntax Tree" (AST). |
| 49 | |
| 50 | =item B<Code Generation and Optimization> |
| 51 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 52 | This stage translates an AST into low-level intermediate code (known as "LLVM |
| 53 | IR") and ultimately to machine code (depending on the optimization level). This |
| 54 | phase is responsible for optimizing the generated code and handling |
| 55 | target-specfic code generation. The output of this stage is typically called a |
| 56 | ".s" file or "assembly" file. |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 57 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 58 | =item B<Assembler> |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 59 | |
| 60 | This stage runs the target assembler to translate the output of the compiler |
| 61 | into a target object file. The output of this stage is typically called a ".o" |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 62 | file or "object" file. |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 63 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 64 | =item B<Linker> |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 65 | |
| 66 | This stage runs the target linker to merge multiple object files into an |
| 67 | executable or dynamic library. The output of this stage is typically called an |
| 68 | "a.out", ".dylib" or ".so" file. |
| 69 | |
| 70 | =back |
| 71 | |
| 72 | The Clang compiler supports a large number of options to control each of these |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 73 | stages. In addition to compilation of code, Clang also supports other tools: |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 74 | |
| 75 | B<Clang Static Analyzer> |
| 76 | |
| 77 | The Clang Static Analyzer is a tool that scans source code to try to find bugs |
| 78 | though code analysis. This tool uses many parts of Clang and is built into the |
| 79 | same driver. |
| 80 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 81 | |
| 82 | =head1 OPTIONS |
| 83 | |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 84 | =head2 Stage Selection Options |
| 85 | |
| 86 | =over |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 87 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 88 | =item B<-E> |
| 89 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 90 | Run the preprocessor stage. |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 91 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 92 | =item B<-fsyntax-only> |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 93 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 94 | Run the preprocessor, parser and type checking stages. |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 95 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 96 | =item B<-S> |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 97 | |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 98 | Run the previous stages as well as LLVM generation and optimization stages and |
| 99 | target-specific code generation, producing an assembly file. |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 100 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 101 | =item B<-c> |
| 102 | |
| 103 | Run all of the above, plus the assembler, generating a target ".o" object file. |
| 104 | |
| 105 | =item B<no stage selection option> |
| 106 | |
| 107 | If no stage selection option is specified, all stages above are run, and the |
| 108 | linker is run to combine the results into an executable or shared library. |
| 109 | |
| 110 | =item B<--analyze> |
| 111 | |
| 112 | Run the Clang Static Analyzer. |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 113 | |
| 114 | =back |
| 115 | |
| 116 | |
| 117 | |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 118 | =head2 Language Selection and Mode Options |
| 119 | |
| 120 | =over |
| 121 | |
| 122 | =item B<-x> I<language> |
| 123 | |
| 124 | Treat subsequent input files as having type I<language>. |
| 125 | |
| 126 | =item B<-std>=I<language> |
| 127 | |
| 128 | Specify the language standard to compile for. |
| 129 | |
| 130 | =item B<-ansi> |
| 131 | |
| 132 | Same as B<-std=c89>. |
| 133 | |
| 134 | =item B<-ObjC++> |
| 135 | |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 136 | Treat source input files as Objective-C++ inputs. |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 137 | |
| 138 | =item B<-ObjC> |
| 139 | |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 140 | Treat source input files as Objective-C inputs. |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 141 | |
| 142 | =item B<-trigraphs> |
| 143 | |
| 144 | Enable trigraphs. |
| 145 | |
| 146 | =item B<-ffreestanding> |
| 147 | |
| 148 | Indicate that the file should be compiled for a freestanding, not a hosted, |
| 149 | environment. |
| 150 | |
| 151 | =item B<-fno-builtin> |
| 152 | |
| 153 | Disable special handling and optimizations of builtin functions like strlen and |
| 154 | malloc. |
| 155 | |
| 156 | =item B<-fmath-errno> |
| 157 | |
| 158 | Indicate that math functions should be treated as updating errno. |
| 159 | |
| 160 | =item B<-fpascal-strings> |
| 161 | |
| 162 | Enable support for Pascal-style strings with "\pfoo". |
| 163 | |
| 164 | =item B<-fms-extensions> |
| 165 | |
| 166 | Enable support for Microsoft extensions. |
| 167 | |
| 168 | =item B<-fwritable-strings> |
| 169 | |
| 170 | Make all string literals default to writable. This disables uniquing of |
| 171 | strings and other optimizations. |
| 172 | |
| 173 | =item B<-flax-vector-conversions> |
| 174 | |
| 175 | Allow loose type checking rules for implicit vector conversions. |
| 176 | |
| 177 | =item B<-fblocks> |
| 178 | |
| 179 | Enable the "Blocks" language feature. |
| 180 | |
| 181 | |
| 182 | =item B<-fobjc-gc-only> |
| 183 | |
| 184 | Indicate that Objective-C code should be compiled in GC-only mode, which only |
| 185 | works when Objective-C Garbage Collection is enabled. |
| 186 | |
| 187 | =item B<-fobjc-gc> |
| 188 | |
| 189 | Indicate that Objective-C code should be compiled in hybrid-GC mode, which works |
| 190 | with both GC and non-GC mode. |
| 191 | |
| 192 | =back |
| 193 | |
| 194 | |
| 195 | |
| 196 | =head2 Target Selection Options |
| 197 | |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 198 | Clang fully supports cross compilation as an inherent part of its design. |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 199 | Depending on how your version of Clang is configured, it may have support for |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 200 | a number of cross compilers, or may only support a native target. |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 201 | |
| 202 | =over |
| 203 | |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 204 | =item B<-arch> I<architecture> |
| 205 | |
| 206 | Specify the architecture to build for. |
| 207 | |
| 208 | =item B<-mmacosx-version-min>=I<version> |
| 209 | |
| 210 | When building for Mac OS/X, specify the minimum version supported by your |
| 211 | application. |
| 212 | |
| 213 | =item B<-miphoneos-version-min> |
| 214 | |
| 215 | When building for iPhone OS, specify the minimum version supported by your |
| 216 | application. |
| 217 | |
| 218 | |
| 219 | =item B<-march>=I<cpu> |
| 220 | |
| 221 | Specify that Clang should generate code for a specific processor family member |
| 222 | and later. For example, if you specify -march=i486, the compiler is allowed to |
| 223 | generate instructions that are valid on i486 and later processors, but which |
| 224 | may not exist on earlier ones. |
| 225 | |
| 226 | =back |
| 227 | |
| 228 | |
| 229 | =head2 Code Generation Options |
| 230 | |
| 231 | =over |
| 232 | |
| 233 | =item B<-O0> B<-O1> B<-O2> B<-Os> B<-O3> B<-O4> |
| 234 | |
| 235 | Specify which optimization level to use. B<-O0> means "no optimization": this |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 236 | level compiles the fastest and generates the most debuggable code. B<-O2> is a |
| 237 | moderate level of optimization which enables most optimizations. B<-Os> is like |
| 238 | B<-O2> with extra optimizations to reduce code size. B<-O3> is like B<-O2>, |
| 239 | except that it enables optimizations that take longer to perform or that may |
| 240 | generate larger code (in an attempt to make the program run faster). On |
| 241 | supported platforms, B<-O4> enables link-time optimization; object files are |
| 242 | stored in the LLVM bitcode file format and whole program optimization is done at |
| 243 | link time. B<-O1> is somewhere between B<-O0> and B<-O2>. |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 244 | |
| 245 | =item B<-g> |
| 246 | |
| 247 | Generate debug information. Note that Clang debug information works best at |
| 248 | B<-O0>. At higher optimization levels, only line number information is |
| 249 | currently available. |
| 250 | |
| 251 | =item B<-fexceptions> |
| 252 | |
| 253 | Enable generation of unwind information, this allows exceptions to be thrown |
| 254 | through Clang compiled stack frames. This is on by default in x86-64. |
| 255 | |
| 256 | =item B<-ftrapv> |
| 257 | |
| 258 | Generate code to catch integer overflow errors. Signed integer overflow is |
| 259 | undefined in C, with this flag, extra code is generated to detect this and abort |
| 260 | when it happens. |
| 261 | |
| 262 | |
| 263 | =item B<-fvisibility> |
| 264 | |
| 265 | This flag sets the default visibility level. |
| 266 | |
| 267 | =item B<-fcommon> |
| 268 | |
| 269 | This flag specifies that variables without initializers get common linkage. It |
| 270 | can be disabled with B<-fno-common>. |
| 271 | |
Daniel Dunbar | 94f497b | 2009-05-18 21:34:46 +0000 | [diff] [blame] | 272 | =item B<-flto> B<-emit-llvm> |
| 273 | |
| 274 | Generate output files in LLVM formats, suitable for link time optimization. When |
| 275 | used with B<-S> this generates LLVM intermediate language assembly files, |
| 276 | otherwise this generates LLVM bitcode format object files (which may be passed |
| 277 | to the linker depending on the stage selection options). |
| 278 | |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 279 | =cut |
| 280 | |
| 281 | ##=item B<-fnext-runtime> B<-fobjc-nonfragile-abi> B<-fgnu-runtime> |
| 282 | ##These options specify which Objective-C runtime the code generator should |
| 283 | ##target. FIXME: we don't want people poking these generally. |
| 284 | |
| 285 | =pod |
| 286 | |
| 287 | =back |
| 288 | |
| 289 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 290 | =head2 Driver Options |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 291 | |
| 292 | =over |
| 293 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 294 | =item B<-###> |
Chris Lattner | b5f6e80 | 2009-05-06 02:47:51 +0000 | [diff] [blame] | 295 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 296 | Print the commands to run for this compilation. |
| 297 | |
| 298 | =item B<--help> |
| 299 | |
| 300 | Display available options. |
| 301 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 302 | =item B<-Qunused-arguments> |
| 303 | |
| 304 | Don't emit warning for unused driver arguments. |
| 305 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 306 | =item B<-Wa,>I<args> |
| 307 | |
| 308 | Pass the comma separated arguments in I<args> to the assembler. |
| 309 | |
| 310 | =item B<-Wl,>I<args> |
| 311 | |
| 312 | Pass the comma separated arguments in I<args> to the linker. |
| 313 | |
| 314 | =item B<-Wp,>I<args> |
| 315 | |
| 316 | Pass the comma separated arguments in I<args> to the preprocessor. |
| 317 | |
| 318 | =item B<-Xanalyzer> I<arg> |
| 319 | |
| 320 | Pass I<arg> to the static analyzer. |
| 321 | |
| 322 | =item B<-Xassembler> I<arg> |
| 323 | |
| 324 | Pass I<arg> to the assembler. |
| 325 | |
| 326 | =item B<-Xclang> I<arg> |
| 327 | |
| 328 | Pass I<arg> to the clang compiler. |
| 329 | |
| 330 | =item B<-Xlinker> I<arg> |
| 331 | |
| 332 | Pass I<arg> to the linker. |
| 333 | |
| 334 | =item B<-Xpreprocessor> I<arg> |
| 335 | |
| 336 | Pass I<arg> to the preprocessor. |
| 337 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 338 | =item B<-o> I<file> |
| 339 | |
| 340 | Write output to I<file>. |
| 341 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 342 | =item B<-print-file-name>=I<file> |
| 343 | |
| 344 | Print the full library path of I<file>. |
| 345 | |
| 346 | =item B<-print-libgcc-file-name> |
| 347 | |
| 348 | Print the library path for "libgcc.a". |
| 349 | |
| 350 | =item B<-print-prog-name>=I<name> |
| 351 | |
| 352 | Print the full program path of I<name>. |
| 353 | |
| 354 | =item B<-print-search-dirs> |
| 355 | |
| 356 | Print the paths used for finding libraries and programs. |
| 357 | |
| 358 | =item B<-save-temps> |
| 359 | |
| 360 | Save intermediate compilation results. |
| 361 | |
| 362 | =item B<-time> |
| 363 | |
| 364 | Time individual commands. |
| 365 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 366 | =item B<-ftime-report> |
| 367 | |
| 368 | Print timing summary of each stage of compilation. |
| 369 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 370 | =item B<-v> |
| 371 | |
| 372 | Show commands to run and use verbose output. |
| 373 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 374 | =back |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 375 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 376 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 377 | =head2 Diagnostics Options |
| 378 | |
| 379 | =over |
| 380 | |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 381 | =item |
| 382 | B<-fshow-column> |
| 383 | B<-fshow-source-location> |
| 384 | B<-fcaret-diagnostics> |
| 385 | B<-fdiagnostics-fixit-info> |
| 386 | B<-fdiagnostics-print-source-range-info> |
| 387 | B<-fprint-source-range-info> |
| 388 | B<-fdiagnostics-show-option> |
| 389 | B<-fmessage-length> |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 390 | |
Chris Lattner | 04005dd | 2009-05-12 00:01:32 +0000 | [diff] [blame] | 391 | These options control how Clang prints out information about diagnostics (errors |
| 392 | and warnings). Please see the Clang User's Manual for more information. |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 393 | |
| 394 | =back |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 395 | |
| 396 | |
| 397 | =head2 Preprocessor Options |
| 398 | |
| 399 | =over |
| 400 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 401 | =item B<-D>I<macroname=value> |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 402 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 403 | Adds an implicit #define into the predefines buffer which is read before the |
| 404 | source file is preprocessed. |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 405 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 406 | =item B<-U>I<macroname> |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 407 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 408 | Adds an implicit #undef into the predefines buffer which is read before the |
| 409 | source file is preprocessed. |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 410 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 411 | =item B<-include> I<filename> |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 412 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 413 | Adds an implicit #include into the predefines buffer which is read before the |
| 414 | source file is preprocessed. |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 415 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 416 | =item B<-I>I<directory> |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 417 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 418 | Add the specified directory to the search path for include files. |
| 419 | |
| 420 | =item B<-F>I<directory> |
| 421 | |
| 422 | Add the specified directory to the search path for framework include files. |
| 423 | |
| 424 | =item B<-nostdinc> |
| 425 | |
| 426 | Do not search the standard system directories for include files. |
| 427 | |
| 428 | =cut |
| 429 | |
| 430 | ## TODO, but do we really want people using this stuff? |
| 431 | =item B<-idirafter>I<directory> |
| 432 | =item B<-iquote>I<directory> |
| 433 | =item B<-isystem>I<directory> |
| 434 | =item B<-iprefix>I<directory> |
| 435 | =item B<-iwithprefix>I<directory> |
| 436 | =item B<-iwithprefixbefore>I<directory> |
| 437 | =item B<-isysroot> |
| 438 | =pod |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 439 | |
| 440 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 441 | =back |
| 442 | |
| 443 | |
| 444 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 445 | =cut |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 446 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 447 | ### TODO someday. |
| 448 | =head2 Warning Control Options |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 449 | =over |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 450 | =back |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 451 | =head2 Code Generation and Optimization Options |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 452 | =over |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 453 | =back |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 454 | =head2 Assembler Options |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 455 | =over |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 456 | =back |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 457 | =head2 Linker Options |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 458 | =over |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 459 | =back |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 460 | =head2 Static Analyzer Options |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 461 | =over |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 462 | =back |
| 463 | |
Chris Lattner | 06ab044 | 2009-05-12 00:47:40 +0000 | [diff] [blame] | 464 | =pod |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 465 | |
| 466 | |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 467 | =head1 ENVIRONMENT |
| 468 | |
Daniel Dunbar | e58c943 | 2009-05-06 19:18:09 +0000 | [diff] [blame] | 469 | =over |
| 470 | |
| 471 | =item B<TMPDIR>, B<TEMP>, B<TMP> |
| 472 | |
| 473 | These environment variables are checked, in order, for the location to |
| 474 | write temporary files used during the compilation process. |
| 475 | |
| 476 | =item B<CPATH> |
| 477 | |
| 478 | If this environment variable is present, it is treated as a delimited |
| 479 | list of paths to be added to the default system include path list. The |
| 480 | delimiter is the platform dependent delimitor, as used in the I<PATH> |
| 481 | environment variable. |
| 482 | |
| 483 | Empty components in the environment variable are ignored. |
| 484 | |
| 485 | =item B<C_INCLUDE_PATH>, B<OBJC_INCLUDE_PATH>, B<CPLUS_INCLUDE_PATH>, |
| 486 | B<OBJCPLUS_INCLUDE_PATH> |
| 487 | |
| 488 | These environment variables specify additional paths, as for CPATH, |
| 489 | which are only used when processing the appropriate language. |
| 490 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 491 | =item B<MACOSX_DEPLOYMENT_TARGET> |
Daniel Dunbar | e58c943 | 2009-05-06 19:18:09 +0000 | [diff] [blame] | 492 | |
| 493 | If -mmacosx-version-min is unspecified, the default deployment target |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 494 | is read from this environment variable. This option only affects darwin |
| 495 | targets. |
Daniel Dunbar | e58c943 | 2009-05-06 19:18:09 +0000 | [diff] [blame] | 496 | |
| 497 | =back |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 498 | |
| 499 | =head1 BUGS |
| 500 | |
Chris Lattner | 9b081c6 | 2009-05-06 17:22:08 +0000 | [diff] [blame] | 501 | Clang currently does not have C++ support, and this manual page is incomplete. |
| 502 | To report bugs, please visit L<http://llvm.org/bugs/>. Most bug reports should |
Daniel Dunbar | e58c943 | 2009-05-06 19:18:09 +0000 | [diff] [blame] | 503 | include preprocessed source files (use the B<-E> option) and the full output of |
| 504 | the compiler, along with information to reproduce. |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 505 | |
| 506 | =head1 SEE ALSO |
| 507 | |
Chris Lattner | 482c682 | 2009-05-11 22:45:37 +0000 | [diff] [blame] | 508 | as(1), ld(1) |
Daniel Dunbar | dbec033 | 2009-04-29 01:00:32 +0000 | [diff] [blame] | 509 | |
| 510 | =head1 AUTHOR |
| 511 | |
| 512 | Maintained by the Clang / LLVM Team (L<http://clang.llvm.org>). |
| 513 | |
| 514 | =cut |