summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/ConstPoolVals.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/ConstPoolVals.cpp b/llvm/lib/VMCore/ConstPoolVals.cpp
index d53130d6012..152209dcc7d 100644
--- a/llvm/lib/VMCore/ConstPoolVals.cpp
+++ b/llvm/lib/VMCore/ConstPoolVals.cpp
@@ -43,6 +43,9 @@ ConstPoolVal *ConstPoolVal::getNullConstant(const Type *Ty) {
case Type::FloatTyID:
case Type::DoubleTyID: return ConstPoolFP::get(Ty, 0);
+
+ case Type::PointerTyID:
+ return ConstPoolPointer::getNullPointer(Ty->castPointerType());
default:
return 0;
}
@@ -98,6 +101,8 @@ ConstPoolStruct::ConstPoolStruct(const StructType *T,
}
}
+ConstPoolPointer::ConstPoolPointer(const PointerType *T) : ConstPoolVal(T) {}
+
//===----------------------------------------------------------------------===//
// getStrValue implementations
@@ -144,6 +149,10 @@ string ConstPoolStruct::getStrValue() const {
return Result + " }";
}
+string ConstPoolPointer::getStrValue() const {
+ return "null";
+}
+
//===----------------------------------------------------------------------===//
// isValueValidForType implementations
OpenPOWER on IntegriCloud