1212793Sdim//===-- AssemblyAnnotationWriter.h - Annotation .ll files -------*- C++ -*-===// 2212793Sdim// 3212793Sdim// The LLVM Compiler Infrastructure 4212793Sdim// 5212793Sdim// This file is distributed under the University of Illinois Open Source 6212793Sdim// License. See LICENSE.TXT for details. 7212793Sdim// 8212793Sdim//===----------------------------------------------------------------------===// 9212793Sdim// 10212793Sdim// Clients of the assembly writer can use this interface to add their own 11212793Sdim// special-purpose annotations to LLVM assembly language printouts. Note that 12212793Sdim// the assembly parser won't be able to parse these, in general, so 13212793Sdim// implementations are advised to print stuff as LLVM comments. 14212793Sdim// 15212793Sdim//===----------------------------------------------------------------------===// 16212793Sdim 17212793Sdim#ifndef LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H 18212793Sdim#define LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H 19212793Sdim 20212793Sdimnamespace llvm { 21212793Sdim 22212793Sdimclass Function; 23212793Sdimclass BasicBlock; 24212793Sdimclass Instruction; 25234353Sdimclass Value; 26212793Sdimclass formatted_raw_ostream; 27212793Sdim 28212793Sdimclass AssemblyAnnotationWriter { 29212793Sdimpublic: 30212793Sdim 31212793Sdim virtual ~AssemblyAnnotationWriter(); 32212793Sdim 33212793Sdim /// emitFunctionAnnot - This may be implemented to emit a string right before 34212793Sdim /// the start of a function. 35234353Sdim virtual void emitFunctionAnnot(const Function *, 36234353Sdim formatted_raw_ostream &) {} 37212793Sdim 38212793Sdim /// emitBasicBlockStartAnnot - This may be implemented to emit a string right 39212793Sdim /// after the basic block label, but before the first instruction in the 40212793Sdim /// block. 41234353Sdim virtual void emitBasicBlockStartAnnot(const BasicBlock *, 42234353Sdim formatted_raw_ostream &) { 43212793Sdim } 44212793Sdim 45212793Sdim /// emitBasicBlockEndAnnot - This may be implemented to emit a string right 46212793Sdim /// after the basic block. 47234353Sdim virtual void emitBasicBlockEndAnnot(const BasicBlock *, 48234353Sdim formatted_raw_ostream &) { 49212793Sdim } 50212793Sdim 51212793Sdim /// emitInstructionAnnot - This may be implemented to emit a string right 52212793Sdim /// before an instruction is emitted. 53234353Sdim virtual void emitInstructionAnnot(const Instruction *, 54234353Sdim formatted_raw_ostream &) {} 55212793Sdim 56212793Sdim /// printInfoComment - This may be implemented to emit a comment to the 57212793Sdim /// right of an instruction or global value. 58234353Sdim virtual void printInfoComment(const Value &, formatted_raw_ostream &) {} 59212793Sdim}; 60212793Sdim 61212793Sdim} // End llvm namespace 62212793Sdim 63212793Sdim#endif 64