[clang] Reapply "[clang] Fix name lookup for dependent bases" (PR #118003)

Vladislav Belov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 06:14:54 PST 2024


vbe-sc wrote:

@erichkeane, @nikic This is the second version of this patch. I’m not entirely sure if my suggestion regarding the redundant assertion is correct, but I’d like to share some thoughts on the clang build time regression:

According to the actual implementation of `CXXRecordDecl::lookupInBases`: 

```
  // FIXME: This is an O(N^2) algorithm, but DPG doesn't see an easy
  // way to make it any faster.
```

My patch enforces additional lookups through the bases (as required by the C++ standard), so worse performance is expected regardless. It might be possible to limit this algorithm or improve its efficiency, but at the moment, I don’t see a viable way to achieve this.

Do you have any thoughts on the assertion I removed?

Do you have any suggestions or concern? Thanks

https://github.com/llvm/llvm-project/pull/118003


More information about the cfe-commits mailing list