blob: 9d710d08af90c0940a00b37abc8c3fa89a654f11 [file] [log] [blame]
Reid Spencere497ff12006-05-30 19:56:31 +00001=pod
2
3=head1 NAME
4
5llvm2xpp - LLVM assembler to LLVM C++ IR translator
6
7=head1 SYNOPSIS
8
9B<llvm2cpp> [I<options>] [I<filename>]
10
11=head1 DESCRIPTION
12
13B<llvm2cpp> translates from human readable LLVM assembly (.ll files) to a
14corresponding C++ source file that will make calls against the LLVM C++ API to
15build the same module as the input. By default, the C++ output is a complete
16program that builds the module, verifies it and then emits the module as
17LLVM assembly again. This technique assists with testing because the input to
18B<llvm2cpp> and the output of the generated C++ program should be identical.
19
20If F<filename> is omitted or is C<->, then B<llvm2cpp> reads its input from
21standard input.
22
23If an output file is not specified with the B<-o> option, then
24B<llvm-as> sends its output to a file or standard output by following
25these rules:
26
27=over
28
29=item *
30
31If the input is standard input, then the output is standard output.
32
33=item *
34
35If the input is a file that ends with C<.ll>, then the output file is of
36the same name, except that the suffix is changed to C<.cpp>.
37
38=item *
39
40If the input is a file that does not end with the C<.ll> suffix, then the
41output file has the same name as the input file, except that the C<.cpp>
42suffix is appended.
43
44=back
45
46=head1 OPTIONS
47
48=over
49
50=item B<-f>
51
52Force overwrite. Normally, B<llvm2cpp> will refuse to overwrite an
53output file that already exists. With this option, B<llvm2cpp>
54will overwrite the output file and replace it with new C++ source code.
55
56=item B<--help>
57
58Print a summary of command line options.
59
60=item B<-o> F<filename>
61
62Specify the output file name. If F<filename> is C<->, then B<llvm2cpp>
63sends its output to standard output.
64
65=item B<-modname> F<moduleName>
66
67Specify the name of the module to be generated. Normally the generated program
68creates a module that has the same name as the input file. If the input file was
69read from the standard input then the module name will be '<stdin>'. This option
70overrides both these default actions and specifies that the module name used
71must be F<moduleName>.
72
73=back
74
75=head1 EXIT STATUS
76
77If B<llvm2cpp> succeeds, it will exit with 0. Otherwise, if an error
78occurs, it will exit with a non-zero value.
79
80=head1 SEE ALSO
81
82L<llvm-as|llvm-as>
83
84=head1 AUTHORS
85
86Maintained by the LLVM Team (L<http://llvm.org>).
87
88=cut