blob: 4bc692279b9e4adb4de3fd62ea2da8ee0ee34298 [file] [log] [blame]
Peter Collingbourne4e380b02013-09-19 22:15:52 +00001//===-- llvm-lto: a simple command-line program to link modules with LTO --===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This program takes in a list of bitcode files, links them, performs link-time
11// optimization, and outputs an object file.
12//
13//===----------------------------------------------------------------------===//
14
Rafael Espindola282a4702013-10-31 20:51:58 +000015#include "llvm/ADT/StringSet.h"
Teresa Johnson91a88bb2015-10-19 14:30:44 +000016#include "llvm/Bitcode/ReaderWriter.h"
Rafael Espindola0b385c72013-09-30 16:39:19 +000017#include "llvm/CodeGen/CommandFlags.h"
Mehdi Amini354f5202015-11-19 05:52:29 +000018#include "llvm/IR/DiagnosticPrinter.h"
Teresa Johnson91a88bb2015-10-19 14:30:44 +000019#include "llvm/IR/LLVMContext.h"
Peter Collingbourne4ccf0f12013-09-24 23:52:22 +000020#include "llvm/LTO/LTOCodeGenerator.h"
21#include "llvm/LTO/LTOModule.h"
Teresa Johnson91a88bb2015-10-19 14:30:44 +000022#include "llvm/Object/FunctionIndexObjectFile.h"
Peter Collingbourne4e380b02013-09-19 22:15:52 +000023#include "llvm/Support/CommandLine.h"
Benjamin Kramerd59664f2014-04-29 23:26:49 +000024#include "llvm/Support/FileSystem.h"
Peter Collingbourne4e380b02013-09-19 22:15:52 +000025#include "llvm/Support/ManagedStatic.h"
26#include "llvm/Support/PrettyStackTrace.h"
27#include "llvm/Support/Signals.h"
Peter Collingbourne4ccf0f12013-09-24 23:52:22 +000028#include "llvm/Support/TargetSelect.h"
Peter Collingbournec269ed52015-08-27 23:37:36 +000029#include "llvm/Support/ToolOutputFile.h"
Chandler Carruth07baed52014-01-13 08:04:33 +000030#include "llvm/Support/raw_ostream.h"
Peter Collingbournec269ed52015-08-27 23:37:36 +000031#include <list>
Peter Collingbourne4e380b02013-09-19 22:15:52 +000032
33using namespace llvm;
34
Peter Collingbourne070843d2015-03-19 22:01:00 +000035static cl::opt<char>
36OptLevel("O",
37 cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
38 "(default = '-O2')"),
39 cl::Prefix,
40 cl::ZeroOrMore,
41 cl::init('2'));
Peter Collingbourne4e380b02013-09-19 22:15:52 +000042
Duncan P. N. Exon Smithcff5fef2015-09-15 23:05:59 +000043static cl::opt<bool> DisableVerify(
44 "disable-verify", cl::init(false),
45 cl::desc("Do not run the verifier during the optimization pipeline"));
46
Rafael Espindola0b385c72013-09-30 16:39:19 +000047static cl::opt<bool>
48DisableInline("disable-inlining", cl::init(false),
49 cl::desc("Do not run the inliner pass"));
50
51static cl::opt<bool>
52DisableGVNLoadPRE("disable-gvn-loadpre", cl::init(false),
53 cl::desc("Do not run the GVN load PRE pass"));
54
Duncan P. N. Exon Smith30c92422014-10-01 18:36:03 +000055static cl::opt<bool>
Arnold Schwaighofereb1a38f2014-10-26 21:50:58 +000056DisableLTOVectorization("disable-lto-vectorization", cl::init(false),
57 cl::desc("Do not run loop or slp vectorization during LTO"));
58
59static cl::opt<bool>
Duncan P. N. Exon Smith30c92422014-10-01 18:36:03 +000060UseDiagnosticHandler("use-diagnostic-handler", cl::init(false),
61 cl::desc("Use a diagnostic handler to test the handler interface"));
62
Teresa Johnsonf72278f2015-11-02 18:02:11 +000063static cl::opt<bool>
64 ThinLTO("thinlto", cl::init(false),
65 cl::desc("Only write combined global index for ThinLTO backends"));
Teresa Johnson91a88bb2015-10-19 14:30:44 +000066
Tobias Edler von Koch49c9a6e2015-11-20 00:13:05 +000067static cl::opt<bool>
68SaveModuleFile("save-merged-module", cl::init(false),
69 cl::desc("Write merged LTO module to file before CodeGen"));
70
Rafael Espindola0b385c72013-09-30 16:39:19 +000071static cl::list<std::string>
72InputFilenames(cl::Positional, cl::OneOrMore,
73 cl::desc("<input bitcode files>"));
74
75static cl::opt<std::string>
76OutputFilename("o", cl::init(""),
77 cl::desc("Override output filename"),
78 cl::value_desc("filename"));
Peter Collingbourne4e380b02013-09-19 22:15:52 +000079
Rafael Espindoladafc53d2013-10-02 14:12:56 +000080static cl::list<std::string>
81ExportedSymbols("exported-symbol",
82 cl::desc("Symbol to export from the resulting object file"),
83 cl::ZeroOrMore);
84
Rafael Espindolacda29112013-10-03 18:29:09 +000085static cl::list<std::string>
86DSOSymbols("dso-symbol",
87 cl::desc("Symbol to put in the symtab in the resulting dso"),
88 cl::ZeroOrMore);
Rafael Espindoladafc53d2013-10-02 14:12:56 +000089
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +000090static cl::opt<bool> ListSymbolsOnly(
91 "list-symbols-only", cl::init(false),
92 cl::desc("Instead of running LTO, list the symbols in each IR file"));
93
Manman Ren6487ce92015-02-24 00:45:56 +000094static cl::opt<bool> SetMergedModule(
95 "set-merged-module", cl::init(false),
96 cl::desc("Use the first input module as the merged module"));
97
Peter Collingbournec269ed52015-08-27 23:37:36 +000098static cl::opt<unsigned> Parallelism("j", cl::Prefix, cl::init(1),
99 cl::desc("Number of backend threads"));
100
Rafael Espindola282a4702013-10-31 20:51:58 +0000101namespace {
102struct ModuleInfo {
103 std::vector<bool> CanBeHidden;
104};
105}
106
Benjamin Kramerf044d3f2015-03-09 16:23:46 +0000107static void handleDiagnostics(lto_codegen_diagnostic_severity_t Severity,
108 const char *Msg, void *) {
Yunzhong Gaoef436f02015-11-10 18:52:48 +0000109 errs() << "llvm-lto: ";
Duncan P. N. Exon Smith30c92422014-10-01 18:36:03 +0000110 switch (Severity) {
111 case LTO_DS_NOTE:
112 errs() << "note: ";
113 break;
114 case LTO_DS_REMARK:
115 errs() << "remark: ";
116 break;
117 case LTO_DS_ERROR:
118 errs() << "error: ";
119 break;
120 case LTO_DS_WARNING:
121 errs() << "warning: ";
122 break;
123 }
124 errs() << Msg << "\n";
125}
126
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000127static std::string CurrentActivity;
Mehdi Amini354f5202015-11-19 05:52:29 +0000128static void diagnosticHandler(const DiagnosticInfo &DI) {
129 raw_ostream &OS = errs();
130 OS << "llvm-lto: ";
131 switch (DI.getSeverity()) {
132 case DS_Error:
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000133 OS << "error";
Mehdi Amini354f5202015-11-19 05:52:29 +0000134 break;
135 case DS_Warning:
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000136 OS << "warning";
Mehdi Amini354f5202015-11-19 05:52:29 +0000137 break;
138 case DS_Remark:
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000139 OS << "remark";
Mehdi Amini354f5202015-11-19 05:52:29 +0000140 break;
141 case DS_Note:
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000142 OS << "note";
Mehdi Amini354f5202015-11-19 05:52:29 +0000143 break;
144 }
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000145 if (!CurrentActivity.empty())
146 OS << ' ' << CurrentActivity;
147 OS << ": ";
Mehdi Amini354f5202015-11-19 05:52:29 +0000148
149 DiagnosticPrinterRawOStream DP(OS);
150 DI.print(DP);
151 OS << '\n';
152
153 if (DI.getSeverity() == DS_Error)
154 exit(1);
155}
156
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000157static void diagnosticHandlerWithContenxt(const DiagnosticInfo &DI,
158 void *Context) {
159 diagnosticHandler(DI);
160}
161
Rafael Espindola5e128db2015-12-04 00:45:57 +0000162static void error(const Twine &Msg) {
163 errs() << "llvm-lto: " << Msg << '\n';
164 exit(1);
165}
166
167static void error(std::error_code EC, const Twine &Prefix) {
168 if (EC)
169 error(Prefix + ": " + EC.message());
170}
171
172template <typename T>
173static void error(const ErrorOr<T> &V, const Twine &Prefix) {
174 error(V.getError(), Prefix);
175}
176
Benjamin Kramerf044d3f2015-03-09 16:23:46 +0000177static std::unique_ptr<LTOModule>
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000178getLocalLTOModule(StringRef Path, std::unique_ptr<MemoryBuffer> &Buffer,
Rafael Espindola5e128db2015-12-04 00:45:57 +0000179 const TargetOptions &Options) {
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000180 ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
181 MemoryBuffer::getFile(Path);
Rafael Espindola5e128db2015-12-04 00:45:57 +0000182 error(BufferOrErr, "error loading file '" + Path + "'");
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000183 Buffer = std::move(BufferOrErr.get());
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000184 CurrentActivity = ("loading file '" + Path + "'").str();
185 ErrorOr<std::unique_ptr<LTOModule>> Ret = LTOModule::createInLocalContext(
186 Buffer->getBufferStart(), Buffer->getBufferSize(), Options, Path);
187 CurrentActivity = "";
188 return std::move(*Ret);
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000189}
190
191/// \brief List symbols in each IR file.
192///
193/// The main point here is to provide lit-testable coverage for the LTOModule
194/// functionality that's exposed by the C API to list symbols. Moreover, this
195/// provides testing coverage for modules that have been created in their own
196/// contexts.
Rafael Espindola5e128db2015-12-04 00:45:57 +0000197static void listSymbols(const TargetOptions &Options) {
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000198 for (auto &Filename : InputFilenames) {
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000199 std::unique_ptr<MemoryBuffer> Buffer;
200 std::unique_ptr<LTOModule> Module =
Rafael Espindola5e128db2015-12-04 00:45:57 +0000201 getLocalLTOModule(Filename, Buffer, Options);
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000202
203 // List the symbols.
204 outs() << Filename << ":\n";
205 for (int I = 0, E = Module->getSymbolCount(); I != E; ++I)
206 outs() << Module->getSymbolName(I) << "\n";
207 }
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000208}
209
Teresa Johnson91a88bb2015-10-19 14:30:44 +0000210/// Create a combined index file from the input IR files and write it.
211///
212/// This is meant to enable testing of ThinLTO combined index generation,
213/// currently available via the gold plugin via -thinlto.
Rafael Espindola5e128db2015-12-04 00:45:57 +0000214static void createCombinedFunctionIndex() {
Teresa Johnson91a88bb2015-10-19 14:30:44 +0000215 FunctionInfoIndex CombinedIndex;
216 uint64_t NextModuleId = 0;
217 for (auto &Filename : InputFilenames) {
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000218 CurrentActivity = "loading file '" + Filename + "'";
Teresa Johnson6290dbc2015-11-21 21:55:48 +0000219 ErrorOr<std::unique_ptr<FunctionInfoIndex>> IndexOrErr =
Teresa Johnson6b923162015-11-23 19:19:11 +0000220 llvm::getFunctionIndexForFile(Filename, diagnosticHandler);
Teresa Johnson6290dbc2015-11-21 21:55:48 +0000221 std::unique_ptr<FunctionInfoIndex> Index = std::move(IndexOrErr.get());
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000222 CurrentActivity = "";
Teresa Johnson6290dbc2015-11-21 21:55:48 +0000223 // Skip files without a function summary.
224 if (!Index)
225 continue;
Teresa Johnson91a88bb2015-10-19 14:30:44 +0000226 CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
227 }
228 std::error_code EC;
229 assert(!OutputFilename.empty());
230 raw_fd_ostream OS(OutputFilename + ".thinlto.bc", EC,
231 sys::fs::OpenFlags::F_None);
Rafael Espindola5e128db2015-12-04 00:45:57 +0000232 error(EC, "error opening the file '" + OutputFilename + ".thinlto.bc'");
Teresa Johnson3da931f2015-10-19 19:06:06 +0000233 WriteFunctionSummaryToFile(CombinedIndex, OS);
Teresa Johnson91a88bb2015-10-19 14:30:44 +0000234 OS.close();
Teresa Johnson91a88bb2015-10-19 14:30:44 +0000235}
236
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000237int main(int argc, char **argv) {
238 // Print a stack trace if we signal out.
239 sys::PrintStackTraceOnErrorSignal();
240 PrettyStackTraceProgram X(argc, argv);
241
242 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
243 cl::ParseCommandLineOptions(argc, argv, "llvm LTO linker\n");
244
Rafael Espindola5e128db2015-12-04 00:45:57 +0000245 if (OptLevel < '0' || OptLevel > '3')
246 error("optimization level must be between 0 and 3");
Peter Collingbourne070843d2015-03-19 22:01:00 +0000247
Peter Collingbourne4ccf0f12013-09-24 23:52:22 +0000248 // Initialize the configured targets.
249 InitializeAllTargets();
250 InitializeAllTargetMCs();
251 InitializeAllAsmPrinters();
252 InitializeAllAsmParsers();
253
Rafael Espindola0b385c72013-09-30 16:39:19 +0000254 // set up the TargetOptions for the machine
Eli Benderskyf0f21002014-02-19 17:09:35 +0000255 TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
Rafael Espindola0b385c72013-09-30 16:39:19 +0000256
Rafael Espindola5e128db2015-12-04 00:45:57 +0000257 if (ListSymbolsOnly) {
258 listSymbols(Options);
259 return 0;
260 }
Duncan P. N. Exon Smithf9abf4f2014-12-17 02:00:38 +0000261
Rafael Espindola5e128db2015-12-04 00:45:57 +0000262 if (ThinLTO) {
263 createCombinedFunctionIndex();
264 return 0;
265 }
Teresa Johnson91a88bb2015-10-19 14:30:44 +0000266
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000267 unsigned BaseArg = 0;
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000268
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000269 LLVMContext Context;
270 Context.setDiagnosticHandler(diagnosticHandlerWithContenxt, nullptr, true);
271
272 LTOCodeGenerator CodeGen(Context);
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000273
Duncan P. N. Exon Smith30c92422014-10-01 18:36:03 +0000274 if (UseDiagnosticHandler)
275 CodeGen.setDiagnosticHandler(handleDiagnostics, nullptr);
276
Peter Collingbourne44ee84e2015-08-21 22:57:17 +0000277 CodeGen.setCodePICModel(RelocModel);
James Molloy951e5292014-04-14 13:54:16 +0000278
Peter Collingbourne4ccf0f12013-09-24 23:52:22 +0000279 CodeGen.setDebugInfo(LTO_DEBUG_MODEL_DWARF);
Rafael Espindola0b385c72013-09-30 16:39:19 +0000280 CodeGen.setTargetOptions(Options);
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000281
Rafael Espindola282a4702013-10-31 20:51:58 +0000282 llvm::StringSet<llvm::MallocAllocator> DSOSymbolsSet;
283 for (unsigned i = 0; i < DSOSymbols.size(); ++i)
284 DSOSymbolsSet.insert(DSOSymbols[i]);
285
286 std::vector<std::string> KeptDSOSyms;
287
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000288 for (unsigned i = BaseArg; i < InputFilenames.size(); ++i) {
Rafael Espindolaa7612b42015-12-04 16:14:31 +0000289 CurrentActivity = "loading file '" + InputFilenames[i] + "'";
290 ErrorOr<std::unique_ptr<LTOModule>> ModuleOrErr =
291 LTOModule::createFromFile(Context, InputFilenames[i].c_str(), Options);
292 std::unique_ptr<LTOModule> &Module = *ModuleOrErr;
293 CurrentActivity = "";
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000294
Peter Collingbourne552174392015-08-21 19:09:42 +0000295 unsigned NumSyms = Module->getSymbolCount();
296 for (unsigned I = 0; I < NumSyms; ++I) {
297 StringRef Name = Module->getSymbolName(I);
298 if (!DSOSymbolsSet.count(Name))
299 continue;
300 lto_symbol_attributes Attrs = Module->getSymbolAttributes(I);
301 unsigned Scope = Attrs & LTO_SYMBOL_SCOPE_MASK;
302 if (Scope != LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN)
303 KeptDSOSyms.push_back(Name);
304 }
Manman Ren6487ce92015-02-24 00:45:56 +0000305
306 // We use the first input module as the destination module when
307 // SetMergedModule is true.
308 if (SetMergedModule && i == BaseArg) {
309 // Transfer ownership to the code generator.
Peter Collingbourne9c8909d2015-08-24 22:22:53 +0000310 CodeGen.setModule(std::move(Module));
Yunzhong Gao46261a72015-09-11 20:01:53 +0000311 } else if (!CodeGen.addModule(Module.get())) {
312 // Print a message here so that we know addModule() did not abort.
313 errs() << argv[0] << ": error adding file '" << InputFilenames[i] << "'\n";
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000314 return 1;
Yunzhong Gao46261a72015-09-11 20:01:53 +0000315 }
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000316 }
317
Rafael Espindoladafc53d2013-10-02 14:12:56 +0000318 // Add all the exported symbols to the table of symbols to preserve.
319 for (unsigned i = 0; i < ExportedSymbols.size(); ++i)
320 CodeGen.addMustPreserveSymbol(ExportedSymbols[i].c_str());
321
Rafael Espindolacda29112013-10-03 18:29:09 +0000322 // Add all the dso symbols to the table of symbols to expose.
Rafael Espindola282a4702013-10-31 20:51:58 +0000323 for (unsigned i = 0; i < KeptDSOSyms.size(); ++i)
324 CodeGen.addMustPreserveSymbol(KeptDSOSyms[i].c_str());
Rafael Espindolacda29112013-10-03 18:29:09 +0000325
Akira Hatanaka23b5f672015-01-30 01:14:28 +0000326 // Set cpu and attrs strings for the default target/subtarget.
327 CodeGen.setCpu(MCPU.c_str());
328
Peter Collingbourne070843d2015-03-19 22:01:00 +0000329 CodeGen.setOptLevel(OptLevel - '0');
330
Tom Roederfd1bc602014-04-25 21:46:51 +0000331 std::string attrs;
332 for (unsigned i = 0; i < MAttrs.size(); ++i) {
333 if (i > 0)
334 attrs.append(",");
335 attrs.append(MAttrs[i]);
336 }
337
338 if (!attrs.empty())
339 CodeGen.setAttr(attrs.c_str());
340
Tobias Edler von Koch49c9a6e2015-11-20 00:13:05 +0000341 if (FileType.getNumOccurrences())
342 CodeGen.setFileType(FileType);
343
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000344 if (!OutputFilename.empty()) {
Duncan P. N. Exon Smithcff5fef2015-09-15 23:05:59 +0000345 if (!CodeGen.optimize(DisableVerify, DisableInline, DisableGVNLoadPRE,
Yunzhong Gao8e348cc2015-11-17 19:48:12 +0000346 DisableLTOVectorization)) {
347 // Diagnostic messages should have been printed by the handler.
348 errs() << argv[0] << ": error optimizing the code\n";
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000349 return 1;
350 }
351
Tobias Edler von Koch49c9a6e2015-11-20 00:13:05 +0000352 if (SaveModuleFile) {
353 std::string ModuleFilename = OutputFilename;
354 ModuleFilename += ".merged.bc";
355 std::string ErrMsg;
356
357 if (!CodeGen.writeMergedModules(ModuleFilename.c_str())) {
358 errs() << argv[0] << ": writing merged module failed.\n";
359 return 1;
360 }
361 }
362
Peter Collingbournec269ed52015-08-27 23:37:36 +0000363 std::list<tool_output_file> OSs;
364 std::vector<raw_pwrite_stream *> OSPtrs;
365 for (unsigned I = 0; I != Parallelism; ++I) {
366 std::string PartFilename = OutputFilename;
367 if (Parallelism != 1)
368 PartFilename += "." + utostr(I);
369 std::error_code EC;
370 OSs.emplace_back(PartFilename, EC, sys::fs::F_None);
371 if (EC) {
372 errs() << argv[0] << ": error opening the file '" << PartFilename
373 << "': " << EC.message() << "\n";
374 return 1;
375 }
376 OSPtrs.push_back(&OSs.back().os());
377 }
378
Yunzhong Gao8e348cc2015-11-17 19:48:12 +0000379 if (!CodeGen.compileOptimized(OSPtrs)) {
380 // Diagnostic messages should have been printed by the handler.
381 errs() << argv[0] << ": error compiling the code\n";
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000382 return 1;
383 }
384
Peter Collingbournec269ed52015-08-27 23:37:36 +0000385 for (tool_output_file &OS : OSs)
386 OS.keep();
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000387 } else {
Peter Collingbournec269ed52015-08-27 23:37:36 +0000388 if (Parallelism != 1) {
389 errs() << argv[0] << ": -j must be specified together with -o\n";
390 return 1;
391 }
392
Tobias Edler von Koch49c9a6e2015-11-20 00:13:05 +0000393 if (SaveModuleFile) {
394 errs() << argv[0] << ": -save-merged-module must be specified with -o\n";
395 return 1;
396 }
397
Craig Toppere6cb63e2014-04-25 04:24:47 +0000398 const char *OutputName = nullptr;
Duncan P. N. Exon Smithcff5fef2015-09-15 23:05:59 +0000399 if (!CodeGen.compile_to_file(&OutputName, DisableVerify, DisableInline,
Yunzhong Gao8e348cc2015-11-17 19:48:12 +0000400 DisableGVNLoadPRE, DisableLTOVectorization)) {
401 // Diagnostic messages should have been printed by the handler.
402 errs() << argv[0] << ": error compiling the code\n";
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000403 return 1;
404 }
405
406 outs() << "Wrote native object file '" << OutputName << "'\n";
407 }
408
Peter Collingbourne4e380b02013-09-19 22:15:52 +0000409 return 0;
410}