Adding a collector name attribute to Function in the IR. These
[oota-llvm.git] / include / llvm / CodeGen / MachineConstantPool.h
index 17ddcf18237443946986b3e21a65e8c14a7666a1..f05a540d38e5b992a1ea9a009929c7a62098cdf7 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
+#include "llvm/Support/Streams.h"
 #include <vector>
 #include <iosfwd>
 
@@ -34,8 +35,8 @@ class MachineConstantPoolValue {
   const Type *Ty;
 
 public:
-  MachineConstantPoolValue(const Type *ty) : Ty(ty) {}
-  virtual ~MachineConstantPoolValue() {};
+  explicit MachineConstantPoolValue(const Type *ty) : Ty(ty) {}
+  virtual ~MachineConstantPoolValue() {}
 
   /// getType - get type of this MachineConstantPoolValue.
   ///
@@ -49,6 +50,7 @@ public:
   /// print - Implement operator<<...
   ///
   virtual void print(std::ostream &O) const = 0;
+  void print(std::ostream *O) const { if (O) print(*O); }
 };
 
 inline std::ostream &operator<<(std::ostream &OS,
@@ -61,7 +63,8 @@ inline std::ostream &operator<<(std::ostream &OS,
 /// It contains a pointer to the value and an offset from the start of
 /// the constant pool.
 /// @brief An entry in a MachineConstantPool
-struct MachineConstantPoolEntry {
+class MachineConstantPoolEntry {
+public:
   /// The constant itself.
   union {
     Constant *ConstVal;
@@ -111,7 +114,8 @@ class MachineConstantPool {
   std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants.
 public:
   /// @brief The only constructor.
-  MachineConstantPool(const TargetData *td) : TD(td), PoolAlignment(1) {}
+  explicit MachineConstantPool(const TargetData *td)
+    : TD(td), PoolAlignment(1) {}
   ~MachineConstantPool();
     
   /// getConstantPoolAlignment - Return the log2 of the alignment required by
@@ -134,6 +138,7 @@ public:
   /// constant pool objects.  Implemented in MachineFunction.cpp
   ///
   void print(std::ostream &OS) const;
+  void print(std::ostream *OS) const { if (OS) print(*OS); }
 
   /// dump - Call print(std::cerr) to be called from the debugger.
   ///