Remove dependence on structure index type. s/MT/FT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-01-09 06:02:51 +00:00
parent d745602662
commit 21949d9088

View File

@ -56,15 +56,15 @@ const Type *MutateStructTypes::ConvertType(const Type *Ty) {
switch (Ty->getPrimitiveID()) {
case Type::FunctionTyID: {
const FunctionType *MT = cast<FunctionType>(Ty);
const Type *RetTy = ConvertType(MT->getReturnType());
const FunctionType *FT = cast<FunctionType>(Ty);
const Type *RetTy = ConvertType(FT->getReturnType());
std::vector<const Type*> ArgTypes;
for (FunctionType::ParamTypes::const_iterator I = MT->getParamTypes().begin(),
E = MT->getParamTypes().end(); I != E; ++I)
for (FunctionType::ParamTypes::const_iterator I = FT->getParamTypes().begin(),
E = FT->getParamTypes().end(); I != E; ++I)
ArgTypes.push_back(ConvertType(*I));
DestTy = FunctionType::get(RetTy, ArgTypes, MT->isVarArg());
DestTy = FunctionType::get(RetTy, ArgTypes, FT->isVarArg());
break;
}
case Type::StructTyID: {
@ -123,7 +123,7 @@ void MutateStructTypes::AdjustIndices(const CompositeType *OldTy,
assert(ElNum < I->second.second.size());
// Apply the XForm specified by Transforms map...
unsigned NewElNum = I->second.second[ElNum];
Idx[i] = ConstantUInt::get(Type::UByteTy, NewElNum);
Idx[i] = ConstantUInt::get(Idx[i]->getType(), NewElNum);
}
}