Lines Matching +full:- +full:- +full:native +full:- +full:file
2 # Wrapper around LLVM tools to generate a native .o from llvm-gxx using an
3 # LLVM back-end (CBE by default).
17 # process command-line options.
18 # most of these are passed on to llvm-gxx.
21 if ($ARGV[$i] =~ /-mllvm-backend=([a-z0-9]*)/) {
23 if ($ProgramName =~ /llvm-native-gxx/) {
25 --$i;
27 } elsif ($ARGV[$i] eq "-E") {
29 } elsif ($ARGV[$i] eq "-c") {
32 } elsif ($ARGV[$i] eq "-v") {
35 } elsif ($ARGV[$i] eq "-o") {
37 } elsif ($ARGV[$i] eq "-save-temps") {
42 } elsif ($ARGV[$i] =~ /^-L/) {
45 } elsif ($ARGV[$i] =~ /^-l/) {
56 if ($ProgramName =~ /llvm-native-gxx/) {
58 } elsif ($ProgramName =~ /native-build/) {
64 die "Can't figure out name of output file.\n"
66 && (($ProgramName !~ /native-build/)
69 print "Warning: defaulting output file name ",
72 if ($ProgramName =~ /llvm-native-gxx/) {
74 } elsif ($ProgramName =~ /native-build/) {
101 $LinkedBCFile = "/tmp/nativebuild-$$.llvm.bc";
103 run "llvm-link -o $LinkedBCFile $BCFiles";
115 $GeneratedCode = "/tmp/nativebuild-$$.c";
117 run "llc -march=c -f -o $GeneratedCode $BCFile";
122 $GeneratedCode = "/tmp/nativebuild-$$.s";
124 run "llc -f -o $GeneratedCode $BCFile";
128 run "gcc $GCCOptions $GeneratedCode -o $OutputFile $LibDirs $Libs";
142 } else { # gccld messes with the output file name
148 run "llc -march=c -f -o $GeneratedCode $BCFile";
151 run "llc -f -o $GeneratedCode $BCFile";
155 $NativeGCCOptions = "-c";
157 run "gcc $NativeGCCOptions $GeneratedCode -o $OutputFile";
162 # guess the name of the output file, if -o was not specified.
164 print "Output file is $OutputFile\n" if $Verbose;
166 if ($ProgramName eq /native-build/) {
169 } elsif ($ProgramName =~ /llvm-native-gxx/) {
170 # build the llvm-gxx command line.
171 $LLVMGCCCommand = join (" ", ("llvm-g++", @ARGV));
184 llvm-native-gxx
188 llvm-native-g++ [OPTIONS...] FILE
190 native-build [OPTIONS...] FILE
194 llvm-native-g++ is a wrapper around the LLVM command-line tools which generates
195 a native object (.o) file by compiling FILE with llvm-g++, and then running
196 an LLVM back-end (CBE by default) over the resulting bitcode, and then
197 compiling the resulting code to a native object file.
199 If called as "native-build", it compiles bitcode to native code, and takes
204 llvm-native-g++ takes the same options as llvm-gcc. All options
205 except -mllvm-backend=... are passed on to llvm-g++.
209 =item -mllvm-backend=BACKEND
211 Use BACKEND for native code generation.
213 =item -v
215 Print command lines that llvm-native-g++ runs.
217 =item -o FILE
219 llvm-native-g++ tries to guess the name of the llvm-g++ output file by looking
221 or C++ source file named on the command line, and turns its suffix into .o. See
224 =item -save-temps
226 Save temporary files used by llvm-native-g++ (and llvm-g++, and g++).
232 llvm-native-g++ only handles the case where llvm-g++ compiles a single
233 file per invocation. llvm-native-g++ has weak command-line argument
236 This manual page does not adequately document native-build mode.
238 llvm-native-g++ is pretty gross because it represents the blind merging of two
239 other scripts that predated it. It could use some code clean-up.