Skip to content
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

Change objcImpl syntax to @objc @implementation #73309

Merged
merged 9 commits into from
May 21, 2024

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    c3225b0 View commit details
    Browse the repository at this point in the history
  2. [NFC] Add @objc to imported ObjC categories

    This contains the category name, if there is one.
    beccadax committed May 1, 2024
    Configuration menu
    Copy the full SHA
    07b2b9a View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. [NFC] Fix objcImpl request cache

    Several offsetting bugs both broke the caching of `ObjCInterfaceAndImplementationRequest` and caused it to usually miss. Fix this whole painful mess. Also has collateral improvements to simple_display().
    beccadax committed May 16, 2024
    Configuration menu
    Copy the full SHA
    4ba2f6e View commit details
    Browse the repository at this point in the history
  2. Support @objc(CustomName) on extensions

    This now specifies a category name that’s used in TBDGen, IRGen, and PrintAsClang. There are also now category name conflict diagnostics; these subsume some @implementation diagnostics.
    
    (It turns out there was already a check for @objc(CustomName) to make sure it wasn’t a selector!)
    beccadax committed May 16, 2024
    Configuration menu
    Copy the full SHA
    07b9fe9 View commit details
    Browse the repository at this point in the history
  3. Test stable and unstable objcImpl separately

    Their syntaxes are about to diverge, so let’s make sure that we maintain source compatibility for @_objcImplementation.
    beccadax committed May 16, 2024
    Configuration menu
    Copy the full SHA
    0fbea28 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. [NFC] Hoist getAttributeInsertionLoc() up to Decl

    This functionality was previously reserved for ValueDecls. Move it all the way up to Decl; in the process, make it correctly handle EnumElementDecls and EnumCaseDecls.
    
    This change also allows us to generalize `swift::fixDeclarationObjCName()` to work on extensions, though we do not use that capability in this commit.
    beccadax committed May 17, 2024
    Configuration menu
    Copy the full SHA
    cf541c1 View commit details
    Browse the repository at this point in the history
  2. Require @objc to be used with @implementation

    …for extensions. This change also removes @implementation(CategoryName); you should attach the category name to the @objc attribute instead. And there are small changes to how much checking the compiler will do on an @objc @implementation after the decl checker has discovered a problem with it.
    beccadax committed May 17, 2024
    Configuration menu
    Copy the full SHA
    9db14c3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    10ae9db View commit details
    Browse the repository at this point in the history
  4. Change expected objcImpl private let optimization

    Previous changes have made it so that `private let`s in an objcImpl extension are implicitly `@objc`, which changed downstream behavior in a SILOptimizer test. The new behavior is actually more correct, so codify this behavior change by modifying the test.
    beccadax committed May 17, 2024
    Configuration menu
    Copy the full SHA
    0d6b808 View commit details
    Browse the repository at this point in the history