OLD | NEW |
1 //===-- pnacl-llc.cpp - PNaCl-specific llc: pexe ---> nexe ---------------===// | 1 //===-- pnacl-llc.cpp - PNaCl-specific llc: pexe ---> nexe ---------------===// |
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 // pnacl-llc: the core of the PNaCl translator, compiling a pexe into a nexe. | 10 // pnacl-llc: the core of the PNaCl translator, compiling a pexe into a nexe. |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple, | 745 const Target *TheTarget = TargetRegistry::lookupTarget(MArch, TheTriple, |
746 Error); | 746 Error); |
747 if (!TheTarget) { | 747 if (!TheTarget) { |
748 errs() << ProgramName << ": " << Error; | 748 errs() << ProgramName << ": " << Error; |
749 return 1; | 749 return 1; |
750 } | 750 } |
751 | 751 |
752 TargetOptions Options = InitTargetOptionsFromCodeGenFlags(); | 752 TargetOptions Options = InitTargetOptionsFromCodeGenFlags(); |
753 Options.DisableIntegratedAS = NoIntegratedAssembler; | 753 Options.DisableIntegratedAS = NoIntegratedAssembler; |
754 Options.MCOptions.AsmVerbose = true; | 754 Options.MCOptions.AsmVerbose = true; |
| 755 #if defined(__native_client__) |
| 756 // This enables LLVM MC to write instruction padding directly into fragments |
| 757 // reducing memory usage of the translator. However, this could result in |
| 758 // suboptimal machine code since we cannot use short jumps where possible |
| 759 // which is why we enable this for sandboxed translator case. |
| 760 Options.MCOptions.MCRelaxAll = true; |
| 761 #endif |
755 | 762 |
756 if (GenerateSoftFloatCalls) | 763 if (GenerateSoftFloatCalls) |
757 FloatABIForCalls = FloatABI::Soft; | 764 FloatABIForCalls = FloatABI::Soft; |
758 | 765 |
759 // Package up features to be passed to target/subtarget | 766 // Package up features to be passed to target/subtarget |
760 std::string FeaturesStr; | 767 std::string FeaturesStr; |
761 if (MAttrs.size()) { | 768 if (MAttrs.size()) { |
762 SubtargetFeatures Features; | 769 SubtargetFeatures Features; |
763 for (unsigned i = 0; i != MAttrs.size(); ++i) | 770 for (unsigned i = 0; i != MAttrs.size(); ++i) |
764 Features.AddFeature(MAttrs[i]); | 771 Features.AddFeature(MAttrs[i]); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 return 0; | 823 return 0; |
817 } | 824 } |
818 | 825 |
819 int main(int argc, char **argv) { | 826 int main(int argc, char **argv) { |
820 #if defined(PNACL_BROWSER_TRANSLATOR) | 827 #if defined(PNACL_BROWSER_TRANSLATOR) |
821 return srpc_main(argc, argv); | 828 return srpc_main(argc, argv); |
822 #else | 829 #else |
823 return llc_main(argc, argv); | 830 return llc_main(argc, argv); |
824 #endif // PNACL_BROWSER_TRANSLATOR | 831 #endif // PNACL_BROWSER_TRANSLATOR |
825 } | 832 } |
OLD | NEW |