| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 // Add the intrinsic resolution pass. It assumes ABI-conformant code. | 414 // Add the intrinsic resolution pass. It assumes ABI-conformant code. |
| 415 PM->add(createResolvePNaClIntrinsicsPass()); | 415 PM->add(createResolvePNaClIntrinsicsPass()); |
| 416 | 416 |
| 417 // Add an appropriate TargetLibraryInfo pass for the module's triple. | 417 // Add an appropriate TargetLibraryInfo pass for the module's triple. |
| 418 TargetLibraryInfo *TLI = new TargetLibraryInfo(TheTriple); | 418 TargetLibraryInfo *TLI = new TargetLibraryInfo(TheTriple); |
| 419 if (DisableSimplifyLibCalls) | 419 if (DisableSimplifyLibCalls) |
| 420 TLI->disableAllFunctions(); | 420 TLI->disableAllFunctions(); |
| 421 PM->add(TLI); | 421 PM->add(TLI); |
| 422 | 422 |
| 423 // Allow subsequent passes to better optimize vector instructions. |
| 424 // This pass uses the TargetLibraryInfo above. |
| 425 PM->add(createCombineVectorInstructionsPass()); |
| 426 |
| 423 // Add intenal analysis passes from the target machine. | 427 // Add intenal analysis passes from the target machine. |
| 424 Target.addAnalysisPasses(*PM.get()); | 428 Target.addAnalysisPasses(*PM.get()); |
| 425 | 429 |
| 426 // Add the target data from the target machine, if it exists, or the module. | 430 // Add the target data from the target machine, if it exists, or the module. |
| 427 if (const DataLayout *TD = Target.getDataLayout()) | 431 if (const DataLayout *TD = Target.getDataLayout()) |
| 428 PM->add(new DataLayout(*TD)); | 432 PM->add(new DataLayout(*TD)); |
| 429 else | 433 else |
| 430 PM->add(new DataLayout(mod)); | 434 PM->add(new DataLayout(mod)); |
| 431 | 435 |
| 432 // Ask the target to add backend passes as necessary. We explicitly ask it | 436 // Ask the target to add backend passes as necessary. We explicitly ask it |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 return 0; | 761 return 0; |
| 758 } | 762 } |
| 759 | 763 |
| 760 int main(int argc, char **argv) { | 764 int main(int argc, char **argv) { |
| 761 #if defined(__native_client__) | 765 #if defined(__native_client__) |
| 762 return srpc_main(argc, argv); | 766 return srpc_main(argc, argv); |
| 763 #else | 767 #else |
| 764 return llc_main(argc, argv); | 768 return llc_main(argc, argv); |
| 765 #endif // __native_client__ | 769 #endif // __native_client__ |
| 766 } | 770 } |
| OLD | NEW |