| OLD | NEW |
| 1 //===- subzero/src/IceBrowserCompileServer.cpp - Browser compile server ---===// | 1 //===- subzero/src/IceBrowserCompileServer.cpp - Browser compile server ---===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return nullptr; | 87 return nullptr; |
| 88 } | 88 } |
| 89 | 89 |
| 90 struct nacl_irt_pnacl_compile_funcs SubzeroCallbacks { | 90 struct nacl_irt_pnacl_compile_funcs SubzeroCallbacks { |
| 91 &onInitCallback, &onDataCallback, &onEndCallback | 91 &onInitCallback, &onDataCallback, &onEndCallback |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 std::unique_ptr<llvm::raw_fd_ostream> getOutputStream(int FD) { | 94 std::unique_ptr<llvm::raw_fd_ostream> getOutputStream(int FD) { |
| 95 if (FD <= 0) | 95 if (FD <= 0) |
| 96 llvm::report_fatal_error("Invalid output FD"); | 96 llvm::report_fatal_error("Invalid output FD"); |
| 97 const bool CloseOnDtor = true; | 97 constexpr bool CloseOnDtor = true; |
| 98 const bool Unbuffered = false; | 98 constexpr bool Unbuffered = false; |
| 99 return std::unique_ptr<llvm::raw_fd_ostream>( | 99 return std::unique_ptr<llvm::raw_fd_ostream>( |
| 100 new llvm::raw_fd_ostream(FD, CloseOnDtor, Unbuffered)); | 100 new llvm::raw_fd_ostream(FD, CloseOnDtor, Unbuffered)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void fatalErrorHandler(void *UserData, const std::string &Reason, | 103 void fatalErrorHandler(void *UserData, const std::string &Reason, |
| 104 bool GenCrashDialog) { | 104 bool GenCrashDialog) { |
| 105 (void)GenCrashDialog; | 105 (void)GenCrashDialog; |
| 106 BrowserCompileServer *Server = | 106 BrowserCompileServer *Server = |
| 107 reinterpret_cast<BrowserCompileServer *>(UserData); | 107 reinterpret_cast<BrowserCompileServer *>(UserData); |
| 108 Server->setFatalError(Reason); | 108 Server->setFatalError(Reason); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 this->getCompiler().run(ExtraFlags, *Ctx.get(), | 189 this->getCompiler().run(ExtraFlags, *Ctx.get(), |
| 190 // Retain original reference, but the compiler | 190 // Retain original reference, but the compiler |
| 191 // (LLVM's MemoryObject) wants to handle deletion. | 191 // (LLVM's MemoryObject) wants to handle deletion. |
| 192 std::unique_ptr<llvm::DataStreamer>(InputStream)); | 192 std::unique_ptr<llvm::DataStreamer>(InputStream)); |
| 193 }); | 193 }); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // end of namespace Ice | 196 } // end of namespace Ice |
| 197 | 197 |
| 198 #endif // PNACL_BROWSER_TRANSLATOR | 198 #endif // PNACL_BROWSER_TRANSLATOR |
| OLD | NEW |