Skip to content

[CxxInterop] Expose C++ static members as Swift static properties #31070

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 1 commit into from
Apr 23, 2020

Conversation

hlopko
Copy link
Contributor

@hlopko hlopko commented Apr 16, 2020

This PR does the following:

  • Removes early exit for static members in ImportDecl.cpp
  • Uses Clang mangler to mangle names of all Clang-backed non-top-level VarDecls in ASTMangler::mangleGlobalVariableFull
  • Uncomments tests in test/Interop/Cxx/class now that static members are supported
  • Adds tests into test/Interop/Cxx/static

Doing some form of mangling (or including the record name in the name in any form) in ASTMangler is AFAIK needed to be able to have multiple static members with the same name. Without the mangling the SILGenGlobalVariable is not created due to this line. Therefore with this PR we'll see Clang mangled names for static members in SIL output.

Progres on SR-12464 and SR-12466.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5c2addc851be71b5795ba263f6e8aa3576d31fa3

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 5c2addc851be71b5795ba263f6e8aa3576d31fa3

@gribozavr
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 5c2addc851be71b5795ba263f6e8aa3576d31fa3

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5c2addc851be71b5795ba263f6e8aa3576d31fa3

@gribozavr
Copy link
Contributor

@swift-ci Please test

1 similar comment
@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@swift-ci Please test Windows

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d8e39595fd57c98b46f85dec050376d9b9f98628

@gribozavr
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d8e39595fd57c98b46f85dec050376d9b9f98628

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d8e39595fd57c98b46f85dec050376d9b9f98628

@gribozavr
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d04e667598d62efb4fea8a30620ef234ad18cd76

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d04e667598d62efb4fea8a30620ef234ad18cd76

@hlopko hlopko force-pushed the statics-tests branch 2 times, most recently from 6774365 to fa7daaa Compare April 23, 2020 09:48
@swiftlang swiftlang deleted a comment from swift-ci Apr 23, 2020
@swiftlang swiftlang deleted a comment from swift-ci Apr 23, 2020
@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@swift-ci Please test Windows

1 similar comment
@gribozavr
Copy link
Contributor

@swift-ci Please test Windows

@gribozavr gribozavr merged commit bc55dba into swiftlang:master Apr 23, 2020
@gribozavr gribozavr added the c++ interop Feature: Interoperability with C++ label Apr 24, 2020
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.

3 participants