OLD | NEW |
---|---|
1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// | 1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// |
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 a driver that uses LLVM capabilities to parse a | 10 // This file defines a driver that uses LLVM capabilities to parse a |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
587 cl::init(""), cl::value_desc("prefix")); | 587 cl::init(""), cl::value_desc("prefix")); |
588 static cl::opt<bool> | 588 static cl::opt<bool> |
589 DisableInternal("external", | 589 DisableInternal("external", |
590 cl::desc("Disable 'internal' linkage type for testing")); | 590 cl::desc("Disable 'internal' linkage type for testing")); |
591 static cl::opt<bool> | 591 static cl::opt<bool> |
592 DisableTranslation("notranslate", cl::desc("Disable Subzero translation")); | 592 DisableTranslation("notranslate", cl::desc("Disable Subzero translation")); |
593 | 593 |
594 static cl::opt<bool> SubzeroTimingEnabled( | 594 static cl::opt<bool> SubzeroTimingEnabled( |
595 "timing", cl::desc("Enable breakdown timing of Subzero translation")); | 595 "timing", cl::desc("Enable breakdown timing of Subzero translation")); |
596 | 596 |
597 cl::opt<NaClFileFormat> | |
Jim Stichnoth
2014/05/09 23:02:42
Make this static for consistency with other cl::op
Karl
2014/05/14 19:31:27
Done.
| |
598 InputFileFormat( | |
599 "bitcode-format", | |
600 cl::desc("Define format of input file:"), | |
601 cl::values( | |
602 clEnumValN(LLVMFormat, "llvm", "LLVM file (default)"), | |
603 clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"), | |
604 clEnumValEnd), | |
605 cl::init(LLVMFormat)); | |
606 | |
597 int main(int argc, char **argv) { | 607 int main(int argc, char **argv) { |
598 cl::ParseCommandLineOptions(argc, argv); | 608 cl::ParseCommandLineOptions(argc, argv); |
599 | 609 |
600 // Parse the input LLVM IR file into a module. | 610 // Parse the input LLVM IR file into a module. |
601 SMDiagnostic Err; | 611 SMDiagnostic Err; |
602 Module *Mod; | 612 Module *Mod; |
603 | 613 |
604 { | 614 { |
605 Ice::Timer T; | 615 Ice::Timer T; |
606 Mod = ParseIRFile(IRFilename, Err, getGlobalContext()); | 616 Mod = NaClParseIRFile(IRFilename, InputFileFormat, Err, getGlobalContext()); |
Jim Stichnoth
2014/05/09 23:02:42
Would it be possible to add a -bitcode-format=pnac
Karl
2014/05/14 19:31:27
Done.
| |
607 | 617 |
608 if (SubzeroTimingEnabled) { | 618 if (SubzeroTimingEnabled) { |
609 std::cerr << "[Subzero timing] IR Parsing: " << T.getElapsedSec() | 619 std::cerr << "[Subzero timing] IR Parsing: " << T.getElapsedSec() |
610 << " sec\n"; | 620 << " sec\n"; |
611 } | 621 } |
612 } | 622 } |
613 | 623 |
614 if (!Mod) { | 624 if (!Mod) { |
615 Err.print(argv[0], errs()); | 625 Err.print(argv[0], errs()); |
616 return 1; | 626 return 1; |
(...skipping 29 matching lines...) Expand all Loading... | |
646 << " sec\n"; | 656 << " sec\n"; |
647 } | 657 } |
648 | 658 |
649 if (DisableTranslation) { | 659 if (DisableTranslation) { |
650 Func->dump(); | 660 Func->dump(); |
651 } | 661 } |
652 } | 662 } |
653 | 663 |
654 return 0; | 664 return 0; |
655 } | 665 } |
OLD | NEW |