hokein created this revision.
hokein added a reviewer: ilya-biryukov.

Repository:
  rC Clang

https://reviews.llvm.org/D42071

Files:
  include/clang/Sema/Lookup.h
  lib/Sema/SemaLookup.cpp


Index: lib/Sema/SemaLookup.cpp
===================================================================
--- lib/Sema/SemaLookup.cpp
+++ lib/Sema/SemaLookup.cpp
@@ -3507,6 +3507,8 @@
   if (Visited.visitedContext(Ctx->getPrimaryContext()))
     return;
 
+  Consumer.BeginVisitContext(Ctx);
+
   // Outside C++, lookup results for the TU live on identifiers.
   if (isa<TranslationUnitDecl>(Ctx) &&
       !Result.getSema().getLangOpts().CPlusPlus) {
Index: include/clang/Sema/Lookup.h
===================================================================
--- include/clang/Sema/Lookup.h
+++ include/clang/Sema/Lookup.h
@@ -784,6 +784,11 @@
   /// class of the context we searched.
   virtual void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx,
                          bool InBaseClass) = 0;
+
+  /// \brief Callback to inform the client that Sema begins to visit a context.
+  //
+  /// \param Ctx the context which Sema begins to visit.
+  virtual void BeginVisitContext(DeclContext *Ctx) {};
 };
 
 /// \brief A class for storing results from argument-dependent lookup.


Index: lib/Sema/SemaLookup.cpp
===================================================================
--- lib/Sema/SemaLookup.cpp
+++ lib/Sema/SemaLookup.cpp
@@ -3507,6 +3507,8 @@
   if (Visited.visitedContext(Ctx->getPrimaryContext()))
     return;
 
+  Consumer.BeginVisitContext(Ctx);
+
   // Outside C++, lookup results for the TU live on identifiers.
   if (isa<TranslationUnitDecl>(Ctx) &&
       !Result.getSema().getLangOpts().CPlusPlus) {
Index: include/clang/Sema/Lookup.h
===================================================================
--- include/clang/Sema/Lookup.h
+++ include/clang/Sema/Lookup.h
@@ -784,6 +784,11 @@
   /// class of the context we searched.
   virtual void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx,
                          bool InBaseClass) = 0;
+
+  /// \brief Callback to inform the client that Sema begins to visit a context.
+  //
+  /// \param Ctx the context which Sema begins to visit.
+  virtual void BeginVisitContext(DeclContext *Ctx) {};
 };
 
 /// \brief A class for storing results from argument-dependent lookup.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to