OLD | NEW |
1 //===-- LLVMTargetMachine.cpp - Implement the LLVMTargetMachine class -----===// | 1 //===-- LLVMTargetMachine.cpp - Implement the LLVMTargetMachine class -----===// |
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 file implements the LLVMTargetMachine class. | 10 // This file implements the LLVMTargetMachine class. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, | 140 bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, |
141 formatted_raw_ostream &Out, | 141 formatted_raw_ostream &Out, |
142 CodeGenFileType FileType, | 142 CodeGenFileType FileType, |
143 bool DisableVerify, | 143 bool DisableVerify, |
144 AnalysisID StartAfter, | 144 AnalysisID StartAfter, |
145 AnalysisID StopAfter) { | 145 AnalysisID StopAfter) { |
146 // Passes to handle jumptable function annotations. These can't be handled at | 146 // Passes to handle jumptable function annotations. These can't be handled at |
147 // JIT time, so we don't add them directly to addPassesToGenerateCode. | 147 // JIT time, so we don't add them directly to addPassesToGenerateCode. |
| 148 // @LOCALMOD: When there is no ModulePassManager in the PMStack, the |
| 149 // JumpInstrTablesPass will silently be dropped and not added to the pass |
| 150 // manager, because it is a module pass. |
148 PM.add(createJumpInstrTableInfoPass( | 151 PM.add(createJumpInstrTableInfoPass( |
149 getSubtargetImpl()->getInstrInfo()->getJumpInstrTableEntryBound())); | 152 getSubtargetImpl()->getInstrInfo()->getJumpInstrTableEntryBound())); |
150 PM.add(createJumpInstrTablesPass(Options.JTType)); | 153 PM.add(createJumpInstrTablesPass(Options.JTType)); |
151 if (Options.FCFI) | 154 if (Options.FCFI) |
152 PM.add(createForwardControlFlowIntegrityPass( | 155 PM.add(createForwardControlFlowIntegrityPass( |
153 Options.JTType, Options.CFIType, Options.CFIEnforcing, | 156 Options.JTType, Options.CFIType, Options.CFIEnforcing, |
154 Options.getCFIFuncName())); | 157 Options.getCFIFuncName())); |
155 | 158 |
156 // Add common CodeGen passes. | 159 // Add common CodeGen passes. |
157 MCContext *Context = addPassesToGenerateCode(this, PM, DisableVerify, | 160 MCContext *Context = addPassesToGenerateCode(this, PM, DisableVerify, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (!Printer) | 276 if (!Printer) |
274 return true; | 277 return true; |
275 | 278 |
276 // If successful, createAsmPrinter took ownership of AsmStreamer. | 279 // If successful, createAsmPrinter took ownership of AsmStreamer. |
277 AsmStreamer.release(); | 280 AsmStreamer.release(); |
278 | 281 |
279 PM.add(Printer); | 282 PM.add(Printer); |
280 | 283 |
281 return false; // success! | 284 return false; // success! |
282 } | 285 } |
OLD | NEW |