LLVM API Documentation

Dump.h

Go to the documentation of this file.
00001 //===- llvm/Support/Dump.h - Easy way to tailor dump output -----*- 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 // This file provides the PrefixPrinter interface to pass to MachineFunction
00011 // and MachineBasicBlock print methods to output additional information before
00012 // blocks and instructions are printed.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 
00016 #ifndef LLVM_CODEGEN_DUMP_H
00017 #define LLVM_CODEGEN_DUMP_H
00018 
00019 #include <iosfwd>
00020 
00021 namespace llvm {
00022 
00023 class MachineBasicBlock;
00024 class MachineInstr;
00025 class raw_ostream;
00026 
00027 /// PrefixPrinter - Print some additional information before printing
00028 /// basic blocks and instructions.
00029 class PrefixPrinter {
00030 public:
00031   virtual ~PrefixPrinter();
00032 
00033   /// operator() - Print a prefix before each MachineBasicBlock
00034   virtual raw_ostream &operator()(raw_ostream &out,
00035                                   const MachineBasicBlock &) const {
00036     return out; 
00037   }
00038 
00039   /// operator() - Print a prefix before each MachineInstr
00040   virtual raw_ostream &operator()(raw_ostream &out,
00041                                   const MachineInstr &) const {
00042     return out; 
00043   }
00044 
00045   /// operator() - Print a prefix before each MachineBasicBlock
00046   virtual std::ostream &operator()(std::ostream &out,
00047                                    const MachineBasicBlock &) const {
00048     return out; 
00049   }
00050 
00051   /// operator() - Print a prefix before each MachineInstr
00052   virtual std::ostream &operator()(std::ostream &out,
00053                                    const MachineInstr &) const {
00054     return out; 
00055   }
00056 };
00057  
00058 } // End llvm namespace
00059 
00060 #endif