@@ -997,10 +997,10 @@ void JSONBuiltinInterfaceEmitter::ExpandType(const Record *Ty) {
997
997
998
998
bool IsCompound = Ty->isSubClassOf (" CompoundType" );
999
999
if (IsCompound) {
1000
- auto *EltRecord = Ty->getValueAsDef (" ElementType" );
1000
+ const Record *EltRecord = Ty->getValueAsDef (" ElementType" );
1001
1001
ExpandType (EltRecord);
1002
1002
Expansion = ExpandedTypes[EltRecord];
1003
- for (auto &TypeStr : Expansion) {
1003
+ for (std::string &TypeStr : Expansion) {
1004
1004
if (TypeDesc.IsPointer ) {
1005
1005
if (TypeDesc.IsConst )
1006
1006
TypeStr += " const" ;
@@ -1017,10 +1017,12 @@ void JSONBuiltinInterfaceEmitter::ExpandType(const Record *Ty) {
1017
1017
1018
1018
if (Ty->isSubClassOf (" GenericType" )) {
1019
1019
assert (!Expansion.size () && " Types already expanded" );
1020
- auto NVec = Ty->getValueAsDef (" VectorList" )->getValueAsListOfInts (" List" );
1021
- auto NTypes = Ty->getValueAsDef (" TypeList" )->getValueAsListOfDefs (" List" );
1022
- for (auto SubT : NTypes) {
1023
- for (auto VecWidth : NVec) {
1020
+ std::vector<long int > NVec =
1021
+ Ty->getValueAsDef (" VectorList" )->getValueAsListOfInts (" List" );
1022
+ std::vector<Record *> NTypes =
1023
+ Ty->getValueAsDef (" TypeList" )->getValueAsListOfDefs (" List" );
1024
+ for (const Record *SubT : NTypes) {
1025
+ for (long int VecWidth : NVec) {
1024
1026
JSONBuiltinInterfaceEmitter::TypeDesc TypeDesc (SubT);
1025
1027
TypeDesc.VecWidth = VecWidth;
1026
1028
Expansion.emplace_back (TypeDesc.GetBaseTypeAsStr ());
@@ -1034,7 +1036,7 @@ void JSONBuiltinInterfaceEmitter::ExpandType(const Record *Ty) {
1034
1036
}
1035
1037
1036
1038
void JSONBuiltinInterfaceEmitter::ExpandTypes () {
1037
- for (const auto *T : Records.getAllDerivedDefinitions (" Type" )) {
1039
+ for (const Record *T : Records.getAllDerivedDefinitions (" Type" )) {
1038
1040
ExpandType (T);
1039
1041
}
1040
1042
}
@@ -1052,10 +1054,11 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
1052
1054
// For each function names, gather the list of overloads
1053
1055
for (const auto &SLM : SignatureListMap) {
1054
1056
for (const auto &Name : SLM.second .Names ) {
1055
- auto &PrototypeList = NameToProtoList[Name];
1057
+ SmallVectorImpl<FnDesc> &PrototypeList = NameToProtoList[Name];
1056
1058
1057
1059
for (const auto &Overload : SLM.second .Signatures ) {
1058
- auto Signature = Overload.first ->getValueAsListOfDefs (" Signature" );
1060
+ std::vector<Record *> Signature =
1061
+ Overload.first ->getValueAsListOfDefs (" Signature" );
1059
1062
auto SignatureTypesIt = llvm::map_range (
1060
1063
Signature, [this ](const Record *Ty) -> llvm::ArrayRef<std::string> {
1061
1064
return ExpandedTypes[Ty];
@@ -1079,7 +1082,7 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
1079
1082
Proto.IsConst = Overload.first ->getValueAsBit (" IsConst" );
1080
1083
Proto.IsConv = Overload.first ->getValueAsBit (" IsConv" );
1081
1084
Proto.IsVariadic = Overload.first ->getValueAsBit (" IsVariadic" );
1082
- for (const auto & Types : SignatureTypesIt) {
1085
+ for (llvm::ArrayRef<std::string> Types : SignatureTypesIt) {
1083
1086
Proto.Args .emplace_back (Types[idx >= Types.size () ? 0 : idx]);
1084
1087
}
1085
1088
PrototypeList.emplace_back (std::move (Proto));
@@ -1093,7 +1096,7 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
1093
1096
NameToProtoList.keys (), OS,
1094
1097
[&](llvm::StringRef FnName) {
1095
1098
OS << " \" " << FnName << " \" : [\n " ;
1096
- auto &PrototypeList = NameToProtoList[FnName];
1099
+ SmallVectorImpl<FnDesc> &PrototypeList = NameToProtoList[FnName];
1097
1100
// emit ["ty1", "ty2", "ty3"], ["pure"]
1098
1101
llvm::interleave (
1099
1102
PrototypeList, OS,
0 commit comments