Eliminate the loop that searches through each of the operands
[oota-llvm.git] / include / llvm / CodeGen / MachineConstantPool.h
index ba491ce2556cdefe28eb368db4ea4a22d83a54d0..cfa192aca6b26fb80247df3185724c95a430ef1c 100644 (file)
 #ifndef LLVM_CODEGEN_MACHINECONSTANTPOOL_H
 #define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
 
-#include "llvm/ADT/FoldingSet.h"
-#include "llvm/Support/Streams.h"
 #include <cassert>
 #include <vector>
-#include <iosfwd>
 
 namespace llvm {
 
-class AsmPrinter;
 class Constant;
+class FoldingSetNodeID;
 class TargetData;
 class TargetMachine;
 class Type;
 class MachineConstantPool;
+class raw_ostream;
 
 /// Abstract base class for all machine specific constantpool value subclasses.
 ///
@@ -48,17 +46,16 @@ public:
 
   virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID) = 0;
 
-  /// print - Implement operator<<...
-  ///
-  virtual void print(std::ostream &O) const = 0;
-  void print(std::ostream *O) const { if (O) print(*O); }
+  /// print - Implement operator<<
+  virtual void print(raw_ostream &O) const = 0;
 };
 
-inline std::ostream &operator<<(std::ostream &OS,
-                                const MachineConstantPoolValue &V) {
+inline raw_ostream &operator<<(raw_ostream &OS,
+                               const MachineConstantPoolValue &V) {
   V.print(OS);
   return OS;
 }
+  
 
 /// This class is a data container for one entry in a MachineConstantPool.
 /// It contains a pointer to the value and an offset from the start of
@@ -124,7 +121,8 @@ public:
   unsigned getConstantPoolAlignment() const { return PoolAlignment; }
   
   /// getConstantPoolIndex - Create a new entry in the constant pool or return
-  /// an existing one.  User must specify an alignment in bytes for the object.
+  /// an existing one.  User must specify the log2 of the minimum required
+  /// alignment for the object.
   unsigned getConstantPoolIndex(Constant *C, unsigned Alignment);
   unsigned getConstantPoolIndex(MachineConstantPoolValue *V,unsigned Alignment);
   
@@ -138,11 +136,9 @@ public:
   /// print - Used by the MachineFunction printer to print information about
   /// constant pool objects.  Implemented in MachineFunction.cpp
   ///
-  void print(std::ostream &OS) const;
-  void print(std::ostream *OS) const { if (OS) print(*OS); }
+  void print(raw_ostream &OS) const;
 
-  /// dump - Call print(std::cerr) to be called from the debugger.
-  ///
+  /// dump - Call print(cerr) to be called from the debugger.
   void dump() const;
 };