[Lldb-commits] [PATCH] D15312: Fix scope-based lookup when more than one function is found.

Dawn Perchik via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 9 20:29:41 PST 2015


dawn marked 3 inline comments as done.
dawn added a comment.

> It seems like you combined "find this decl instance within a decl context" with "find a decl by name in the CompilerDeclContext and optionally get the type".


It it exactly "find this decl instance within a decl context".

> I am still unclear as to what the name and type are doing in DeclContextCountDeclLevels. I don't see how we would ever have a decl (in opaque_find_decl_ctx) that isn't unique where the same decl could have different names and different types?


The optional name is required by languages (like C++) to handle using declarations like:

  void poo();
  namespace ns {
      void foo();
      void goo();
  }
  void bar() {
      using ns::foo;
      // Here, 'foo' is needed so that we can match it
      // with the using declaration.
      //
      // We want the API to return 0 for 'foo',
      // -1 for 'goo', and 1 for 'poo'.
  }

The optional type might be required by languages which have a using declaration-like concept where a type can be specified, like:

  void foo(int, int);
  namespace ns {
      void foo();
      void foo(int);
  }
  void bar() {
      using_like ns::foo(int);
      // Here, 'foo' and its type are both needed so that
      // we can match it with the using_like declaration.
      //
      // We want the API to return 0 for { 'foo', 'void(int)' },
      // -1 for { 'foo', 'void()' },
      // and 1 for { 'foo', 'void(int, int)' },
  }

The name and type are optional (default to 0) for languages which don't have these concepts.


Repository:
  rL LLVM

http://reviews.llvm.org/D15312





More information about the lldb-commits mailing list