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 is distributed under the University of Illinois Open Source
00006 // 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 namespace llvm {
00021 
00022 class Function;
00023 class BasicBlock;
00024 class Instruction;
00025 class raw_ostream;
00026 
00027 class AssemblyAnnotationWriter {
00028 public:
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, raw_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, raw_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, raw_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, raw_ostream &OS) {}
00049 };
00050 
00051 } // End llvm namespace
00052 
00053 #endif