#include "llvm/ConstPoolVals.h"
#include "llvm/Instruction.h"
#include "llvm/Type.h"
+class PointerType;
namespace opt {
virtual ConstPoolUInt *castToULong (const ConstPoolVal *V) const = 0;
virtual ConstPoolFP *castToFloat (const ConstPoolVal *V) const = 0;
virtual ConstPoolFP *castToDouble(const ConstPoolVal *V) const = 0;
+ virtual ConstPoolPointer *castToPointer(const ConstPoolVal *V,
+ const PointerType *Ty) const = 0;
inline ConstPoolVal *castTo(const ConstPoolVal *V, const Type *Ty) const {
switch (Ty->getPrimitiveID()) {
case Type::LongTyID: return castToLong(V);
case Type::FloatTyID: return castToFloat(V);
case Type::DoubleTyID: return castToDouble(V);
+ case Type::PointerTyID:return castToPointer(V, (PointerType*)Ty);
default: return 0;
}
}