OSDN Git Service

Make ConstantAggregateZero::get return a ConstantAggregateZero*,
authorDan Gohman <gohman@apple.com>
Mon, 8 Dec 2008 07:10:54 +0000 (07:10 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 8 Dec 2008 07:10:54 +0000 (07:10 +0000)
as suggested in PR3182.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60691 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Constants.h
lib/VMCore/Constants.cpp

index 0706f61..28ebe55 100644 (file)
@@ -295,7 +295,7 @@ protected:
 public:
   /// get() - static factory method for creating a null aggregate.  It is
   /// illegal to call this method with a non-aggregate type.
-  static Constant *get(const Type *Ty);
+  static ConstantAggregateZero *get(const Type *Ty);
 
   /// isNullValue - Return true if this is the value that would be returned by
   /// getNullValue.
index 55b8700..5fc08dc 100644 (file)
@@ -1268,7 +1268,7 @@ static ManagedStatic<ValueMap<char, Type,
 
 static char getValType(ConstantAggregateZero *CPZ) { return 0; }
 
-Constant *ConstantAggregateZero::get(const Type *Ty) {
+ConstantAggregateZero *ConstantAggregateZero::get(const Type *Ty) {
   assert((isa<StructType>(Ty) || isa<ArrayType>(Ty) || isa<VectorType>(Ty)) &&
          "Cannot create an aggregate zero of non-aggregate type!");
   return AggZeroConstants->getOrCreate(Ty, 0);