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"); |
175 ExtraFlags->setBuildOnRead(true); | 182 ExtraFlags->setBuildOnRead(true); |
176 ExtraFlags->setInputFileFormat(llvm::PNaClFormat); | 183 ExtraFlags->setInputFileFormat(llvm::PNaClFormat); |
177 } | 184 } |
178 | 185 |
179 bool BrowserCompileServer::pushInputBytes(const void *Data, size_t NumBytes) { | 186 bool BrowserCompileServer::pushInputBytes(const void *Data, size_t NumBytes) { |
180 // If there was an earlier error, do not attempt to push bytes to the | 187 // If there was an earlier error, do not attempt to push bytes to the |
181 // QueueStreamer. Otherwise the thread could become blocked. | 188 // QueueStreamer. Otherwise the thread could become blocked. |
182 if (HadError.load()) | 189 if (HadError.load()) |
183 return true; | 190 return true; |
184 return InputStream->PutBytes( | 191 return InputStream->PutBytes( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 llvm::report_fatal_error("no browser hookups"); | 248 llvm::report_fatal_error("no browser hookups"); |
242 } | 249 } |
243 | 250 |
244 ErrorCode &BrowserCompileServer::getErrorCode() { | 251 ErrorCode &BrowserCompileServer::getErrorCode() { |
245 llvm::report_fatal_error("no browser hookups"); | 252 llvm::report_fatal_error("no browser hookups"); |
246 } | 253 } |
247 | 254 |
248 } // end of namespace Ice | 255 } // end of namespace Ice |
249 | 256 |
250 #endif // PNACL_BROWSER_TRANSLATOR | 257 #endif // PNACL_BROWSER_TRANSLATOR |
OLD | NEW |