Revamp the "ConstantStruct::get" methods. Previously, these were scattered

all over the place in different styles and variants.  Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).  

It would be "really really nice" if the ConstantStruct::get and 
ConstantVector::get methods didn't make temporary std::vectors.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133412 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2011-06-20 04:01:31 +00:00
parent 5d6fa7f2ac
commit b065b06c12
13 changed files with 145 additions and 114 deletions

View File

@ -1399,7 +1399,7 @@ llvm::ConstantFoldCall(Function *F,
ConstantInt::get(F->getContext(), Res),
ConstantInt::get(Type::getInt1Ty(F->getContext()), Overflow)
};
return ConstantStruct::get(F->getContext(), Ops, 2, false);
return ConstantStruct::get(cast<StructType>(F->getReturnType()), Ops);
}
}
}