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-thaw.cpp - The low-level NaCl bitcode thawer ----------------===// | 6 //===-- pnacl-thaw.cpp - The low-level NaCl bitcode thawer ----------------===// |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Converts NaCl wire format back to LLVM bitcode. | 10 // Converts NaCl wire format back to LLVM bitcode. |
(...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("<frozen file>"), cl::init("-")); | 37 InputFilename(cl::Positional, cl::desc("<frozen 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 WriteBitcodeToFile(M, Out->os()); | 50 WriteBitcodeToFile(M, Out->os()); |
51 | 51 |
52 // Declare success. | 52 // Declare success. |
53 Out->keep(); | 53 Out->keep(); |
54 } | 54 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (ErrorMessage.size()) | 89 if (ErrorMessage.size()) |
90 errs() << ErrorMessage << "\n"; | 90 errs() << ErrorMessage << "\n"; |
91 else | 91 else |
92 errs() << "bitcode didn't read correctly.\n"; | 92 errs() << "bitcode didn't read correctly.\n"; |
93 return 1; | 93 return 1; |
94 } | 94 } |
95 | 95 |
96 WriteOutputFile(M.get()); | 96 WriteOutputFile(M.get()); |
97 return 0; | 97 return 0; |
98 } | 98 } |
OLD | NEW |