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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Options which are captured in Ice::ClFlags and propagated. | 28 // Options which are captured in Ice::ClFlags and propagated. |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 cl::opt<bool> AllowErrorRecovery( | 32 cl::opt<bool> AllowErrorRecovery( |
33 "allow-pnacl-reader-error-recovery", | 33 "allow-pnacl-reader-error-recovery", |
34 cl::desc("Allow error recovery when reading PNaCl bitcode."), | 34 cl::desc("Allow error recovery when reading PNaCl bitcode."), |
35 cl::init(false)); | 35 cl::init(false)); |
36 | 36 |
| 37 cl::opt<bool> AllowExternDefinedSymbols( |
| 38 "allow-externally-defined-symbols", |
| 39 cl::desc("Allow global symbols to be externally defined (other than _start " |
| 40 "and __pnacl_pso_root)."), |
| 41 cl::init(false)); |
| 42 |
37 cl::opt<bool> AllowIacaMarks( | 43 cl::opt<bool> AllowIacaMarks( |
38 "allow-iaca-marks", | 44 "allow-iaca-marks", |
39 cl::desc("Allow IACA (Intel Architecture Code Analyzer) marks to be " | 45 cl::desc("Allow IACA (Intel Architecture Code Analyzer) marks to be " |
40 "inserted. These binaries are not executable."), | 46 "inserted. These binaries are not executable."), |
41 cl::init(false)); | 47 cl::init(false)); |
42 | 48 |
43 // This is currently needed by crosstest.py. | 49 // This is currently needed by crosstest.py. |
44 cl::opt<bool> AllowUninitializedGlobals( | 50 cl::opt<bool> AllowUninitializedGlobals( |
45 "allow-uninitialized-globals", | 51 "allow-uninitialized-globals", |
46 cl::desc("Allow global variables to be uninitialized")); | 52 cl::desc("Allow global variables to be uninitialized")); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 namespace Ice { | 359 namespace Ice { |
354 | 360 |
355 void ClFlags::parseFlags(int argc, char **argv) { | 361 void ClFlags::parseFlags(int argc, char **argv) { |
356 cl::ParseCommandLineOptions(argc, argv); | 362 cl::ParseCommandLineOptions(argc, argv); |
357 AppName = IceString(argv[0]); | 363 AppName = IceString(argv[0]); |
358 } | 364 } |
359 | 365 |
360 void ClFlags::resetClFlags(ClFlags &OutFlags) { | 366 void ClFlags::resetClFlags(ClFlags &OutFlags) { |
361 // bool fields | 367 // bool fields |
362 OutFlags.AllowErrorRecovery = false; | 368 OutFlags.AllowErrorRecovery = false; |
| 369 OutFlags.AllowExternDefinedSymbols = false; |
363 OutFlags.AllowIacaMarks = false; | 370 OutFlags.AllowIacaMarks = false; |
364 OutFlags.AllowUninitializedGlobals = false; | 371 OutFlags.AllowUninitializedGlobals = false; |
365 OutFlags.DataSections = false; | 372 OutFlags.DataSections = false; |
366 OutFlags.DecorateAsm = false; | 373 OutFlags.DecorateAsm = false; |
367 OutFlags.DisableInternal = false; | 374 OutFlags.DisableInternal = false; |
368 OutFlags.DisableIRGeneration = false; | 375 OutFlags.DisableIRGeneration = false; |
369 OutFlags.DisableTranslation = false; | 376 OutFlags.DisableTranslation = false; |
370 OutFlags.DumpStats = false; | 377 OutFlags.DumpStats = false; |
371 OutFlags.EnableBlockProfile = false; | 378 OutFlags.EnableBlockProfile = false; |
372 OutFlags.ForceMemIntrinOpt = false; | 379 OutFlags.ForceMemIntrinOpt = false; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 420 |
414 Ice::VerboseMask VMask = Ice::IceV_None; | 421 Ice::VerboseMask VMask = Ice::IceV_None; |
415 // Don't generate verbose messages if routines to dump messages are not | 422 // Don't generate verbose messages if routines to dump messages are not |
416 // available. | 423 // available. |
417 if (BuildDefs::dump()) { | 424 if (BuildDefs::dump()) { |
418 for (unsigned i = 0; i != VerboseList.size(); ++i) | 425 for (unsigned i = 0; i != VerboseList.size(); ++i) |
419 VMask |= VerboseList[i]; | 426 VMask |= VerboseList[i]; |
420 } | 427 } |
421 | 428 |
422 OutFlags.setAllowErrorRecovery(::AllowErrorRecovery); | 429 OutFlags.setAllowErrorRecovery(::AllowErrorRecovery); |
| 430 OutFlags.setAllowExternDefinedSymbols(::AllowExternDefinedSymbols || |
| 431 ::DisableInternal); |
423 OutFlags.setAllowIacaMarks(::AllowIacaMarks); | 432 OutFlags.setAllowIacaMarks(::AllowIacaMarks); |
424 OutFlags.setAllowUninitializedGlobals(::AllowUninitializedGlobals); | 433 OutFlags.setAllowUninitializedGlobals(::AllowUninitializedGlobals); |
425 OutFlags.setDataSections(::DataSections); | 434 OutFlags.setDataSections(::DataSections); |
426 OutFlags.setDecorateAsm(::DecorateAsm); | 435 OutFlags.setDecorateAsm(::DecorateAsm); |
427 OutFlags.setDefaultFunctionPrefix(::DefaultFunctionPrefix); | 436 OutFlags.setDefaultFunctionPrefix(::DefaultFunctionPrefix); |
428 OutFlags.setDefaultGlobalPrefix(::DefaultGlobalPrefix); | 437 OutFlags.setDefaultGlobalPrefix(::DefaultGlobalPrefix); |
429 OutFlags.setDisableInternal(::DisableInternal); | 438 OutFlags.setDisableInternal(::DisableInternal); |
430 OutFlags.setDisableIRGeneration(::DisableIRGeneration); | 439 OutFlags.setDisableIRGeneration(::DisableIRGeneration); |
431 OutFlags.setDisableTranslation(::DisableTranslation); | 440 OutFlags.setDisableTranslation(::DisableTranslation); |
432 OutFlags.setDumpStats(::DumpStats); | 441 OutFlags.setDumpStats(::DumpStats); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); | 482 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); |
474 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); | 483 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); |
475 OutFlagsExtra.setAppName(AppName); | 484 OutFlagsExtra.setAppName(AppName); |
476 OutFlagsExtra.setInputFileFormat(InputFileFormat); | 485 OutFlagsExtra.setInputFileFormat(InputFileFormat); |
477 OutFlagsExtra.setIRFilename(IRFilename); | 486 OutFlagsExtra.setIRFilename(IRFilename); |
478 OutFlagsExtra.setLogFilename(LogFilename); | 487 OutFlagsExtra.setLogFilename(LogFilename); |
479 OutFlagsExtra.setOutputFilename(OutputFilename); | 488 OutFlagsExtra.setOutputFilename(OutputFilename); |
480 } | 489 } |
481 | 490 |
482 } // end of namespace Ice | 491 } // end of namespace Ice |
OLD | NEW |