Skip to content

Conversation

@augusto2112
Copy link

There are two commits here, one cherry-pick, and one that adapts the swift fork to build with the new upstream changes.

First commit:

[lldb] Refactor LookupInfo object to be per-language (#168797)

Some months ago, the LookupInfo constructor logic was refactored to not
depend on language specific logic, and use languages plugins instead. In
this refactor, when the language type is unknown, a single LookupInfo
object will handle multiple languages. This doesn't work well, as
multiple languages might want to configure the LookupInfo object in
different ways. For example, different languages might want to set the
m_lookup_name differently from each other, but the previous
implementation would pick the first name a language provided, and
effectively ignored every other language. Other fields of the LookupInfo
object are also configured in incompatible ways.

This approach doesn't seem to be a problem upstream, since only the
C++/Objective-C language plugins are available, but it broke downstream
on the Swift fork, as adding Swift to the list of default languages when
the language type is unknown breaks C++ tests.

This patch makes it so instead of building a single LookupInfo object
for multiple languages, one LookupInfo object is built per language
instead.

rdar://159531216
(cherry picked from commit d7fb086668dff682fd2693a3df87a90b2b15a3c6)

Second commit:

[lldb] Adapt swift-form to LookupInfo changes

Since LookupInfo's constructor was made private in d7fb08666, adapt the
downstream code to use the new static function instead. Also, change the
closure passed to Language::ForEach, to return a bool instead of the
newer IterationAction.

Some months ago, the LookupInfo constructor logic was refactored to not
depend on language specific logic, and use languages plugins instead. In
this refactor, when the language type is unknown, a single LookupInfo
object will handle multiple languages. This doesn't work well, as
multiple languages might want to configure the LookupInfo object in
different ways. For example, different languages might want to set the
m_lookup_name differently from each other, but the previous
implementation would pick the first name a language provided, and
effectively ignored every other language. Other fields of the LookupInfo
object are also configured in incompatible ways.

This approach doesn't seem to be a problem upstream, since only the
C++/Objective-C language plugins are available, but it broke downstream
on the Swift fork, as adding Swift to the list of default languages when
the language type is unknown breaks C++ tests.

This patch makes it so instead of building a single LookupInfo object
for multiple languages, one LookupInfo object is built per language
instead.

rdar://159531216
(cherry picked from commit d7fb086)
Since LookupInfo's constructor was made private in d7fb086, adapt the
downstream code to use the new static function instead. Also, change the
closure passed to Language::ForEach, to return a bool instead of the
newer IterationAction.
@augusto2112 augusto2112 requested a review from a team as a code owner December 4, 2025 01:14
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test Windows

@adrian-prantl adrian-prantl merged commit b4fbcc1 into swiftlang:swift/release/6.3 Dec 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants