mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 02:30:29 +00:00
`LookupCppImpl` is used to find associated functions for a witness. As some witnesses contain multiple associated functions, we need robust mechanims for looking up C++ components. The logic in `LookupCppImpl` is primarily concerned with finding exactly one C++ declaration at a time. In order to handle witnesses with more than one associated function, we move the bulk of `LookupCppImpl` to a new function called `FindCppAssociatedFunction`. This frees up `CppLookupImpl` to delegate to `FindCppAssociatedFunction` when a witness has only one associated function, and to functions that are able to compose multiple associated functions. --------- Co-authored-by: Geoff Romer <gromer@google.com>