Move a few more convenience factory functions from Constant to LLVMContext.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-15 21:51:10 +00:00
parent 7add5ff1d1
commit a90b3dc2f1
9 changed files with 57 additions and 56 deletions

View File

@ -1617,7 +1617,8 @@ BinaryOperator *BinaryOperator::CreateNot(LLVMContext &Context,
Constant *C;
if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
C = Context.getAllOnesValue(PTy->getElementType());
C = ConstantVector::get(std::vector<Constant*>(PTy->getNumElements(), C));
C = Context.getConstantVector(
std::vector<Constant*>(PTy->getNumElements(), C));
} else {
C = Context.getAllOnesValue(Op->getType());
}
@ -1633,8 +1634,8 @@ BinaryOperator *BinaryOperator::CreateNot(LLVMContext &Context,
if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
// Create a vector of all ones values.
Constant *Elt = Context.getAllOnesValue(PTy->getElementType());
AllOnes =
ConstantVector::get(std::vector<Constant*>(PTy->getNumElements(), Elt));
AllOnes = Context.getConstantVector(
std::vector<Constant*>(PTy->getNumElements(), Elt));
} else {
AllOnes = Context.getAllOnesValue(Op->getType());
}