[llvm-commits] [llvm] r76602 - /llvm/trunk/include/llvm/Support/Dump.h

David Greene greened at obbligato.org
Tue Jul 21 11:21:48 PDT 2009


Author: greened
Date: Tue Jul 21 13:21:46 2009
New Revision: 76602

URL: http://llvm.org/viewvc/llvm-project?rev=76602&view=rev
Log:

Add a small utility class to configure IR printers.  This will allow
printers to do neat and wonderful things when printing debug
information.  The ideas is to allow passes to configer printers to emit
pass-specific information when dumping IR.

Added:
    llvm/trunk/include/llvm/Support/Dump.h

Added: llvm/trunk/include/llvm/Support/Dump.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dump.h?rev=76602&view=auto

==============================================================================
--- llvm/trunk/include/llvm/Support/Dump.h (added)
+++ llvm/trunk/include/llvm/Support/Dump.h Tue Jul 21 13:21:46 2009
@@ -0,0 +1,41 @@
+//===- llvm/Support/Dump.h - Easy way to tailor dump output -----*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides the PrefixPrinter interface to pass to MachineFunction
+// and MachineBasicBlock print methods to output additional information before
+// blocks and instructions are printed.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_DUMP_H
+#define LLVM_SUPPORT_DUMP_H
+
+namespace llvm {
+
+class MachineBasicBlock;
+class MachineInstr;
+
+// PrefixPrinter - Print some additional information before printing
+// basic blocks and instructions.
+class PrefixPrinter {
+public:
+  virtual ~PrefixPrinter() {}
+
+  virtual std::string operator()(const MachineBasicBlock &) const {
+    return("");
+  };
+
+  virtual std::string operator()(const MachineInstr &) const {
+    return("");
+  };  
+};
+ 
+} // End llvm namespace
+
+#endif





More information about the llvm-commits mailing list