bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) const { for (const Module *M = this; M; M = M->Parent) { if (nameParts.empty() || M->Name != nameParts.back()) return false; nameParts = nameParts.drop_back(); } return nameParts.empty(); }
static void reportModuleReferences(const Module *Mod, ArrayRef<SourceLocation> IdLocs, const ImportDecl *ImportD, IndexDataConsumer &DataConsumer) { if (!Mod) return; reportModuleReferences(Mod->Parent, IdLocs.drop_back(), ImportD, DataConsumer); DataConsumer.handleModuleOccurence(ImportD, Mod, (SymbolRoleSet)SymbolRole::Reference, IdLocs.back()); }
bool SemaAnnotator::passModulePathElements( ArrayRef<ImportDecl::AccessPathElement> Path, const clang::Module *ClangMod) { if (Path.empty() || !ClangMod) return true; if (!passModulePathElements(Path.drop_back(1), ClangMod->Parent)) return false; return passReference(ClangMod, Path.back()); }