class ArrayType;
class StructType;
+class PointerType;
//===----------------------------------------------------------------------===//
// ConstPoolVal Class
inline const vector<Use> &getValues() const { return Operands; }
};
+//===---------------------------------------------------------------------------
+// ConstPoolPointer - Constant Pointer Declarations
+//
+// The ConstPoolPointer class represents a null pointer of a specific type. For
+// a more specific/useful instance, a subclass of ConstPoolPointer should be
+// used.
+//
+class ConstPoolPointer : public ConstPoolVal {
+ ConstPoolPointer(const ConstPoolPointer &); // DO NOT IMPLEMENT
+protected:
+ ConstPoolPointer(const PointerType *T);
+ ~ConstPoolPointer() {}
+public:
+ static ConstPoolPointer *getNullPointer(const PointerType *T) {
+ return new ConstPoolPointer(T);
+ }
+
+ virtual string getStrValue() const;
+};
+
#endif
case Type::FloatTyID:
case Type::DoubleTyID: return ConstPoolFP::get(Ty, 0);
+
+ case Type::PointerTyID:
+ return ConstPoolPointer::getNullPointer(Ty->castPointerType());
default:
return 0;
}
}
}
+ConstPoolPointer::ConstPoolPointer(const PointerType *T) : ConstPoolVal(T) {}
+
//===----------------------------------------------------------------------===//
// getStrValue implementations
return Result + " }";
}
+string ConstPoolPointer::getStrValue() const {
+ return "null";
+}
+
//===----------------------------------------------------------------------===//
// isValueValidForType implementations