[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Feb 14 22:15:01 PST 2004


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.77 -> 1.78

---
Log message:

ConstantArray::get and ConstantStruct::get now just return pointers to 
'Constant', instead of specific subclass pointers.  In the future, these will 
return an instance of ConstantAggregateZero if all of the inputs are zeros.


---
Diffs of the changes:  (+4 -4)

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.77 llvm/lib/VMCore/Constants.cpp:1.78
--- llvm/lib/VMCore/Constants.cpp:1.77	Sat Feb 14 22:07:32 2004
+++ llvm/lib/VMCore/Constants.cpp	Sat Feb 14 22:14:47 2004
@@ -786,7 +786,7 @@
 static ValueMap<std::vector<Constant*>, ArrayType,
                 ConstantArray> ArrayConstants;
 
-ConstantArray *ConstantArray::get(const ArrayType *Ty,
+Constant *ConstantArray::get(const ArrayType *Ty,
                                   const std::vector<Constant*> &V) {
   return ArrayConstants.getOrCreate(Ty, V);
 }
@@ -802,7 +802,7 @@
 // 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<Constant*> ElementVals;
 
   for (unsigned i = 0; i < Str.length(); ++i)
@@ -866,8 +866,8 @@
 static ValueMap<std::vector<Constant*>, StructType, 
                 ConstantStruct> StructConstants;
 
-ConstantStruct *ConstantStruct::get(const StructType *Ty,
-                                    const std::vector<Constant*> &V) {
+Constant *ConstantStruct::get(const StructType *Ty,
+                              const std::vector<Constant*> &V) {
   return StructConstants.getOrCreate(Ty, V);
 }
 





More information about the llvm-commits mailing list