+ }
+
+ std::error_code EC;
+ std::unique_ptr<tool_output_file> Out(
+ new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ if (EC) {
+ errs() << EC.message() << '\n';
+ exit(1);
+ }
+
+ if (Force || !CheckBitcodeOutputToConsole(Out->os(), true))
+ WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder,
+ EmitFunctionSummary);
+
+ // Declare success.
+ Out->keep();
+}
+
+int main(int argc, char **argv) {
+ // Print a stack trace if we signal out.
+ sys::PrintStackTraceOnErrorSignal();
+ PrettyStackTraceProgram X(argc, argv);
+ LLVMContext &Context = getGlobalContext();
+ llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
+ cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n");
+
+ // Parse the file now...
+ SMDiagnostic Err;
+ std::unique_ptr<Module> M = parseAssemblyFile(InputFilename, Err, Context);
+ if (!M.get()) {
+ Err.print(argv[0], errs());
+ return 1;
+ }
+
+ if (!DisableVerify) {
+ std::string ErrorStr;
+ raw_string_ostream OS(ErrorStr);
+ if (verifyModule(*M.get(), &OS)) {
+ errs() << argv[0]
+ << ": assembly parsed, but does not verify as correct!\n";
+ errs() << OS.str();