[llvm-commits] [llvm] r79796 - in /llvm/trunk: include/llvm/CodeGen/Dump.h include/llvm/CodeGen/MachineBasicBlock.h include/llvm/CodeGen/MachineFunction.h lib/CodeGen/Dump.cpp lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/MachineFunction.cpp

Chris Lattner sabre at nondot.org
Sat Aug 22 17:47:04 PDT 2009


Author: lattner
Date: Sat Aug 22 19:47:04 2009
New Revision: 79796

URL: http://llvm.org/viewvc/llvm-project?rev=79796&view=rev
Log:
remove dead PrefixPrinter class.

Removed:
    llvm/trunk/include/llvm/CodeGen/Dump.h
    llvm/trunk/lib/CodeGen/Dump.cpp
Modified:
    llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
    llvm/trunk/include/llvm/CodeGen/MachineFunction.h
    llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
    llvm/trunk/lib/CodeGen/MachineFunction.cpp

Removed: llvm/trunk/include/llvm/CodeGen/Dump.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Dump.h?rev=79795&view=auto

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/Dump.h (original)
+++ llvm/trunk/include/llvm/CodeGen/Dump.h (removed)
@@ -1,60 +0,0 @@
-//===- 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_CODEGEN_DUMP_H
-#define LLVM_CODEGEN_DUMP_H
-
-#include <iosfwd>
-
-namespace llvm {
-
-class MachineBasicBlock;
-class MachineInstr;
-class raw_ostream;
-
-/// PrefixPrinter - Print some additional information before printing
-/// basic blocks and instructions.
-class PrefixPrinter {
-public:
-  virtual ~PrefixPrinter();
-
-  /// operator() - Print a prefix before each MachineBasicBlock
-  virtual raw_ostream &operator()(raw_ostream &out,
-                                  const MachineBasicBlock &) const {
-    return out; 
-  }
-
-  /// operator() - Print a prefix before each MachineInstr
-  virtual raw_ostream &operator()(raw_ostream &out,
-                                  const MachineInstr &) const {
-    return out; 
-  }
-
-  /// operator() - Print a prefix before each MachineBasicBlock
-  virtual std::ostream &operator()(std::ostream &out,
-                                   const MachineBasicBlock &) const {
-    return out; 
-  }
-
-  /// operator() - Print a prefix before each MachineInstr
-  virtual std::ostream &operator()(std::ostream &out,
-                                   const MachineInstr &) const {
-    return out; 
-  }
-};
- 
-} // End llvm namespace
-
-#endif

Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=79796&r1=79795&r2=79796&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Sat Aug 22 19:47:04 2009
@@ -16,7 +16,6 @@
 
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/CodeGen/Dump.h"
 
 namespace llvm {
 
@@ -311,17 +310,13 @@
 
   // Debugging methods.
   void dump() const;
-  void print(std::ostream &OS,
-             const PrefixPrinter &prefix = PrefixPrinter()) const;
-  void print(std::ostream *OS,
-             const PrefixPrinter &prefix = PrefixPrinter()) const {
-    if (OS) print(*OS, prefix); 
-  }
-  void print(raw_ostream &OS,
-             const PrefixPrinter &prefix = PrefixPrinter()) const;
-  void print(raw_ostream *OS,
-             const PrefixPrinter &prefix = PrefixPrinter()) const {
-    if (OS) print(*OS, prefix);
+  void print(std::ostream &OS) const;
+  void print(std::ostream *OS) const {
+    if (OS) print(*OS); 
+  }
+  void print(raw_ostream &OS) const;
+  void print(raw_ostream *OS) const {
+    if (OS) print(*OS);
   }
 
   /// getNumber - MachineBasicBlocks are uniquely numbered at the function

Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=79796&r1=79795&r2=79796&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Sat Aug 22 19:47:04 2009
@@ -18,13 +18,12 @@
 #ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
 #define LLVM_CODEGEN_MACHINEFUNCTION_H
 
-#include <map>
+#include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/ADT/ilist.h"
 #include "llvm/Support/DebugLoc.h"
-#include "llvm/CodeGen/Dump.h"
-#include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Recycler.h"
+#include <map>
 
 namespace llvm {
 
@@ -208,11 +207,9 @@
   /// print - Print out the MachineFunction in a format suitable for debugging
   /// to the specified stream.
   ///
-  void print(std::ostream &OS, 
-             const PrefixPrinter &prefix = PrefixPrinter()) const;
-  void print(std::ostream *OS,
-             const PrefixPrinter &prefix = PrefixPrinter()) const {
-    if (OS) print(*OS, prefix); 
+  void print(std::ostream &OS) const;
+  void print(std::ostream *OS) const {
+    if (OS) print(*OS); 
   }
 
   /// viewCFG - This function is meant for use from the debugger.  You can just

Removed: llvm/trunk/lib/CodeGen/Dump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Dump.cpp?rev=79795&view=auto

==============================================================================
--- llvm/trunk/lib/CodeGen/Dump.cpp (original)
+++ llvm/trunk/lib/CodeGen/Dump.cpp (removed)
@@ -1,18 +0,0 @@
-//===- lib/Support/Dump.h - Virtual function homes --------------*- 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 virtual function homes.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/CodeGen/Dump.h"
-
-using namespace llvm;
-
-PrefixPrinter::~PrefixPrinter() {}

Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=79796&r1=79795&r2=79796&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Sat Aug 22 19:47:04 2009
@@ -173,14 +173,12 @@
     os << " %reg" << RegNo;
 }
 
-void MachineBasicBlock::print(std::ostream &OS,
-                              const PrefixPrinter &prefix) const {
+void MachineBasicBlock::print(std::ostream &OS) const {
   raw_os_ostream RawOS(OS);
-  print(RawOS, prefix);
+  print(RawOS);
 }
 
-void MachineBasicBlock::print(raw_ostream &OS,
-                              const PrefixPrinter &prefix) const {
+void MachineBasicBlock::print(raw_ostream &OS) const {
   const MachineFunction *MF = getParent();
   if (!MF) {
     OS << "Can't print out MachineBasicBlock because parent MachineFunction"
@@ -213,7 +211,7 @@
   }
   
   for (const_iterator I = begin(); I != end(); ++I) {
-    prefix(OS, *I) << '\t';
+    OS << '\t';
     I->print(OS, &getParent()->getTarget());
   }
 

Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=79796&r1=79795&r2=79796&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Sat Aug 22 19:47:04 2009
@@ -220,9 +220,8 @@
   print(*cerr.stream());
 }
 
-void MachineFunction::print(std::ostream &OS,
-                            const PrefixPrinter &prefix) const {
-  OS << "# Machine code for " << Fn->getNameStr () << "():\n";
+void MachineFunction::print(std::ostream &OS) const {
+  OS << "# Machine code for " << Fn->getNameStr() << "():\n";
 
   // Print Frame Information
   FrameInfo->print(*this, OS);
@@ -263,12 +262,10 @@
     OS << "\n";
   }
   
-  for (const_iterator BB = begin(); BB != end(); ++BB) {
-    prefix(OS, *BB);
-    BB->print(OS, prefix);
-  }
+  for (const_iterator BB = begin(), E = end(); BB != E; ++BB)
+    BB->print(OS);
 
-  OS << "\n# End machine code for " << Fn->getNameStr () << "().\n\n";
+  OS << "\n# End machine code for " << Fn->getNameStr() << "().\n\n";
 }
 
 namespace llvm {





More information about the llvm-commits mailing list