AssemblyAnnotationWriter.h revision edd5d9ece15f73ec1a31423a4ae39774aa6c521c
10836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner//===-- AsmAnnotationWriter.h - Itf for annotation .ll files - --*- C++ -*-===// 29769ab22265b313171d201b5928688524a01bd87Misha Brukman// 30836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// The LLVM Compiler Infrastructure 40836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// 50836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// This file was developed by the LLVM research group and is distributed under 60836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// the University of Illinois Open Source License. See LICENSE.TXT for details. 79769ab22265b313171d201b5928688524a01bd87Misha Brukman// 80836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner//===----------------------------------------------------------------------===// 90836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// 100836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// Clients of the assembly writer can use this interface to add their own 110836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// special-purpose annotations to LLVM assembly language printouts. Note that 120836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// the assembly parser won't be able to parse these, in general, so 130836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// implementations are advised to print stuff as LLVM comments. 140836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner// 150836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner//===----------------------------------------------------------------------===// 160836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner 170836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner#ifndef LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H 180836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner#define LLVM_ASSEMBLY_ASMANNOTATIONWRITER_H 190836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner 200836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner#include <iosfwd> 21d0fde30ce850b78371fd1386338350591f9ff494Brian Gaeke 22d0fde30ce850b78371fd1386338350591f9ff494Brian Gaekenamespace llvm { 23d0fde30ce850b78371fd1386338350591f9ff494Brian Gaeke 240836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattnerclass Function; 250836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattnerclass BasicBlock; 260836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattnerclass Instruction; 270836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner 280836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattnerstruct AssemblyAnnotationWriter { 299769ab22265b313171d201b5928688524a01bd87Misha Brukman 30edd5d9ece15f73ec1a31423a4ae39774aa6c521cReid Spencer virtual ~AssemblyAnnotationWriter(); 31edd5d9ece15f73ec1a31423a4ae39774aa6c521cReid Spencer 320836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner // emitFunctionAnnot - This may be implemented to emit a string right before 330836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner // the start of a function. 340836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner virtual void emitFunctionAnnot(const Function *F, std::ostream &OS) {} 350836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner 360b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner // emitBasicBlockStartAnnot - This may be implemented to emit a string right 370b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner // after the basic block label, but before the first instruction in the block. 380b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner virtual void emitBasicBlockStartAnnot(const BasicBlock *BB, std::ostream &OS){ 390b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner } 400b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner 410b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner // emitBasicBlockEndAnnot - This may be implemented to emit a string right 420b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner // after the basic block. 430b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, std::ostream &OS){ 440b6af79e627ca1222b1bf67dd555e41a3252ba77Chris Lattner } 450836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner 460836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner // emitInstructionAnnot - This may be implemented to emit a string right 470836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner // before an instruction is emitted. 480836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner virtual void emitInstructionAnnot(const Instruction *I, std::ostream &OS) {} 490836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner}; 500836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner 51d0fde30ce850b78371fd1386338350591f9ff494Brian Gaeke} // End llvm namespace 52d0fde30ce850b78371fd1386338350591f9ff494Brian Gaeke 530836bf7bcf5d62393eb6c01f775368d43e3d45cbChris Lattner#endif 54