Chromium Code Reviews| 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 |
| 11 /// This file defines commandline flags parsing. | 11 /// This file defines commandline flags parsing. |
| 12 /// This currently relies on llvm::cl to parse. In the future, the minimal | 12 /// This currently relies on llvm::cl to parse. In the future, the minimal |
| 13 /// build can have a simpler parser. | 13 /// build can have a simpler parser. |
| 14 /// | 14 /// |
| 15 //===----------------------------------------------------------------------===// | 15 //===----------------------------------------------------------------------===// |
| 16 | 16 |
| 17 #include "IceClFlags.h" | 17 #include "IceClFlags.h" |
| 18 | |
|
jvoung (off chromium)
2015/07/22 21:20:45
keep the newline? I think the new style is Foo.cpp
Karl
2015/07/22 21:58:16
Done.
| |
| 19 #include "IceClFlagsExtra.h" | 18 #include "IceClFlagsExtra.h" |
| 20 | 19 |
| 21 #pragma clang diagnostic push | 20 #pragma clang diagnostic push |
| 22 #pragma clang diagnostic ignored "-Wunused-parameter" | 21 #pragma clang diagnostic ignored "-Wunused-parameter" |
| 23 #include "llvm/Support/CommandLine.h" | 22 #include "llvm/Support/CommandLine.h" |
| 24 #pragma clang diagnostic pop | 23 #pragma clang diagnostic pop |
| 25 | 24 |
| 26 namespace cl = llvm::cl; | 25 namespace cl = llvm::cl; |
| 27 | 26 |
| 28 // Options which are captured in Ice::ClFlags and propagated. | 27 // Options which are captured in Ice::ClFlags and propagated. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 "reorder-global-variables", | 306 "reorder-global-variables", |
| 308 cl::desc("Reorder the layout of global variables in NON TEXT section"), | 307 cl::desc("Reorder the layout of global variables in NON TEXT section"), |
| 309 cl::init(false)); | 308 cl::init(false)); |
| 310 | 309 |
| 311 // Command line option for turning on layout reordering in constant pools. | 310 // Command line option for turning on layout reordering in constant pools. |
| 312 cl::opt<bool> ReorderPooledConstants( | 311 cl::opt<bool> ReorderPooledConstants( |
| 313 "reorder-pooled-constants", | 312 "reorder-pooled-constants", |
| 314 cl::desc("Reorder the layout of constants in constant pools"), | 313 cl::desc("Reorder the layout of constants in constant pools"), |
| 315 cl::init(false)); | 314 cl::init(false)); |
| 316 | 315 |
| 316 // Command line option for accepting textual bitcode. | |
| 317 cl::opt<bool> BitcodeAsText( | |
| 318 "bitcode-as-text", | |
| 319 cl::desc( | |
| 320 "Accept textual form of PNaCl bitcode records (i.e. not .ll assembly)"), | |
| 321 cl::init(false)); | |
| 317 } // end of anonymous namespace | 322 } // end of anonymous namespace |
| 318 | 323 |
| 319 namespace Ice { | 324 namespace Ice { |
| 320 | 325 |
| 321 void ClFlags::parseFlags(int argc, char **argv) { | 326 void ClFlags::parseFlags(int argc, char **argv) { |
| 322 cl::ParseCommandLineOptions(argc, argv); | 327 cl::ParseCommandLineOptions(argc, argv); |
| 323 AppName = IceString(argv[0]); | 328 AppName = IceString(argv[0]); |
| 324 } | 329 } |
| 325 | 330 |
| 326 void ClFlags::resetClFlags(ClFlags &OutFlags) { | 331 void ClFlags::resetClFlags(ClFlags &OutFlags) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 | 443 |
| 439 // Set for pooled constant reordering option. | 444 // Set for pooled constant reordering option. |
| 440 OutFlags.setShouldReorderPooledConstants(::ReorderPooledConstants); | 445 OutFlags.setShouldReorderPooledConstants(::ReorderPooledConstants); |
| 441 } | 446 } |
| 442 | 447 |
| 443 void ClFlags::getParsedClFlagsExtra(ClFlagsExtra &OutFlagsExtra) { | 448 void ClFlags::getParsedClFlagsExtra(ClFlagsExtra &OutFlagsExtra) { |
| 444 OutFlagsExtra.setAlwaysExitSuccess(AlwaysExitSuccess); | 449 OutFlagsExtra.setAlwaysExitSuccess(AlwaysExitSuccess); |
| 445 OutFlagsExtra.setBuildOnRead(BuildOnRead); | 450 OutFlagsExtra.setBuildOnRead(BuildOnRead); |
| 446 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); | 451 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); |
| 447 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); | 452 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); |
| 453 OutFlagsExtra.setBitcodeAsText(BitcodeAsText); | |
|
jvoung (off chromium)
2015/07/22 21:20:44
Can the bools portion be sorted?
I think it's sep
Karl
2015/07/22 21:58:16
Done.
| |
| 448 OutFlagsExtra.setAppName(AppName); | 454 OutFlagsExtra.setAppName(AppName); |
| 449 OutFlagsExtra.setInputFileFormat(InputFileFormat); | 455 OutFlagsExtra.setInputFileFormat(InputFileFormat); |
| 450 OutFlagsExtra.setIRFilename(IRFilename); | 456 OutFlagsExtra.setIRFilename(IRFilename); |
| 451 OutFlagsExtra.setLogFilename(LogFilename); | 457 OutFlagsExtra.setLogFilename(LogFilename); |
| 452 OutFlagsExtra.setOutputFilename(OutputFilename); | 458 OutFlagsExtra.setOutputFilename(OutputFilename); |
| 453 } | 459 } |
| 454 | 460 |
| 455 } // end of namespace Ice | 461 } // end of namespace Ice |
| OLD | NEW |