LLVM  6.0.0svn
AsmPrinterHandler.h
Go to the documentation of this file.
1 //===-- lib/CodeGen/AsmPrinter/AsmPrinterHandler.h -------------*- C++ -*--===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains a generic interface for AsmPrinter handlers,
11 // like debug and EH info emitters.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_ASMPRINTERHANDLER_H
16 #define LLVM_LIB_CODEGEN_ASMPRINTER_ASMPRINTERHANDLER_H
17 
18 #include "llvm/Support/DataTypes.h"
19 
20 namespace llvm {
21 
22 class AsmPrinter;
23 class MachineBasicBlock;
24 class MachineFunction;
25 class MachineInstr;
26 class MCSymbol;
27 
29 
30 /// \brief Collects and handles AsmPrinter objects required to build debug
31 /// or EH information.
33 public:
34  virtual ~AsmPrinterHandler();
35 
36  /// \brief For symbols that have a size designated (e.g. common symbols),
37  /// this tracks that size.
38  virtual void setSymbolSize(const MCSymbol *Sym, uint64_t Size) = 0;
39 
40  /// \brief Emit all sections that should come after the content.
41  virtual void endModule() = 0;
42 
43  /// \brief Gather pre-function debug information.
44  /// Every beginFunction(MF) call should be followed by an endFunction(MF)
45  /// call.
46  virtual void beginFunction(const MachineFunction *MF) = 0;
47 
48  // \brief Emit any of function marker (like .cfi_endproc). This is called
49  // before endFunction and cannot switch sections.
50  virtual void markFunctionEnd();
51 
52  /// \brief Gather post-function debug information.
53  /// Please note that some AsmPrinter implementations may not call
54  /// beginFunction at all.
55  virtual void endFunction(const MachineFunction *MF) = 0;
56 
57  virtual void beginFragment(const MachineBasicBlock *MBB,
59  virtual void endFragment() {}
60 
61  /// \brief Emit target-specific EH funclet machinery.
62  virtual void beginFunclet(const MachineBasicBlock &MBB,
63  MCSymbol *Sym = nullptr) {}
64  virtual void endFunclet() {}
65 
66  /// \brief Process beginning of an instruction.
67  virtual void beginInstruction(const MachineInstr *MI) = 0;
68 
69  /// \brief Process end of an instruction.
70  virtual void endInstruction() = 0;
71 };
72 } // End of namespace llvm
73 
74 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
virtual void setSymbolSize(const MCSymbol *Sym, uint64_t Size)=0
For symbols that have a size designated (e.g.
Collects and handles AsmPrinter objects required to build debug or EH information.
virtual void beginInstruction(const MachineInstr *MI)=0
Process beginning of an instruction.
virtual void endInstruction()=0
Process end of an instruction.
virtual void beginFragment(const MachineBasicBlock *MBB, ExceptionSymbolProvider ESP)
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:77
virtual void markFunctionEnd()
MCSymbol * ExceptionSymbolProvider(AsmPrinter *Asm)
virtual void beginFunction(const MachineFunction *MF)=0
Gather pre-function debug information.
virtual void endModule()=0
Emit all sections that should come after the content.
virtual void beginFunclet(const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr)
Emit target-specific EH funclet machinery.
Representation of each machine instruction.
Definition: MachineInstr.h:59
virtual ~AsmPrinterHandler()
Pin vtable to this file.
virtual void endFunction(const MachineFunction *MF)=0
Gather post-function debug information.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
IRTranslator LLVM IR MI