X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FMachineConstantPool.h;h=f05a540d38e5b992a1ea9a009929c7a62098cdf7;hb=80a75bfae980df96f969f1c05b0c4a80ce975240;hp=17ddcf18237443946986b3e21a65e8c14a7666a1;hpb=583bd47f777fe3eb8305872fa0eadab31e833dff;p=oota-llvm.git diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h index 17ddcf18237..f05a540d38e 100644 --- a/include/llvm/CodeGen/MachineConstantPool.h +++ b/include/llvm/CodeGen/MachineConstantPool.h @@ -17,6 +17,7 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/Support/Streams.h" #include #include @@ -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 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. ///