LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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   // emitFunctionAnnot - This may be implemented to emit a string right before
00031   // the start of a function.
00032   virtual void emitFunctionAnnot(const Function *F, std::ostream &OS) {}
00033 
00034   // emitBasicBlockStartAnnot - This may be implemented to emit a string right
00035   // after the basic block label, but before the first instruction in the block.
00036   virtual void emitBasicBlockStartAnnot(const BasicBlock *BB, std::ostream &OS){
00037   }
00038 
00039   // emitBasicBlockEndAnnot - This may be implemented to emit a string right
00040   // after the basic block.
00041   virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, std::ostream &OS){
00042   }
00043 
00044   // emitInstructionAnnot - This may be implemented to emit a string right
00045   // before an instruction is emitted.
00046   virtual void emitInstructionAnnot(const Instruction *I, std::ostream &OS) {}
00047 };
00048 
00049 } // End llvm namespace
00050 
00051 #endif