| OLD | NEW |
| 1 //===-- MipsTargetMachine.cpp - Define TargetMachine for Mips -------------===// | 1 //===-- MipsTargetMachine.cpp - Define TargetMachine for Mips -------------===// |
| 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 // Implements the info about Mips target spec. | 10 // Implements the info about Mips target spec. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Implemented by targets that want to run passes immediately before | 87 // Implemented by targets that want to run passes immediately before |
| 88 // machine code is emitted. return true if -print-machineinstrs should | 88 // machine code is emitted. return true if -print-machineinstrs should |
| 89 // print out the code after the passes. | 89 // print out the code after the passes. |
| 90 bool MipsTargetMachine:: | 90 bool MipsTargetMachine:: |
| 91 addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel) | 91 addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel) |
| 92 { | 92 { |
| 93 PM.add(createMipsDelaySlotFillerPass(*this)); | 93 PM.add(createMipsDelaySlotFillerPass(*this)); |
| 94 |
| 95 // @LOCALMOD-START |
| 96 // This pass does all the heavy sfi lifting. |
| 97 PM.add(createMipsNaClRewritePass()); |
| 98 // @LOCALMOD-END |
| 99 |
| 94 return true; | 100 return true; |
| 95 } | 101 } |
| 96 | 102 |
| 97 bool MipsTargetMachine:: | 103 bool MipsTargetMachine:: |
| 98 addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { | 104 addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { |
| 99 // Do not restore $gp if target is Mips64. | 105 // Do not restore $gp if target is Mips64. |
| 100 // In N32/64, $gp is a callee-saved register. | 106 // In N32/64, $gp is a callee-saved register. |
| 101 if (!Subtarget.hasMips64()) | 107 if (!Subtarget.hasMips64()) |
| 102 PM.add(createMipsEmitGPRestorePass(*this)); | 108 PM.add(createMipsEmitGPRestorePass(*this)); |
| 103 return true; | 109 return true; |
| 104 } | 110 } |
| 105 | 111 |
| 106 bool MipsTargetMachine:: | 112 bool MipsTargetMachine:: |
| 107 addPostRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { | 113 addPostRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { |
| 108 PM.add(createMipsExpandPseudoPass(*this)); | 114 PM.add(createMipsExpandPseudoPass(*this)); |
| 109 return true; | 115 return true; |
| 110 } | 116 } |
| 111 | 117 |
| 112 bool MipsTargetMachine::addCodeEmitter(PassManagerBase &PM, | 118 bool MipsTargetMachine::addCodeEmitter(PassManagerBase &PM, |
| 113 CodeGenOpt::Level OptLevel, | 119 CodeGenOpt::Level OptLevel, |
| 114 JITCodeEmitter &JCE) { | 120 JITCodeEmitter &JCE) { |
| 115 // Machine code emitter pass for Mips. | 121 // Machine code emitter pass for Mips. |
| 116 PM.add(createMipsJITCodeEmitterPass(*this, JCE)); | 122 PM.add(createMipsJITCodeEmitterPass(*this, JCE)); |
| 117 return false; | 123 return false; |
| 118 } | 124 } |
| 119 | 125 |
| OLD | NEW |