blob: 0dc30acd6c2a73cc163709d2bd3c2312ee755c81 [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
Reid Spencera0b85152006-05-30 21:19:29 +000073=item B<-funcname> F<functionName>
74
75Specify the name of the function to be generated. The generated code contains a
76single function that produces the input module. By default its name is
77I<makeLLVMModule>. The B<-funcname> option overrides this default and allows
78you to control the name of the generated function. This is handy in conjunction
79with the B<-fragment> option when you only want B<llvm2cpp> to generate a
80single function that produces the module. With both options, such generated code
81could be I<#included> into another program.
82
83=item B<-fragment>
84
85This boolean option tells B<llvm2cpp> to generate only a program fragment. By
86deault B<llvm2cpp> generates a full program. With this option specified, only a
87single function that generates the input module will be generated.
88
Reid Spencere497ff12006-05-30 19:56:31 +000089=back
90
91=head1 EXIT STATUS
92
93If B<llvm2cpp> succeeds, it will exit with 0. Otherwise, if an error
94occurs, it will exit with a non-zero value.
95
96=head1 SEE ALSO
97
98L<llvm-as|llvm-as>
99
100=head1 AUTHORS
101
102Maintained by the LLVM Team (L<http://llvm.org>).
103
104=cut