| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // If there was an earlier error, do not attempt to push bytes to the | 179 // If there was an earlier error, do not attempt to push bytes to the |
| 180 // QueueStreamer. Otherwise the thread could become blocked. | 180 // QueueStreamer. Otherwise the thread could become blocked. |
| 181 if (HadError.load()) | 181 if (HadError.load()) |
| 182 return true; | 182 return true; |
| 183 return InputStream->PutBytes( | 183 return InputStream->PutBytes( |
| 184 const_cast<unsigned char *>( | 184 const_cast<unsigned char *>( |
| 185 reinterpret_cast<const unsigned char *>(Data)), | 185 reinterpret_cast<const unsigned char *>(Data)), |
| 186 NumBytes) != NumBytes; | 186 NumBytes) != NumBytes; |
| 187 } | 187 } |
| 188 | 188 |
| 189 void BrowserCompileServer::setFatalError(const IceString &Reason) { | 189 void BrowserCompileServer::setFatalError(const std::string &Reason) { |
| 190 HadError.store(true); | 190 HadError.store(true); |
| 191 Ctx->getStrError() << Reason; | 191 Ctx->getStrError() << Reason; |
| 192 // Make sure that the QueueStreamer is not stuck by signaling an early end. | 192 // Make sure that the QueueStreamer is not stuck by signaling an early end. |
| 193 InputStream->SetDone(); | 193 InputStream->SetDone(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 ErrorCode &BrowserCompileServer::getErrorCode() { | 196 ErrorCode &BrowserCompileServer::getErrorCode() { |
| 197 if (HadError.load()) { | 197 if (HadError.load()) { |
| 198 // HadError means report_fatal_error is called. Make sure that the | 198 // HadError means report_fatal_error is called. Make sure that the |
| 199 // LastError is not EC_None. We don't know the type of error so just pick | 199 // LastError is not EC_None. We don't know the type of error so just pick |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 llvm::report_fatal_error("no browser hookups"); | 240 llvm::report_fatal_error("no browser hookups"); |
| 241 } | 241 } |
| 242 | 242 |
| 243 ErrorCode &BrowserCompileServer::getErrorCode() { | 243 ErrorCode &BrowserCompileServer::getErrorCode() { |
| 244 llvm::report_fatal_error("no browser hookups"); | 244 llvm::report_fatal_error("no browser hookups"); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // end of namespace Ice | 247 } // end of namespace Ice |
| 248 | 248 |
| 249 #endif // PNACL_BROWSER_TRANSLATOR | 249 #endif // PNACL_BROWSER_TRANSLATOR |
| OLD | NEW |