OLD | NEW |
1 /* Copyright 2013 The Native Client Authors. All rights reserved. | 1 /* Copyright 2013 The Native Client Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can | 2 * Use of this source code is governed by a BSD-style license that can |
3 * be found in the LICENSE file. | 3 * be found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 //===-- pnacl-freeze.cpp - The low-level NaCl bitcode freezer --------===// | 6 //===-- pnacl-freeze.cpp - The low-level NaCl bitcode freezer --------===// |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Generates NaCl pexe wire format. | 10 // Generates NaCl pexe wire format. |
(...skipping 23 matching lines...) Expand all Loading... |
34 cl::value_desc("filename"), cl::init("-")); | 34 cl::value_desc("filename"), cl::init("-")); |
35 | 35 |
36 static cl::opt<std::string> | 36 static cl::opt<std::string> |
37 InputFilename(cl::Positional, cl::desc("<pexe file>"), cl::init("-")); | 37 InputFilename(cl::Positional, cl::desc("<pexe file>"), cl::init("-")); |
38 | 38 |
39 static void WriteOutputFile(const Module *M) { | 39 static void WriteOutputFile(const Module *M) { |
40 | 40 |
41 std::string ErrorInfo; | 41 std::string ErrorInfo; |
42 OwningPtr<tool_output_file> Out | 42 OwningPtr<tool_output_file> Out |
43 (new tool_output_file(OutputFilename.c_str(), ErrorInfo, | 43 (new tool_output_file(OutputFilename.c_str(), ErrorInfo, |
44 » » » raw_fd_ostream::F_Binary)); | 44 sys::fs::F_Binary)); |
45 if (!ErrorInfo.empty()) { | 45 if (!ErrorInfo.empty()) { |
46 errs() << ErrorInfo << '\n'; | 46 errs() << ErrorInfo << '\n'; |
47 exit(1); | 47 exit(1); |
48 } | 48 } |
49 | 49 |
50 NaClWriteBitcodeToFile(M, Out->os(), /* AcceptSupportedOnly = */ false); | 50 NaClWriteBitcodeToFile(M, Out->os(), /* AcceptSupportedOnly = */ false); |
51 | 51 |
52 // Declare success. | 52 // Declare success. |
53 Out->keep(); | 53 Out->keep(); |
54 } | 54 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (ErrorMessage.size()) | 86 if (ErrorMessage.size()) |
87 errs() << ErrorMessage << "\n"; | 87 errs() << ErrorMessage << "\n"; |
88 else | 88 else |
89 errs() << "bitcode didn't read correctly.\n"; | 89 errs() << "bitcode didn't read correctly.\n"; |
90 return 1; | 90 return 1; |
91 } | 91 } |
92 | 92 |
93 WriteOutputFile(M.get()); | 93 WriteOutputFile(M.get()); |
94 return 0; | 94 return 0; |
95 } | 95 } |
OLD | NEW |