LLVM API Documentation
00001 //===-- AssemblyAnnotationWriter.h - 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_IR_ASSEMBLYANNOTATIONWRITER_H 00018 #define LLVM_IR_ASSEMBLYANNOTATIONWRITER_H 00019 00020 namespace llvm { 00021 00022 class Function; 00023 class BasicBlock; 00024 class Instruction; 00025 class Value; 00026 class formatted_raw_ostream; 00027 00028 class AssemblyAnnotationWriter { 00029 public: 00030 00031 virtual ~AssemblyAnnotationWriter(); 00032 00033 /// emitFunctionAnnot - This may be implemented to emit a string right before 00034 /// the start of a function. 00035 virtual void emitFunctionAnnot(const Function *, 00036 formatted_raw_ostream &) {} 00037 00038 /// emitBasicBlockStartAnnot - This may be implemented to emit a string right 00039 /// after the basic block label, but before the first instruction in the 00040 /// block. 00041 virtual void emitBasicBlockStartAnnot(const BasicBlock *, 00042 formatted_raw_ostream &) { 00043 } 00044 00045 /// emitBasicBlockEndAnnot - This may be implemented to emit a string right 00046 /// after the basic block. 00047 virtual void emitBasicBlockEndAnnot(const BasicBlock *, 00048 formatted_raw_ostream &) { 00049 } 00050 00051 /// emitInstructionAnnot - This may be implemented to emit a string right 00052 /// before an instruction is emitted. 00053 virtual void emitInstructionAnnot(const Instruction *, 00054 formatted_raw_ostream &) {} 00055 00056 /// printInfoComment - This may be implemented to emit a comment to the 00057 /// right of an instruction or global value. 00058 virtual void printInfoComment(const Value &, formatted_raw_ostream &) {} 00059 }; 00060 00061 } // End llvm namespace 00062 00063 #endif