diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 7e728794181..0921cbb21bb 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -321,8 +321,8 @@ protected: ConstantArray(const ArrayType *T, const std::vector &Val); public: /// get() - Static factory methods - Return objects of the specified value - static ConstantArray *get(const ArrayType *T, const std::vector &); - static ConstantArray *get(const std::string &Initializer); + static Constant *get(const ArrayType *T, const std::vector &); + static Constant *get(const std::string &Initializer); /// getType - Specialize the getType() method to always return an ArrayType, /// which reduces the amount of casting needed in parts of the compiler. @@ -383,8 +383,7 @@ protected: ConstantStruct(const StructType *T, const std::vector &Val); public: /// get() - Static factory methods - Return objects of the specified value - static ConstantStruct *get(const StructType *T, - const std::vector &V); + static Constant *get(const StructType *T, const std::vector &V); /// getType() specialization - Reduce amount of casting... inline const StructType *getType() const { diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 06f23c165ec..e13a1daad52 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -786,7 +786,7 @@ namespace llvm { static ValueMap, ArrayType, ConstantArray> ArrayConstants; -ConstantArray *ConstantArray::get(const ArrayType *Ty, +Constant *ConstantArray::get(const ArrayType *Ty, const std::vector &V) { return ArrayConstants.getOrCreate(Ty, V); } @@ -802,7 +802,7 @@ void ConstantArray::destroyConstant() { // contain the specified string. A null terminator is added to the specified // string so that it may be used in a natural way... // -ConstantArray *ConstantArray::get(const std::string &Str) { +Constant *ConstantArray::get(const std::string &Str) { std::vector ElementVals; for (unsigned i = 0; i < Str.length(); ++i) @@ -866,8 +866,8 @@ namespace llvm { static ValueMap, StructType, ConstantStruct> StructConstants; -ConstantStruct *ConstantStruct::get(const StructType *Ty, - const std::vector &V) { +Constant *ConstantStruct::get(const StructType *Ty, + const std::vector &V) { return StructConstants.getOrCreate(Ty, V); }