summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-07-21 18:21:46 +0000
committerDavid Greene <greened@obbligato.org>2009-07-21 18:21:46 +0000
commit92ebf9dd6eca31e4c6b8b380fbdaa30736098d9e (patch)
tree09e3e29335b1aa37147ae70e29b243f485e0ad7e /llvm
parent5e165083a0ea5e70b83d152efe295f84e79146ae (diff)
downloadbcm5719-llvm-92ebf9dd6eca31e4c6b8b380fbdaa30736098d9e.tar.gz
bcm5719-llvm-92ebf9dd6eca31e4c6b8b380fbdaa30736098d9e.zip
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. llvm-svn: 76602
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Dump.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/Dump.h b/llvm/include/llvm/Support/Dump.h
new file mode 100644
index 00000000000..a95875b6816
--- /dev/null
+++ b/llvm/include/llvm/Support/Dump.h
@@ -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
OpenPOWER on IntegriCloud