OLD | NEW |
1 //===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===// | 1 //===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
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 is the llc code generator driver. It provides a convenient | 10 // This is the llc code generator driver. It provides a convenient |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 Out->keep(); | 703 Out->keep(); |
704 #endif | 704 #endif |
705 | 705 |
706 // @LOCALMOD-BEGIN | 706 // @LOCALMOD-BEGIN |
707 // Write out the metadata. | 707 // Write out the metadata. |
708 // | 708 // |
709 // We need to ensure that intrinsic prototypes are available, in case | 709 // We need to ensure that intrinsic prototypes are available, in case |
710 // we have a NeededRecord for one of them. | 710 // we have a NeededRecord for one of them. |
711 // They may have been eliminated by the StripDeadPrototypes pass, | 711 // They may have been eliminated by the StripDeadPrototypes pass, |
712 // or some other pass that is unaware of NeededRecords / IntrinsicLowering. | 712 // or some other pass that is unaware of NeededRecords / IntrinsicLowering. |
713 IntrinsicLowering IL(*target->getTargetData()); | 713 if (!MetadataTextFilename.empty()) { |
714 IL.AddPrototypes(*M); | 714 IntrinsicLowering IL(*target->getTargetData()); |
| 715 IL.AddPrototypes(*M); |
715 | 716 |
716 if (!MetadataTextFilename.empty()) { | |
717 int err = WriteTextMetadataFile(*M.get(), TheTriple); | 717 int err = WriteTextMetadataFile(*M.get(), TheTriple); |
718 if (err != 0) | 718 if (err != 0) |
719 return err; | 719 return err; |
720 } | 720 } |
721 // @LOCALMOD-END | 721 // @LOCALMOD-END |
722 | 722 |
723 return 0; | 723 return 0; |
724 } | 724 } |
725 | 725 |
726 #if !defined(NACL_SRPC) | 726 #if !defined(NACL_SRPC) |
727 int | 727 int |
728 main (int argc, char **argv) { | 728 main (int argc, char **argv) { |
729 return llc_main(argc, argv); | 729 return llc_main(argc, argv); |
730 } | 730 } |
731 #else | 731 #else |
732 // main() is in nacl_file.cpp. | 732 // main() is in nacl_file.cpp. |
733 #endif | 733 #endif |
OLD | NEW |