LLVM API Documentation

AsmPrinterHandler.h
Go to the documentation of this file.
00001 //===-- lib/CodeGen/AsmPrinter/AsmPrinterHandler.h -------------*- C++ -*--===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains a generic interface for AsmPrinter handlers,
00011 // like debug and EH info emitters.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_ASMPRINTERHANDLER_H
00016 #define LLVM_LIB_CODEGEN_ASMPRINTER_ASMPRINTERHANDLER_H
00017 
00018 #include "llvm/Support/DataTypes.h"
00019 
00020 namespace llvm {
00021 
00022 class MachineFunction;
00023 class MachineInstr;
00024 class MCSymbol;
00025 
00026 /// \brief Collects and handles AsmPrinter objects required to build debug
00027 /// or EH information.
00028 class AsmPrinterHandler {
00029 public:
00030   virtual ~AsmPrinterHandler();
00031 
00032   /// \brief For symbols that have a size designated (e.g. common symbols),
00033   /// this tracks that size.
00034   virtual void setSymbolSize(const MCSymbol *Sym, uint64_t Size) = 0;
00035 
00036   /// \brief Emit all sections that should come after the content.
00037   virtual void endModule() = 0;
00038 
00039   /// \brief Gather pre-function debug information.
00040   /// Every beginFunction(MF) call should be followed by an endFunction(MF)
00041   /// call.
00042   virtual void beginFunction(const MachineFunction *MF) = 0;
00043 
00044   /// \brief Gather post-function debug information.
00045   /// Please note that some AsmPrinter implementations may not call
00046   /// beginFunction at all.
00047   virtual void endFunction(const MachineFunction *MF) = 0;
00048 
00049   /// \brief Process beginning of an instruction.
00050   virtual void beginInstruction(const MachineInstr *MI) = 0;
00051 
00052   /// \brief Process end of an instruction.
00053   virtual void endInstruction() = 0;
00054 };
00055 } // End of namespace llvm
00056 
00057 #endif