[all-commits] [llvm/llvm-project] 1f40d6: Remove CXXBasePaths::found_decls and simplify and ...

Richard Smith via All-commits all-commits at lists.llvm.org
Tue Dec 1 16:42:50 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f40d60a3b7f310ff3f77bb8643a27d979a703cb
      https://github.com/llvm/llvm-project/commit/1f40d60a3b7f310ff3f77bb8643a27d979a703cb
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-12-01 (Tue, 01 Dec 2020)

  Changed paths:
    M clang/include/clang/AST/CXXInheritance.h
    M clang/lib/AST/CXXInheritance.cpp
    M clang/lib/Sema/SemaDecl.cpp

  Log Message:
  -----------
  Remove CXXBasePaths::found_decls and simplify and modernize its only
caller.

This function did not satisfy its documented contract: it only
considered the first lookup result on each base path, not all lookup
results. It also performed unnecessary memory allocations.

This change results in a minor change to our representation: we now
include overridden methods that are found by any derived-to-base path
(not involving another override) in the list of overridden methods for a
function, rather than filtering out functions from bases that are both
direct virtual bases and indirect virtual bases for which the indirect
virtual base path contains another override for the function. (That
filtering rule is part of the class-scope name lookup rules, and doesn't
really have much to do with enumerating overridden methods.) The users
of the list of overridden methods do not appear to rely on this
filtering having happened, and it's simpler to not do it.




More information about the All-commits mailing list