OLD | NEW |
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 /// \file | 10 /// \file |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 cl::desc("Define default global prefix for naming " | 75 cl::desc("Define default global prefix for naming " |
76 "unnamed globals"), | 76 "unnamed globals"), |
77 cl::init("Global")); | 77 cl::init("Global")); |
78 | 78 |
79 cl::opt<bool> DisableHybridAssembly( | 79 cl::opt<bool> DisableHybridAssembly( |
80 "no-hybrid-asm", cl::desc("Disable hybrid assembly when -filetype=iasm"), | 80 "no-hybrid-asm", cl::desc("Disable hybrid assembly when -filetype=iasm"), |
81 cl::init(false)); | 81 cl::init(false)); |
82 | 82 |
83 cl::opt<bool> DisableInternal("externalize", | 83 cl::opt<bool> DisableInternal("externalize", |
84 cl::desc("Externalize all symbols")); | 84 cl::desc("Externalize all symbols")); |
85 // Note: Modifiable only if ALLOW_DISABLE_IR_GEN. | 85 |
86 cl::opt<bool> DisableIRGeneration("no-ir-gen", | |
87 cl::desc("Disable generating Subzero IR.")); | |
88 cl::opt<bool> DisableTranslation("notranslate", | 86 cl::opt<bool> DisableTranslation("notranslate", |
89 cl::desc("Disable Subzero translation")); | 87 cl::desc("Disable Subzero translation")); |
90 | 88 |
91 cl::opt<bool> | 89 cl::opt<bool> |
92 DumpStats("szstats", | 90 DumpStats("szstats", |
93 cl::desc("Print statistics after translating each function")); | 91 cl::desc("Print statistics after translating each function")); |
94 | 92 |
95 // TODO(stichnot): The implementation of block profiling introduces some | 93 // TODO(stichnot): The implementation of block profiling introduces some |
96 // oddities to be aware of. First, empty basic blocks that don't normally | 94 // oddities to be aware of. First, empty basic blocks that don't normally |
97 // appear in the asm output, may be profiled anyway, so one might see profile | 95 // appear in the asm output, may be profiled anyway, so one might see profile |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 void ClFlags::resetClFlags(ClFlags &OutFlags) { | 381 void ClFlags::resetClFlags(ClFlags &OutFlags) { |
384 // bool fields | 382 // bool fields |
385 OutFlags.AllowErrorRecovery = false; | 383 OutFlags.AllowErrorRecovery = false; |
386 OutFlags.AllowExternDefinedSymbols = false; | 384 OutFlags.AllowExternDefinedSymbols = false; |
387 OutFlags.AllowIacaMarks = false; | 385 OutFlags.AllowIacaMarks = false; |
388 OutFlags.AllowUninitializedGlobals = false; | 386 OutFlags.AllowUninitializedGlobals = false; |
389 OutFlags.DataSections = false; | 387 OutFlags.DataSections = false; |
390 OutFlags.DecorateAsm = false; | 388 OutFlags.DecorateAsm = false; |
391 OutFlags.DisableHybridAssembly = false; | 389 OutFlags.DisableHybridAssembly = false; |
392 OutFlags.DisableInternal = false; | 390 OutFlags.DisableInternal = false; |
393 OutFlags.DisableIRGeneration = false; | |
394 OutFlags.DisableTranslation = false; | 391 OutFlags.DisableTranslation = false; |
395 OutFlags.DumpStats = false; | 392 OutFlags.DumpStats = false; |
396 OutFlags.EnableBlockProfile = false; | 393 OutFlags.EnableBlockProfile = false; |
397 OutFlags.ForceMemIntrinOpt = false; | 394 OutFlags.ForceMemIntrinOpt = false; |
398 OutFlags.FunctionSections = false; | 395 OutFlags.FunctionSections = false; |
399 OutFlags.GenerateUnitTestMessages = false; | 396 OutFlags.GenerateUnitTestMessages = false; |
400 OutFlags.MockBoundsCheck = false; | 397 OutFlags.MockBoundsCheck = false; |
401 OutFlags.PhiEdgeSplit = false; | 398 OutFlags.PhiEdgeSplit = false; |
402 OutFlags.RandomNopInsertion = false; | 399 OutFlags.RandomNopInsertion = false; |
403 OutFlags.RandomRegAlloc = false; | 400 OutFlags.RandomRegAlloc = false; |
(...skipping 23 matching lines...) Expand all Loading... |
427 OutFlags.TestPrefix = ""; | 424 OutFlags.TestPrefix = ""; |
428 OutFlags.TimingFocusOn = ""; | 425 OutFlags.TimingFocusOn = ""; |
429 OutFlags.TranslateOnly = ""; | 426 OutFlags.TranslateOnly = ""; |
430 OutFlags.VerboseFocusOn = ""; | 427 OutFlags.VerboseFocusOn = ""; |
431 // size_t and 64-bit fields. | 428 // size_t and 64-bit fields. |
432 OutFlags.NumTranslationThreads = 0; | 429 OutFlags.NumTranslationThreads = 0; |
433 OutFlags.RandomSeed = 0; | 430 OutFlags.RandomSeed = 0; |
434 } | 431 } |
435 | 432 |
436 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { | 433 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { |
437 if (::DisableIRGeneration) | |
438 ::DisableTranslation = true; | |
439 | |
440 Ice::VerboseMask VMask = Ice::IceV_None; | 434 Ice::VerboseMask VMask = Ice::IceV_None; |
441 // Don't generate verbose messages if routines to dump messages are not | 435 // Don't generate verbose messages if routines to dump messages are not |
442 // available. | 436 // available. |
443 if (BuildDefs::dump()) { | 437 if (BuildDefs::dump()) { |
444 for (unsigned i = 0; i != VerboseList.size(); ++i) | 438 for (unsigned i = 0; i != VerboseList.size(); ++i) |
445 VMask |= VerboseList[i]; | 439 VMask |= VerboseList[i]; |
446 } | 440 } |
447 | 441 |
448 OutFlags.setAllowErrorRecovery(::AllowErrorRecovery); | 442 OutFlags.setAllowErrorRecovery(::AllowErrorRecovery); |
449 OutFlags.setAllowExternDefinedSymbols(::AllowExternDefinedSymbols || | 443 OutFlags.setAllowExternDefinedSymbols(::AllowExternDefinedSymbols || |
450 ::DisableInternal); | 444 ::DisableInternal); |
451 OutFlags.setAllowIacaMarks(::AllowIacaMarks); | 445 OutFlags.setAllowIacaMarks(::AllowIacaMarks); |
452 OutFlags.setAllowUninitializedGlobals(::AllowUninitializedGlobals); | 446 OutFlags.setAllowUninitializedGlobals(::AllowUninitializedGlobals); |
453 OutFlags.setDataSections(::DataSections); | 447 OutFlags.setDataSections(::DataSections); |
454 OutFlags.setDecorateAsm(::DecorateAsm); | 448 OutFlags.setDecorateAsm(::DecorateAsm); |
455 OutFlags.setDefaultFunctionPrefix(::DefaultFunctionPrefix); | 449 OutFlags.setDefaultFunctionPrefix(::DefaultFunctionPrefix); |
456 OutFlags.setDefaultGlobalPrefix(::DefaultGlobalPrefix); | 450 OutFlags.setDefaultGlobalPrefix(::DefaultGlobalPrefix); |
457 OutFlags.setDisableHybridAssembly(::DisableHybridAssembly || | 451 OutFlags.setDisableHybridAssembly(::DisableHybridAssembly || |
458 (::OutFileType != Ice::FT_Iasm)); | 452 (::OutFileType != Ice::FT_Iasm)); |
459 OutFlags.setDisableInternal(::DisableInternal); | 453 OutFlags.setDisableInternal(::DisableInternal); |
460 OutFlags.setDisableIRGeneration(::DisableIRGeneration); | |
461 OutFlags.setDisableTranslation(::DisableTranslation); | 454 OutFlags.setDisableTranslation(::DisableTranslation); |
462 OutFlags.setDumpStats(::DumpStats); | 455 OutFlags.setDumpStats(::DumpStats); |
463 OutFlags.setEnableBlockProfile(::EnableBlockProfile); | 456 OutFlags.setEnableBlockProfile(::EnableBlockProfile); |
464 OutFlags.setForceMemIntrinOpt(::ForceMemIntrinOpt); | 457 OutFlags.setForceMemIntrinOpt(::ForceMemIntrinOpt); |
465 OutFlags.setFunctionSections(::FunctionSections); | 458 OutFlags.setFunctionSections(::FunctionSections); |
466 OutFlags.setNumTranslationThreads(::NumThreads); | 459 OutFlags.setNumTranslationThreads(::NumThreads); |
467 OutFlags.setOptLevel(::OLevel); | 460 OutFlags.setOptLevel(::OLevel); |
468 OutFlags.setMockBoundsCheck(::MockBoundsCheck); | 461 OutFlags.setMockBoundsCheck(::MockBoundsCheck); |
469 OutFlags.setPhiEdgeSplit(::EnablePhiEdgeSplit); | 462 OutFlags.setPhiEdgeSplit(::EnablePhiEdgeSplit); |
470 OutFlags.setRandomSeed(::RandomSeed); | 463 OutFlags.setRandomSeed(::RandomSeed); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); | 497 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); |
505 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); | 498 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); |
506 OutFlagsExtra.setAppName(AppName); | 499 OutFlagsExtra.setAppName(AppName); |
507 OutFlagsExtra.setInputFileFormat(InputFileFormat); | 500 OutFlagsExtra.setInputFileFormat(InputFileFormat); |
508 OutFlagsExtra.setIRFilename(IRFilename); | 501 OutFlagsExtra.setIRFilename(IRFilename); |
509 OutFlagsExtra.setLogFilename(LogFilename); | 502 OutFlagsExtra.setLogFilename(LogFilename); |
510 OutFlagsExtra.setOutputFilename(OutputFilename); | 503 OutFlagsExtra.setOutputFilename(OutputFilename); |
511 } | 504 } |
512 | 505 |
513 } // end of namespace Ice | 506 } // end of namespace Ice |
OLD | NEW |