- CE->getIndices() : SmallVector<unsigned, 4>());
- }
-};
-
-// ConstantAggregateZero does not take extra "value" argument...
-template<class ValType>
-struct ConstantCreator<ConstantAggregateZero, Type, ValType> {
- static ConstantAggregateZero *create(const Type *Ty, const ValType &V){
- return new ConstantAggregateZero(Ty);
- }
-};
-
-template<>
-struct ConstantKeyData<ConstantVector> {
- typedef std::vector<Constant*> ValType;
- static ValType getValType(ConstantVector *CP) {
- std::vector<Constant*> Elements;
- Elements.reserve(CP->getNumOperands());
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
- Elements.push_back(CP->getOperand(i));
- return Elements;
- }
-};
-
-template<>
-struct ConstantKeyData<ConstantAggregateZero> {
- typedef char ValType;
- static ValType getValType(ConstantAggregateZero *C) {
- return 0;
- }
-};
-
-template<>
-struct ConstantKeyData<ConstantArray> {
- typedef std::vector<Constant*> ValType;
- static ValType getValType(ConstantArray *CA) {
- std::vector<Constant*> Elements;
- Elements.reserve(CA->getNumOperands());
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i)
- Elements.push_back(cast<Constant>(CA->getOperand(i)));
- return Elements;
- }
-};
-
-template<>
-struct ConstantKeyData<ConstantStruct> {
- typedef std::vector<Constant*> ValType;
- static ValType getValType(ConstantStruct *CS) {
- std::vector<Constant*> Elements;
- Elements.reserve(CS->getNumOperands());
- for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i)
- Elements.push_back(cast<Constant>(CS->getOperand(i)));
- return Elements;
- }
-};
-
-// ConstantPointerNull does not take extra "value" argument...
-template<class ValType>
-struct ConstantCreator<ConstantPointerNull, PointerType, ValType> {
- static ConstantPointerNull *create(const PointerType *Ty, const ValType &V){
- return new ConstantPointerNull(Ty);