Skip to content

[lldb] Enable auto-detection of Swift/C++ interop #6509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

augusto2112
Copy link

rdar://97610458

@augusto2112
Copy link
Author

@swift-ci test

@@ -170,6 +170,14 @@ typedef enum SwiftModuleLoadingMode {
eSwiftModuleLoadingModeOnlyInterface, // Load via .swiftinterface only
} SwiftModuleLoadingMode;

// BEGIN SWIFT
enum EnableCxxInteropOpts {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call this EnableSwiftCxx?

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from 059e078 to 45ae370 Compare March 31, 2023 22:22
// libraries shipped with Swift are written in C++.
auto name = GetFileSpec().GetFileNameStrippingExtension().GetStringRef();
if (name.startswith("libswift"))
return false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a per-module function, so this would misfire for libSwiftCore.dSYM, which generally only people manually building their own Swift compiler would even have. Since developers might legitimately name libraries libswift* maybe it's better to accept a false positive inside the standard library for those few people that have debug info for it?

for (size_t mi = 0; mi != num_images; ++mi) {
ModuleSP module_sp = GetImages().GetModuleAtIndex(mi);
if (module_sp->IsSwiftCxxInteropEnabled()) {
m_is_swift_cxx_interop_enabled = eLazyBoolYes;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. The problem is that we merge the info from all modules.

Copy link

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure this is printed in SwiftASTContext::LogConfiguration?

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from 45ae370 to d0f92f7 Compare March 31, 2023 22:39
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test macOS

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from d0f92f7 to 0c209bc Compare April 1, 2023 00:41
@augusto2112
Copy link
Author

@swift-ci test

1 similar comment
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from 0c209bc to 9eb5615 Compare April 1, 2023 16:05
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from 9eb5615 to da00776 Compare April 3, 2023 23:17
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from da00776 to dba0067 Compare April 5, 2023 22:57
@augusto2112
Copy link
Author

swiftlang/swift#64958

@swift-ci test

@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from dba0067 to 716b87c Compare April 7, 2023 00:17
@augusto2112 augusto2112 changed the base branch from stable/20221013 to swift/release/5.9 April 7, 2023 00:18
Implement SymbolFile::GetCompileOptions, which returns a map from
compilation units to compilation arguments associated with that unit.

Differential Revision: https://reviews.llvm.org/D147748

(cherry picked from commit 19d969e)
@augusto2112 augusto2112 force-pushed the autodetect-cxx-interop branch from 716b87c to c113ef8 Compare April 10, 2023 17:44
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

swiftlang/swift#64958

@swift-ci test

@augusto2112 augusto2112 merged commit f296aff into swiftlang:swift/release/5.9 Apr 11, 2023
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