diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index a338b1fce2c..877995203e9 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -30,6 +30,7 @@ class ConstantAggregateZero; class ConstantArray; class ConstantFP; class ConstantVector; +class UndefValue; class IntegerType; class PointerType; class StructType; @@ -57,6 +58,9 @@ public: Constant* getNullValue(const Type* Ty); Constant* getAllOnesValue(const Type* Ty); + // UndefValue accessors + UndefValue* getUndef(const Type* Ty); + // ConstantInt accessors ConstantInt* getConstantIntTrue(); ConstantInt* getConstantIntFalse(); diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index e30ad3f9004..1987463af30 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -38,6 +38,11 @@ Constant* LLVMContext::getAllOnesValue(const Type* Ty) { return Constant::getAllOnesValue(Ty); } +// UndefValue accessors. +UndefValue* LLVMContext::getUndef(const Type* Ty) { + return UndefValue::get(Ty); +} + // ConstantInt accessors. ConstantInt* LLVMContext::getConstantIntTrue() { return ConstantInt::getTrue();