Exemplo n.º 1
0
DeclContextLookupResult MultiplexExternalSemaSource::
FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) {
  StoredDeclsList DeclsFound;
  for(size_t i = 0; i < Sources.size(); ++i) {
    DeclContext::lookup_result R =
      Sources[i]->FindExternalVisibleDeclsByName(DC, Name);
    for (DeclContext::lookup_iterator I = R.begin(), E = R.end(); I != E;
      ++I) {
      if (!DeclsFound.HandleRedeclaration(*I))
        DeclsFound.AddSubsequentDecl(*I);
    }
  }
  return DeclsFound.getLookupResult(); 
}
DeclContextLookupResult MultiplexExternalSemaSource::
FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) {
  StoredDeclsList DeclsFound;
  DeclContextLookupResult lookup;
  for(size_t i = 0; i < Sources.size(); ++i) {
    lookup = Sources[i]->FindExternalVisibleDeclsByName(DC, Name);
    while(lookup.first != lookup.second) {
      if (!DeclsFound.HandleRedeclaration(*lookup.first))
        DeclsFound.AddSubsequentDecl(*lookup.first);
      lookup.first++;
    }
  }
  return DeclsFound.getLookupResult(); 
}