llvm.org GIT mirror llvm / 0cabaa5
Update documentation for the -f change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79996 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 11 years ago
9 changed file(s) with 39 addition(s) and 37 deletion(s). Raw diff Collapse all Expand all
16151615
16161616
16171617

                  
                
1618 $ llc -f -regalloc=simple file.bc -o sp.s;
1619 $ llc -f -regalloc=local file.bc -o lc.s;
1620 $ llc -f -regalloc=linearscan file.bc -o ln.s;
1618 $ llc -regalloc=simple file.bc -o sp.s;
1619 $ llc -regalloc=local file.bc -o lc.s;
1620 $ llc -regalloc=linearscan file.bc -o ln.s;
16211621
16221622
16231623
4848
4949 =item B<-f>
5050
51 Overwrite output files. By default, B will refuse to overwrite
52 an output file which already exists.
51 Enable binary output on terminals. Normally, B will refuse to
52 write raw bitcode output if the output stream is a terminal. With this option,
53 B will write raw bitcode regardless of the output device.
5354
5455 =item B<-mtriple>=I
5556
4545
4646 =item B<-f>
4747
48 Force overwrite. Normally, B will refuse to overwrite an
49 output file that already exists. With this option, B
50 will overwrite the output file and replace it with new bitcode.
48 Enable binary output on terminals. Normally, B will refuse to
49 write raw bitcode output if the output stream is a terminal. With this option,
50 B will write raw bitcode regardless of the output device.
5151
5252 =item B<--help>
5353
2828
2929 =item B<-f>
3030
31 Force overwrite. Normally, B will refuse to overwrite
32 an output file that already exists. With this option, B
33 will overwrite the output file.
31 Enable binary output on terminals. Normally, B will refuse to
32 write raw bitcode output if the output stream is a terminal. With this option,
33 B will write raw bitcode regardless of the output device.
3434
3535 =item B<--help>
3636
2727
2828 =item B<-f>
2929
30 Force overwrite. Normally, B will refuse to overwrite an
31 output file that already exists. With this option, B
32 will overwrite the output file and replace it with new bitcode.
30 Enable binary output on terminals. Normally, B will refuse to
31 write raw bitcode output if the output stream is a terminal. With this option,
32 B will write raw bitcode regardless of the output device.
3333
3434 =item B<--func> I
3535
3232
3333 =item B<-f>
3434
35 Overwrite output files. By default, B will not overwrite an output
36 file if it already exists.
35 Enable binary output on terminals. Normally, B will refuse to
36 write raw bitcode output if the output stream is a terminal. With this option,
37 B will write raw bitcode regardless of the output device.
3738
3839 =item B<-o> F
3940
3838
3939 =item B<-f>
4040
41 Force overwrite. Normally, B will refuse to overwrite an
42 output file that already exists. With this option, B will
43 overwrite the output file and replace it with new bitcode.
41 Enable binary output on terminals. Normally, B will refuse to
42 write raw bitcode output if the output stream is a terminal. With this option,
43 B will write raw bitcode regardless of the output device.
4444
4545 =item B<-help>
4646
330330
331331
332332

In addition to input and output filenames, we would like the compiler example

333 to support three boolean flags: "-f" to force overwriting of the output
334 file, "--quiet" to enable quiet mode, and "-q" for backwards
335 compatibility with some of our users. We can support these by declaring options
336 of boolean type like this:

337
338

                  
                
339 cl::opt<bool> Force ("f", cl::desc("Overwrite output files"));
333 to support three boolean flags: "-f" to force writing binary output to
334 a terminal, "--quiet" to enable quiet mode, and "-q" for
335 backwards compatibility with some of our users. We can support these by
336 declaring options of boolean type like this:

337
338

                  
                
339 cl::opt<bool> Force ("f", cl::desc("Enable binary output on terminals"));
340340 cl::opt<bool> Quiet ("quiet", cl::desc("Don't print informational messages"));
341341 cl::opt<bool> Quiet2("q", cl::desc("Don't print informational messages"), cl::Hidden);
342342
377377 USAGE: compiler [options] <input file>
378378
379379 OPTIONS:
380 -f - Overwrite output files
380 -f - Enable binary output on terminals
381381 -o - Override output filename
382382 -quiet - Don't print informational messages
383383 -help - display available options (--help-hidden for more)
389389 USAGE: compiler [options] <input file>
390390
391391 OPTIONS:
392 -f - Overwrite output files
392 -f - Enable binary output on terminals
393393 -o - Override output filename
394394 -q - Don't print informational messages
395395 -quiet - Don't print informational messages
529529 -O1 - Enable trivial optimizations
530530 -O2 - Enable default optimizations
531531 -O3 - Enable expensive optimizations
532 -f - Overwrite output files
532 -f - Enable binary output on terminals
533533 -help - display available options (--help-hidden for more)
534534 -o <filename> - Specify output filename
535535 -quiet - Don't print informational messages
613613 =none - disable debug information
614614 =quick - enable quick debug information
615615 =detailed - enable detailed debug information
616 -f - Overwrite output files
616 -f - Enable binary output on terminals
617617 -help - display available options (--help-hidden for more)
618618 -o <filename> - Specify output filename
619619 -quiet - Don't print informational messages
182182 foo.bc, one of the following commands should fail:

183183
184184
185
  • llc foo.bc -f
  • 186
  • llc foo.bc -f -relocation-model=pic
  • 187
  • llc foo.bc -f -relocation-model=static
  • 188
  • llc foo.bc -f -enable-eh
  • 189
  • llc foo.bc -f -relocation-model=pic -enable-eh
  • 190
  • llc foo.bc -f -relocation-model=static -enable-eh
  • 185
  • llc foo.bc
  • 186
  • llc foo.bc -relocation-model=pic
  • 187
  • llc foo.bc -relocation-model=static
  • 188
  • llc foo.bc -enable-eh
  • 189
  • llc foo.bc -relocation-model=pic -enable-eh
  • 190
  • llc foo.bc -relocation-model=static -enable-eh
  • 191191
    192192
    193193

    If none of these crash, please follow the instructions for a

    319319
    320320
    321321

    322 llc test.bc -o test.s -f
    322 llc test.bc -o test.s
    323323 gcc test.s safe.so -o test.llc
    324324 ./test.llc [program options]
    325325