#include "llvm/ADT/FoldingSet.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
+#include "llvm/Support/Streams.h"
#include <vector>
#include <iosfwd>
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.
///
/// 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,
/// 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;
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
/// 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.
///