Lines Matching refs:Index

152   bool compareBy(Record *LHS, Record *RHS, const SearchIndex &Index);
155 const SearchIndex &Index, in searchableFieldType() argument
173 PrintFatalError(Index.Loc, Twine("In table '") + Table.Name + in searchableFieldType()
174 "' lookup method '" + Index.Name + in searchableFieldType()
181 PrintFatalError(Index.Loc, in searchableFieldType()
183 Index.Name + "', key field '" + Field.Name + in searchableFieldType()
190 const SearchIndex &Index, raw_ostream &OS);
191 void emitLookupFunction(const GenericTable &Table, const SearchIndex &Index,
210 static int64_t getNumericKey(const SearchIndex &Index, Record *Rec) { in getNumericKey() argument
211 assert(Index.Fields.size() == 1); in getNumericKey()
213 if (Index.Fields[0].Enum) { in getNumericKey()
214 Record *EnumEntry = Rec->getValueAsDef(Index.Fields[0].Name); in getNumericKey()
215 return Index.Fields[0].Enum->EntryMap[EnumEntry]->second; in getNumericKey()
218 return getInt(Rec, Index.Fields[0].Name); in getNumericKey()
224 const SearchIndex &Index) { in compareBy() argument
225 for (const auto &Field : Index.Fields) { in compareBy()
272 std::string LHSs = primaryRepresentation(Index.Loc, Field, LHSI); in compareBy()
273 std::string RHSs = primaryRepresentation(Index.Loc, Field, RHSI); in compareBy()
309 const SearchIndex &Index, in emitLookupFunction() argument
313 emitLookupDeclaration(Table, Index, OS); in emitLookupFunction()
327 for (const auto &Field : Index.Fields) { in emitLookupFunction()
329 << searchableFieldType(Table, Index, Field, TypeInStaticStruct) << " " in emitLookupFunction()
344 return compareBy(LHS.first, RHS.first, Index); in emitLookupFunction()
353 for (const auto &Field : Index.Fields) { in emitLookupFunction()
355 Index.Loc, Field, Entry.first->getValueInit(Field.Name)); in emitLookupFunction()
372 if (Index.Fields.size() == 1 && in emitLookupFunction()
373 (Index.Fields[0].Enum || isa<BitsRecTy>(Index.Fields[0].RecType))) { in emitLookupFunction()
376 if (getNumericKey(Index, IndexRows[i]) != i) { in emitLookupFunction()
385 OS << " size_t Idx = " << Index.Fields[0].Name << ";\n"; in emitLookupFunction()
396 if (Index.EarlyOut) { in emitLookupFunction()
397 const GenericField &Field = Index.Fields[0]; in emitLookupFunction()
399 Index.Loc, Field, IndexRows[0]->getValueInit(Field.Name)); in emitLookupFunction()
401 Index.Loc, Field, IndexRows.back()->getValueInit(Field.Name)); in emitLookupFunction()
408 for (const auto &Field : Index.Fields) { in emitLookupFunction()
409 OS << " " << searchableFieldType(Table, Index, Field, TypeInTempStruct) in emitLookupFunction()
415 for (const auto &Field : Index.Fields) { in emitLookupFunction()
420 PrintFatalError(Index.Loc, in emitLookupFunction()
433 for (const auto &Field : Index.Fields) { in emitLookupFunction()
461 for (const auto &Field : Index.Fields) in emitLookupFunction()
474 const SearchIndex &Index, in emitLookupDeclaration() argument
476 OS << "const " << Table.CppTypeName << " *" << Index.Name << "("; in emitLookupDeclaration()
479 for (const auto &Field : Index.Fields) in emitLookupDeclaration()
480 OS << LS << searchableFieldType(Table, Index, Field, TypeInArgument) << " " in emitLookupDeclaration()
494 for (const auto &Index : Table.Indices) { in emitGenericTable() local
495 emitLookupDeclaration(Table, *Index, OS); in emitGenericTable()
523 for (const auto &Index : Table.Indices) in emitGenericTable() local
524 emitLookupFunction(Table, *Index, false, OS); in emitGenericTable()
551 auto Index = std::make_unique<SearchIndex>(); in parseSearchIndex() local
552 Index->Name = std::string(Name); in parseSearchIndex()
553 Index->Loc = KeyRecVal->getLoc(); in parseSearchIndex()
554 Index->EarlyOut = EarlyOut; in parseSearchIndex()
565 Index->Fields.push_back(*Field); in parseSearchIndex()
568 if (EarlyOut && isa<StringRecTy>(Index->Fields[0].RecType)) { in parseSearchIndex()
574 return Index; in parseSearchIndex()