| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 void BrowserCompileServer::getParsedFlags(uint32_t NumThreads, int argc, | 165 void BrowserCompileServer::getParsedFlags(uint32_t NumThreads, int argc, |
| 166 char **argv) { | 166 char **argv) { |
| 167 ClFlags::parseFlags(argc, argv); | 167 ClFlags::parseFlags(argc, argv); |
| 168 ClFlags::getParsedClFlags(*Flags); | 168 ClFlags::getParsedClFlags(*Flags); |
| 169 ClFlags::getParsedClFlagsExtra(*ExtraFlags); | 169 ClFlags::getParsedClFlagsExtra(*ExtraFlags); |
| 170 // Set some defaults which aren't specified via the argv string. | 170 // Set some defaults which aren't specified via the argv string. |
| 171 Flags->setNumTranslationThreads(NumThreads); | 171 Flags->setNumTranslationThreads(NumThreads); |
| 172 Flags->setUseSandboxing(true); | 172 Flags->setUseSandboxing(true); |
| 173 Flags->setOutFileType(FT_Elf); | 173 Flags->setOutFileType(FT_Elf); |
| 174 Flags->setTargetArch(getTargetArch()); | 174 Flags->setTargetArch(getTargetArch()); |
| 175 // Make the prefixes short to reduce the chance that string construction will | |
| 176 // have to resort to malloc(). Note that this won't change anything if the | |
| 177 // pexe was finalize with "--no-strip-syms". TODO(stichnot): This will be | |
| 178 // unnecessary when we stop directly constructing strings that are used for | |
| 179 // names and lookup keys. | |
| 180 Flags->setDefaultFunctionPrefix("F"); | |
| 181 Flags->setDefaultGlobalPrefix("G"); | |
| 182 ExtraFlags->setBuildOnRead(true); | 175 ExtraFlags->setBuildOnRead(true); |
| 183 ExtraFlags->setInputFileFormat(llvm::PNaClFormat); | 176 ExtraFlags->setInputFileFormat(llvm::PNaClFormat); |
| 184 } | 177 } |
| 185 | 178 |
| 186 bool BrowserCompileServer::pushInputBytes(const void *Data, size_t NumBytes) { | 179 bool BrowserCompileServer::pushInputBytes(const void *Data, size_t NumBytes) { |
| 187 // If there was an earlier error, do not attempt to push bytes to the | 180 // If there was an earlier error, do not attempt to push bytes to the |
| 188 // QueueStreamer. Otherwise the thread could become blocked. | 181 // QueueStreamer. Otherwise the thread could become blocked. |
| 189 if (HadError.load()) | 182 if (HadError.load()) |
| 190 return true; | 183 return true; |
| 191 return InputStream->PutBytes( | 184 return InputStream->PutBytes( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 llvm::report_fatal_error("no browser hookups"); | 241 llvm::report_fatal_error("no browser hookups"); |
| 249 } | 242 } |
| 250 | 243 |
| 251 ErrorCode &BrowserCompileServer::getErrorCode() { | 244 ErrorCode &BrowserCompileServer::getErrorCode() { |
| 252 llvm::report_fatal_error("no browser hookups"); | 245 llvm::report_fatal_error("no browser hookups"); |
| 253 } | 246 } |
| 254 | 247 |
| 255 } // end of namespace Ice | 248 } // end of namespace Ice |
| 256 | 249 |
| 257 #endif // PNACL_BROWSER_TRANSLATOR | 250 #endif // PNACL_BROWSER_TRANSLATOR |
| OLD | NEW |