Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: src/IceClFlags.cpp

Issue 1091023002: Fix locking for printing error messages. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceClFlags.cpp - Command line flags and parsing --------===// 1 //===- subzero/src/IceClFlags.cpp - Command line flags and parsing --------===//
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 // This file defines commandline flags parsing. 10 // This file defines commandline flags parsing.
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 } // end of anonymous namespace 239 } // end of anonymous namespace
240 240
241 namespace Ice { 241 namespace Ice {
242 242
243 void ClFlags::parseFlags(int argc, char **argv) { 243 void ClFlags::parseFlags(int argc, char **argv) {
244 cl::ParseCommandLineOptions(argc, argv); 244 cl::ParseCommandLineOptions(argc, argv);
245 AppName = IceString(argv[0]); 245 AppName = IceString(argv[0]);
246 } 246 }
247 247
248 void ClFlags::resetClFlags(ClFlags &OutFlags) {
249 // bool fields
250 OutFlags.AllowErrorRecovery = false;
251 OutFlags.AllowUninitializedGlobals = false;
252 OutFlags.DataSections = false;
253 OutFlags.DecorateAsm = false;
254 OutFlags.DisableInternal = false;
255 OutFlags.DisableIRGeneration = false;
256 OutFlags.DisableTranslation = false;
257 OutFlags.DumpStats = false;
258 OutFlags.FunctionSections = false;
259 OutFlags.GenerateUnitTestMessages = false;
260 OutFlags.PhiEdgeSplit = false;
261 OutFlags.RandomNopInsertion = false;
262 OutFlags.RandomRegAlloc = false;
263 OutFlags.SubzeroTimingEnabled = false;
264 OutFlags.TimeEachFunction = false;
265 OutFlags.UseSandboxing = false;
266 // Enum and integer fields.
267 OutFlags.Opt = Opt_m1;
268 OutFlags.OutFileType = FT_Iasm;
269 OutFlags.RandomMaxNopsPerInstruction = 0;
270 OutFlags.RandomNopProbabilityAsPercentage = 0;
271 OutFlags.TArch = TargetArch_NUM;
272 OutFlags.VMask = IceV_None;
273 // IceString fields.
274 OutFlags.DefaultFunctionPrefix = "";
275 OutFlags.DefaultGlobalPrefix = "";
276 OutFlags.TestPrefix = "";
277 OutFlags.TimingFocusOn = "";
278 OutFlags.TranslateOnly = "";
279 OutFlags.VerboseFocusOn = "";
280 // size_t and 64-bit fields.
281 OutFlags.NumTranslationThreads = 0;
282 OutFlags.RandomSeed = 0;
283 }
284
248 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { 285 void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
249 if (::DisableIRGeneration) 286 if (::DisableIRGeneration)
250 ::DisableTranslation = true; 287 ::DisableTranslation = true;
251 288
252 Ice::VerboseMask VMask = Ice::IceV_None; 289 Ice::VerboseMask VMask = Ice::IceV_None;
253 // Don't generate verbose messages if routines 290 // Don't generate verbose messages if routines
254 // to dump messages are not available. 291 // to dump messages are not available.
255 if (ALLOW_DUMP) { 292 if (ALLOW_DUMP) {
256 for (unsigned i = 0; i != VerboseList.size(); ++i) 293 for (unsigned i = 0; i != VerboseList.size(); ++i)
257 VMask |= VerboseList[i]; 294 VMask |= VerboseList[i];
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); 332 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts);
296 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); 333 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors);
297 OutFlagsExtra.setAppName(AppName); 334 OutFlagsExtra.setAppName(AppName);
298 OutFlagsExtra.setInputFileFormat(InputFileFormat); 335 OutFlagsExtra.setInputFileFormat(InputFileFormat);
299 OutFlagsExtra.setIRFilename(IRFilename); 336 OutFlagsExtra.setIRFilename(IRFilename);
300 OutFlagsExtra.setLogFilename(LogFilename); 337 OutFlagsExtra.setLogFilename(LogFilename);
301 OutFlagsExtra.setOutputFilename(OutputFilename); 338 OutFlagsExtra.setOutputFilename(OutputFilename);
302 } 339 }
303 340
304 } // end of namespace Ice 341 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceClFlags.h ('k') | src/PNaClTranslator.cpp » ('j') | src/PNaClTranslator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698