Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:56

0001 //===-- AssemblyAnnotationWriter.h - Annotation .ll files -------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Clients of the assembly writer can use this interface to add their own
0010 // special-purpose annotations to LLVM assembly language printouts.  Note that
0011 // the assembly parser won't be able to parse these, in general, so
0012 // implementations are advised to print stuff as LLVM comments.
0013 //
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_IR_ASSEMBLYANNOTATIONWRITER_H
0017 #define LLVM_IR_ASSEMBLYANNOTATIONWRITER_H
0018 
0019 namespace llvm {
0020 
0021 class Function;
0022 class BasicBlock;
0023 class Instruction;
0024 class Value;
0025 class formatted_raw_ostream;
0026 
0027 class AssemblyAnnotationWriter {
0028 public:
0029   virtual ~AssemblyAnnotationWriter();
0030 
0031   /// emitFunctionAnnot - This may be implemented to emit a string right before
0032   /// the start of a function.
0033   virtual void emitFunctionAnnot(const Function *,
0034                                  formatted_raw_ostream &) {}
0035 
0036   /// emitBasicBlockStartAnnot - This may be implemented to emit a string right
0037   /// after the basic block label, but before the first instruction in the
0038   /// block.
0039   virtual void emitBasicBlockStartAnnot(const BasicBlock *,
0040                                         formatted_raw_ostream &) {
0041   }
0042 
0043   /// emitBasicBlockEndAnnot - This may be implemented to emit a string right
0044   /// after the basic block.
0045   virtual void emitBasicBlockEndAnnot(const BasicBlock *,
0046                                       formatted_raw_ostream &) {
0047   }
0048 
0049   /// emitInstructionAnnot - This may be implemented to emit a string right
0050   /// before an instruction is emitted.
0051   virtual void emitInstructionAnnot(const Instruction *,
0052                                     formatted_raw_ostream &) {}
0053 
0054   /// printInfoComment - This may be implemented to emit a comment to the
0055   /// right of an instruction or global value.
0056   virtual void printInfoComment(const Value &, formatted_raw_ostream &) {}
0057 };
0058 
0059 } // End llvm namespace
0060 
0061 #endif