LLVM API Documentation

AsmAnnotationWriter.h

Go to the documentation of this file.
00001 //===-- AsmAnnotationWriter.h - Itf for annotation .ll files - --*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // Clients of the assembly writer can use this interface to add their own
00011 // special-purpose annotations to LLVM assembly language printouts.  Note that
00012 // the assembly parser won't be able to parse these, in general, so
00013 // implementations are advised to print stuff as LLVM comments.
00014 //
00015 //===----------------------------------------------------------------------===//
00016 
00017 #ifndef LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H
00018 #define LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H
00019 
00020 #include <iosfwd>
00021 
00022 namespace llvm {
00023 
00024 class Function;
00025 class BasicBlock;
00026 class Instruction;
00027 
00028 struct AssemblyAnnotationWriter {
00029 
00030   virtual ~AssemblyAnnotationWriter();
00031 
00032   // emitFunctionAnnot - This may be implemented to emit a string right before
00033   // the start of a function.
00034   virtual void emitFunctionAnnot(const Function *F, std::ostream &OS) {}
00035 
00036   // emitBasicBlockStartAnnot - This may be implemented to emit a string right
00037   // after the basic block label, but before the first instruction in the block.
00038   virtual void emitBasicBlockStartAnnot(const BasicBlock *BB, std::ostream &OS){
00039   }
00040 
00041   // emitBasicBlockEndAnnot - This may be implemented to emit a string right
00042   // after the basic block.
00043   virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, std::ostream &OS){
00044   }
00045 
00046   // emitInstructionAnnot - This may be implemented to emit a string right
00047   // before an instruction is emitted.
00048   virtual void emitInstructionAnnot(const Instruction *I, std::ostream &OS) {}
00049 };
00050 
00051 } // End llvm namespace
00052 
00053 #endif