Skip to content

[cxx-interop][SwiftCompilerSources] Use swift::SourceLoc instead of BridgedSourceLoc #58699

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
merged 2 commits into from
Jun 22, 2022

Conversation

egorzhdan
Copy link
Contributor

C++ interop is now enabled in SwiftCompilerSources, so we can remove some of the C bridging layer and use C++ classes directly from Swift.

rdar://83361087

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label May 5, 2022
@egorzhdan egorzhdan requested review from rintaro and eeckstein May 5, 2022 22:15
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm!

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/libswift-sourceloc branch from 6ce6537 to af51419 Compare May 16, 2022 22:30
@@ -20,6 +20,8 @@ private extension Target {
"-Xfrontend", "-enable-cxx-interop",
// Bridging modules and headers
"-Xcc", "-I", "-Xcc", "../include",
// LLVM modules and headers
"-Xcc", "-I", "-Xcc", "../../llvm-project/llvm/include",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also added the LLVM include paths to the SwiftPM manifest.

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

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

Woohoo! This is awesome! 🥳

@egorzhdan egorzhdan force-pushed the egorzhdan/libswift-sourceloc branch from af51419 to 41e6303 Compare June 8, 2022 12:14
@egorzhdan
Copy link
Contributor Author

(just rebased to prepare for landing)

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/libswift-sourceloc branch from 41e6303 to 6aef407 Compare June 8, 2022 12:56
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/libswift-sourceloc branch from 6aef407 to 3ae3cc4 Compare June 8, 2022 16:17
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@xedin
Copy link
Contributor

xedin commented Jun 8, 2022

@egorzhdan This assert you see is an actual issue - name lookup finds __ObjC.(file).llvm.yaml.Hex8.__operatorEqualEqual : (llvm.yaml.Hex8) -> (llvm.yaml.Hex8) -> Bool while looking for == overloads and this overload is not marked to be an operator (the FuncDecl itself that is), so this is either a name lookup or importer problem.

@egorzhdan
Copy link
Contributor Author

@xedin oh this is very interesting, thanks a lot for looking into it!
It seems the actual cause of the assertion is #58910 (cc @Huddie), I'll investigate.

@xedin
Copy link
Contributor

xedin commented Jun 8, 2022

No worries! If you need any help with Sema, let me know!

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

… `BridgedSourceLoc`

C++ interop is now enabled in SwiftCompilerSources, so we can remove some of the C bridging layer and use C++ classes directly from Swift.

rdar://83361087
…aths

This allows the Swift compiler to find headers like `llvm/Support/Compiler.h` that are used by Swift headers.
@egorzhdan egorzhdan force-pushed the egorzhdan/libswift-sourceloc branch from 18b8db4 to 5768aeb Compare June 10, 2022 23:13
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants