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

[Swift] Migrate Swift runtime to Swift 5. #2686

Merged
merged 4 commits into from
Dec 9, 2019
Merged

Commits on Nov 18, 2019

  1. [Swift] Migrate Swift runtime to Swift 5.

    This switches from using the deprecated hashValue to hash(into:).
    It also switches from using index to firstIndex (matching the change in
    the standard library).
    
    In the test template, we switch to using String directly instead of
    String.characters.
    
    This also switches all the Travis macOS tests to use the Xcode 10.2 / Mojave
    image and changes the Linux Swift tests to download Swift 5.0.1.
    ewanmellor committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    509eeef View commit details
    Browse the repository at this point in the history
  2. [Swift] Change the generation of the copyFrom method to work around S…

    …R-10260.
    
    This bug in Swift 5's compiler causes a SIL verification error when calling
    super.foo without overriding foo in the subclass.  In our case, we are
    generating a copyFrom implementation in the subclass, and calling
    super.copyFrom.  Crucially, the subclass implementation uses the context
    subtype for the argument, which means that it doesn't actually override the
    superclass's implementation.  This then tickles the SIL verification bug.
    
    Work around this by changing our autogenerated copyFrom definition to use
    ParserRuleContext as the argument type.  This means that it actually
    overrides the implementation in ParserRuleContext, and so the super.copyFrom
    call is generated correctly.
    ewanmellor committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    10d182c View commit details
    Browse the repository at this point in the history
  3. [Swift] Replace all uses of NSStringFromClass.

    Bridging from NSString to String in Swift 5 is a transcoding operation, so
    it is expensive.  Use String(describing:) instead of NSStringFromClass
    to avoid this cost.
    ewanmellor committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    a701f2b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3bd5465 View commit details
    Browse the repository at this point in the history