OLD | NEW |
1 //===-- llvm/CodeGen/AsmPrinter.h - AsmPrinter Framework --------*- C++ -*-===// | 1 //===-- llvm/CodeGen/AsmPrinter.h - AsmPrinter Framework --------*- C++ -*-===// |
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 contains a class to be used as the base class for target specific | 10 // This file contains a class to be used as the base class for target specific |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 /// \brief Print a general LLVM constant to the .s file. | 241 /// \brief Print a general LLVM constant to the .s file. |
242 void EmitGlobalConstant(const Constant *CV); | 242 void EmitGlobalConstant(const Constant *CV); |
243 | 243 |
244 //===------------------------------------------------------------------===// | 244 //===------------------------------------------------------------------===// |
245 // Overridable Hooks | 245 // Overridable Hooks |
246 //===------------------------------------------------------------------===// | 246 //===------------------------------------------------------------------===// |
247 | 247 |
248 // Targets can, or in the case of EmitInstruction, must implement these to | 248 // Targets can, or in the case of EmitInstruction, must implement these to |
249 // customize output. | 249 // customize output. |
250 | 250 |
| 251 // @LOCALMOD-START |
| 252 /// UseReadOnlyJumpTables - true if JumpTableInfo must be in rodata. |
| 253 virtual bool UseReadOnlyJumpTables() const { return false; } |
| 254 /// GetTargetBasicBlockAlign - the target alignment for basic blocks. |
| 255 virtual unsigned GetTargetBasicBlockAlign() const { return 0; } |
| 256 /// GetTargetLabelAlign - Get optional alignment for TargetOpcode |
| 257 /// labels E.g., EH_LABEL. |
| 258 virtual unsigned GetTargetLabelAlign(const MachineInstr *MI) const { |
| 259 return 0; |
| 260 } |
| 261 // @LOCALMOD-END |
| 262 |
251 /// This virtual method can be overridden by targets that want to emit | 263 /// This virtual method can be overridden by targets that want to emit |
252 /// something at the start of their file. | 264 /// something at the start of their file. |
253 virtual void EmitStartOfAsmFile(Module &) {} | 265 virtual void EmitStartOfAsmFile(Module &) {} |
254 | 266 |
255 /// This virtual method can be overridden by targets that want to emit | 267 /// This virtual method can be overridden by targets that want to emit |
256 /// something at the end of their file. | 268 /// something at the end of their file. |
257 virtual void EmitEndOfAsmFile(Module &) {} | 269 virtual void EmitEndOfAsmFile(Module &) {} |
258 | 270 |
259 /// Targets can override this to emit stuff before the first basic block in | 271 /// Targets can override this to emit stuff before the first basic block in |
260 /// the function. | 272 /// the function. |
261 virtual void EmitFunctionBodyStart() {} | 273 virtual void EmitFunctionBodyStart() {} |
262 | 274 |
263 /// Targets can override this to emit stuff after the last basic block in the | 275 /// Targets can override this to emit stuff after the last basic block in the |
264 /// function. | 276 /// function. |
265 virtual void EmitFunctionBodyEnd() {} | 277 virtual void EmitFunctionBodyEnd() { |
| 278 // @LOCALMOD-START |
| 279 unsigned NextFunctionAlignment = GetTargetBasicBlockAlign(); |
| 280 if (NextFunctionAlignment) EmitAlignment(NextFunctionAlignment); |
| 281 // @LOCALMOD-END |
| 282 } |
266 | 283 |
267 /// Targets can override this to emit stuff at the end of a basic block. | 284 /// Targets can override this to emit stuff at the end of a basic block. |
268 virtual void EmitBasicBlockEnd(const MachineBasicBlock &MBB) {} | 285 virtual void EmitBasicBlockEnd(const MachineBasicBlock &MBB) {} |
269 | 286 |
270 /// Targets should implement this to emit instructions. | 287 /// Targets should implement this to emit instructions. |
271 virtual void EmitInstruction(const MachineInstr *) { | 288 virtual void EmitInstruction(const MachineInstr *) { |
272 llvm_unreachable("EmitInstruction not implemented"); | 289 llvm_unreachable("EmitInstruction not implemented"); |
273 } | 290 } |
274 | 291 |
275 /// Return the symbol for the specified constant pool entry. | 292 /// Return the symbol for the specified constant pool entry. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 const MachineBasicBlock *MBB, unsigned uid) const; | 523 const MachineBasicBlock *MBB, unsigned uid) const; |
507 void EmitLLVMUsedList(const ConstantArray *InitList); | 524 void EmitLLVMUsedList(const ConstantArray *InitList); |
508 /// Emit llvm.ident metadata in an '.ident' directive. | 525 /// Emit llvm.ident metadata in an '.ident' directive. |
509 void EmitModuleIdents(Module &M); | 526 void EmitModuleIdents(Module &M); |
510 void EmitXXStructorList(const Constant *List, bool isCtor); | 527 void EmitXXStructorList(const Constant *List, bool isCtor); |
511 GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy &C); | 528 GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy &C); |
512 }; | 529 }; |
513 } | 530 } |
514 | 531 |
515 #endif | 532 #endif |
OLD | NEW |