X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FMachineConstantPool.h;h=f05a540d38e5b992a1ea9a009929c7a62098cdf7;hb=80a75bfae980df96f969f1c05b0c4a80ce975240;hp=6bb2665985ece2be7035cc241eb916932c530baf;hpb=b5ebf15b2b2ce8989caf1a1114b05d80b0f9bd48;p=oota-llvm.git diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h index 6bb2665985e..f05a540d38e 100644 --- a/include/llvm/CodeGen/MachineConstantPool.h +++ b/include/llvm/CodeGen/MachineConstantPool.h @@ -35,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,17 +49,10 @@ public: /// print - Implement operator<<... /// - void print(llvm_ostream &O) const { - if (O.stream()) print(*O.stream()); - } virtual void print(std::ostream &O) const = 0; + void print(std::ostream *O) const { if (O) print(*O); } }; -inline llvm_ostream &operator<<(llvm_ostream &OS, - const MachineConstantPoolValue &V) { - V.print(OS); - return OS; -} inline std::ostream &operator<<(std::ostream &OS, const MachineConstantPoolValue &V) { V.print(OS); @@ -121,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 @@ -143,10 +137,8 @@ public: /// print - Used by the MachineFunction printer to print information about /// constant pool objects. Implemented in MachineFunction.cpp /// - void print(llvm_ostream &OS) const { - if (OS.stream()) print(*OS.stream()); - } 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. ///