};
static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos,
+ IIT_Info LastInfo,
SmallVectorImpl<Intrinsic::IITDescriptor> &OutputTable) {
using namespace Intrinsic;
- bool IsScalableVector = false;
- if (NextElt > 0) {
- IIT_Info LastInfo = IIT_Info(Infos[NextElt - 1]);
- IsScalableVector = (LastInfo == IIT_SCALABLE_VEC);
- }
+ bool IsScalableVector = (LastInfo == IIT_SCALABLE_VEC);
IIT_Info Info = IIT_Info(Infos[NextElt++]);
unsigned StructElts = 2;
return;
case IIT_V1:
OutputTable.push_back(IITDescriptor::getVector(1, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V2:
OutputTable.push_back(IITDescriptor::getVector(2, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V4:
OutputTable.push_back(IITDescriptor::getVector(4, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V8:
OutputTable.push_back(IITDescriptor::getVector(8, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V16:
OutputTable.push_back(IITDescriptor::getVector(16, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V32:
OutputTable.push_back(IITDescriptor::getVector(32, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V64:
OutputTable.push_back(IITDescriptor::getVector(64, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V128:
OutputTable.push_back(IITDescriptor::getVector(128, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V512:
OutputTable.push_back(IITDescriptor::getVector(512, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_V1024:
OutputTable.push_back(IITDescriptor::getVector(1024, IsScalableVector));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_PTR:
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Pointer, 0));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
case IIT_ANYPTR: { // [ANYPTR addrspace, subtype]
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Pointer,
Infos[NextElt++]));
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
}
case IIT_ARG: {
OutputTable.push_back(IITDescriptor::get(IITDescriptor::Struct,StructElts));
for (unsigned i = 0; i != StructElts; ++i)
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
}
case IIT_SUBDIVIDE2_ARG: {
return;
}
case IIT_SCALABLE_VEC: {
- DecodeIITType(NextElt, Infos, OutputTable);
+ DecodeIITType(NextElt, Infos, Info, OutputTable);
return;
}
case IIT_VEC_OF_BITCASTS_TO_INT: {
}
// Okay, decode the table into the output vector of IITDescriptors.
- DecodeIITType(NextElt, IITEntries, T);
+ DecodeIITType(NextElt, IITEntries, IIT_Done, T);
while (NextElt != IITEntries.size() && IITEntries[NextElt] != 0)
- DecodeIITType(NextElt, IITEntries, T);
+ DecodeIITType(NextElt, IITEntries, IIT_Done, T);
}
static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos,