mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-03 14:21:30 +00:00 
			
		
		
		
	Make ConstantVector::get() always take an ArrayRef, never a std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133614 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -491,8 +491,6 @@ protected:
 | 
				
			|||||||
public:
 | 
					public:
 | 
				
			||||||
  // ConstantVector accessors
 | 
					  // ConstantVector accessors
 | 
				
			||||||
  static Constant *get(ArrayRef<Constant*> V);
 | 
					  static Constant *get(ArrayRef<Constant*> V);
 | 
				
			||||||
  // FIXME: Eliminate this constructor form.
 | 
					 | 
				
			||||||
  static Constant *get(const VectorType *T, const std::vector<Constant*> &V);
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  /// Transparently provide more efficient getOperand methods.
 | 
					  /// Transparently provide more efficient getOperand methods.
 | 
				
			||||||
  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
 | 
					  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -559,7 +559,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, Constant *V,
 | 
				
			|||||||
      for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i)
 | 
					      for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i)
 | 
				
			||||||
        res.push_back(ConstantExpr::getCast(opc,
 | 
					        res.push_back(ConstantExpr::getCast(opc,
 | 
				
			||||||
                                            CV->getOperand(i), DstEltTy));
 | 
					                                            CV->getOperand(i), DstEltTy));
 | 
				
			||||||
      return ConstantVector::get(DestVecTy, res);
 | 
					      return ConstantVector::get(res);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // We actually have to do a cast now. Perform the cast according to the
 | 
					  // We actually have to do a cast now. Perform the cast according to the
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -698,9 +698,9 @@ ConstantVector::ConstantVector(const VectorType *T,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ConstantVector accessors.
 | 
					// ConstantVector accessors.
 | 
				
			||||||
Constant *ConstantVector::get(const VectorType *T,
 | 
					Constant *ConstantVector::get(ArrayRef<Constant*> V) {
 | 
				
			||||||
                              const std::vector<Constant*> &V) {
 | 
					 | 
				
			||||||
  assert(!V.empty() && "Vectors can't be empty");
 | 
					  assert(!V.empty() && "Vectors can't be empty");
 | 
				
			||||||
 | 
					  const VectorType *T = VectorType::get(V.front()->getType(), V.size());
 | 
				
			||||||
  LLVMContextImpl *pImpl = T->getContext().pImpl;
 | 
					  LLVMContextImpl *pImpl = T->getContext().pImpl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // If this is an all-undef or all-zero vector, return a
 | 
					  // If this is an all-undef or all-zero vector, return a
 | 
				
			||||||
@@ -725,12 +725,6 @@ Constant *ConstantVector::get(const VectorType *T,
 | 
				
			|||||||
  return pImpl->VectorConstants.getOrCreate(T, V);
 | 
					  return pImpl->VectorConstants.getOrCreate(T, V);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Constant *ConstantVector::get(ArrayRef<Constant*> V) {
 | 
					 | 
				
			||||||
  // FIXME: make this the primary ctor method.
 | 
					 | 
				
			||||||
  assert(!V.empty() && "Vectors cannot be empty");
 | 
					 | 
				
			||||||
  return get(VectorType::get(V.front()->getType(), V.size()), V.vec());
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Utility function for determining if a ConstantExpr is a CastOp or not. This
 | 
					// Utility function for determining if a ConstantExpr is a CastOp or not. This
 | 
				
			||||||
// can't be inline because we don't want to #include Instruction.h into
 | 
					// can't be inline because we don't want to #include Instruction.h into
 | 
				
			||||||
// Constant.h
 | 
					// Constant.h
 | 
				
			||||||
@@ -2118,7 +2112,7 @@ void ConstantVector::replaceUsesOfWithOnConstant(Value *From, Value *To,
 | 
				
			|||||||
    Values.push_back(Val);
 | 
					    Values.push_back(Val);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  Constant *Replacement = get(cast<VectorType>(getRawType()), Values);
 | 
					  Constant *Replacement = get(Values);
 | 
				
			||||||
  assert(Replacement != this && "I didn't contain From!");
 | 
					  assert(Replacement != this && "I didn't contain From!");
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Everyone using this now uses the replacement.
 | 
					  // Everyone using this now uses the replacement.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user