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

[pull] swiftwasm from main #5531

Merged
merged 63 commits into from
Jun 18, 2023
Merged

[pull] swiftwasm from main #5531

merged 63 commits into from
Jun 18, 2023

Commits on May 9, 2023

  1. [cxx-interop] C++ records should have address-only layout when they c…

    …an't be passed in registers
    
    This ensures that a C++ record with only ObjC ARC pointers with trivial other members is passed by value in SIL
    
    Fixes apple#61929
    hyp committed May 9, 2023
    Configuration menu
    Copy the full SHA
    49d7e04 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2c4188b View commit details
    Browse the repository at this point in the history

Commits on May 19, 2023

  1. [ConstraintSytem] NFC: Remove unnecessary checking/counting from `cou…

    …ntDistinctOverloads`
    xedin committed May 19, 2023
    Configuration menu
    Copy the full SHA
    84b212c View commit details
    Browse the repository at this point in the history

Commits on May 20, 2023

  1. [Diagnostics] Skip overloaded locations where all solutions have the …

    …same type
    
    If there are multiple overloads, let's skip locations that produce
    the same type across all of the solutions, such location is most
    likely a consequence of ambiguity and not its source.
    
    Resolves: rdar://109245375
    xedin committed May 20, 2023
    Configuration menu
    Copy the full SHA
    f12e24e View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2023

  1. Configuration menu
    Copy the full SHA
    47a08e3 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2023

  1. [CS] Diagnose UnresolvedPatternExprs as part of constraint solving

    Instead of diagnosing in CSApply, let's create a
    fix and diagnose in the solver instead.
    Additionally, make sure we assign ErrorTypes to
    any VarDecls bound by the invalid pattern, which
    fixes a crash.
    
    rdar://110638279
    hamishknight committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    c6dd3ad View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2023

  1. [Macros] Allow keywords after # in freestanding macro expansions

    Allow keywords after `#` in freestanding macro expansions
    
    There is no reason why we shouldn’t allow keywords here.
    
    I also thought about allowing keywords after `@` but things become tricky here for two reasons:
    - In the parser, we parse a type after the `@`, which could start with a keyword itself (e.g. `any`). If we want to keep the parser logic to parse a type after `@` (which I think we should), then it becomes unclear what `@any T` should parse as.
    - We allow a space between `@` and the type name. This makes it very hard for recovery to tell whether `@ struct` refers to an attribute with name `struct` or if the user forgot to write the attribute name after `@`.
    
    Since almost all keywords are lowercase and attached member macros are usually spelled with an uppercase name, there are a lot fewer chances for clashes here, so I don’t think it’s worth allowing keywords after `@`.
    
    apple#66444
    rdar://110472060
    ahoppen committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    fbbbd0d View commit details
    Browse the repository at this point in the history
  2. [Parse] InitAccessors: Parse initializer exprs associated with comput…

    …ed properties that have `init` accessor
    
    Initialization expressions are not allowed on computed properties
    but if a property has `init` accessor it should be allowed because
    it could be used by a memberwise initializer.
    xedin committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    8b1c9c9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    290970a View commit details
    Browse the repository at this point in the history
  4. [test] fix objcxx-arc-field-in-struct-type-layout-execution.swift tes…

    …t failure on macOS
    hyp committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    988f373 View commit details
    Browse the repository at this point in the history
  5. [CanOSSALifetime] Bail early in lifetime extension

    While collecting originalLiveBlocks, walking backward from consuming
    blocks, if a visited block is already in originalLiveBlocks, don't visit
    its predecessors.
    
    Continuing the backwards walk is wasteful.
    
    rdar://110854874
    nate-chandler committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    57e226d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d1554f2 View commit details
    Browse the repository at this point in the history
  7. [Sema] Formalize a way to check whether storage is initializable

    Previously only stored properties could be initializable but with
    introduction of init accessors computed properties gained an ability
    to specify initialzer expression and participation in memberwise
    initialization for structs.
    xedin committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    fc895b4 View commit details
    Browse the repository at this point in the history
  8. [Sema/SILGen] Consider init exprs associated with init accessor prope…

    …rties for memberwise init
    xedin committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    f58d407 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7abd265 View commit details
    Browse the repository at this point in the history
  10. [SourceKit] Record module loading errors when generating interfaces

    Record up to two errors emitted when we fail to
    load a module for interface generation, and include
    these errors in the message we pass back to the
    editor. This should help us better pin down the
    reason why interface generation failed.
    
    rdar://109511099
    hamishknight committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    a9f9bd1 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2023

  1. [Macros] Update plugin search options serialization

    Previously plugin search options were serialized for each option kind.
    Instead serialize them in the order specified.
    rintaro committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    706985d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fc7ecc8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8e66001 View commit details
    Browse the repository at this point in the history
  4. Merge pull request apple#66643 from ahoppen/ahoppen/keyword-freestand…

    …ing-macro-names
    
    [Macros] Allow keywords after `#` in freestanding macro expansions
    ahoppen committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    e822a6a View commit details
    Browse the repository at this point in the history
  5. Merge pull request apple#66695 from ktoso/wip-distributed-harden-empt…

    …y-impls
    
    [Distributed] Harden typechecker against completely empty DAS types
    ktoso committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    b420190 View commit details
    Browse the repository at this point in the history
  6. Merge pull request apple#66680 from nate-chandler/rdar110854874

    [CanonicalizeOSSALifetime] Bail early in lifetime extension backwards walk.
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    49e9284 View commit details
    Browse the repository at this point in the history
  7. Merge pull request apple#66679 from mikeash/disable-tracing-minimal

    [Build] Set swift-stdlib-tracing=0 for minimal stdlib builds.
    mikeash committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    cdc72fd View commit details
    Browse the repository at this point in the history
  8. Merge pull request apple#65813 from hyp/eng/passInRegs

    [cxx-interop] Itanium ABI C++ records should have address-only layout when they can't be passed in registers
    hyp committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    4590aa1 View commit details
    Browse the repository at this point in the history
  9. SILDebugScopes: Don't ignore ConditionalClauseInitializerScope.

    ConditionalClauseInitializerScope often create redundant scopes, however, they
    are needed to correctly represent the scopes in an expression such as:
    
      if case .something(let foo), let foo = foo.
    
    This patch changes SILGen to lower them 1:1 from ASTScopes.
    
    rdar://110841130
    adrian-prantl committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    874ba08 View commit details
    Browse the repository at this point in the history
  10. [TypeLowering] Move-only types are lexical.

    Vars of such types should be given lexical `alloc_stack`s by
    `AllocBoxToStack` which requires that the `alloc_box` insts formed for
    them have an associated borrow scope which in turn requires that type
    lowering for move only structs and enums have their lexical bits set.
    
    rdar://110901430
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    9b69044 View commit details
    Browse the repository at this point in the history
  11. Fix tests on arm64e

    Fix the failures on the oss-swift_tools-RA_stdlib-DA_test-device-non_executable
    bot.
    aschwaighofer committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    f1a9e8b View commit details
    Browse the repository at this point in the history
  12. [TypeLowering] Move-only types are lexical.

    Vars of such types should be given lexical `alloc_stack`s by
    `AllocBoxToStack` which requires that the `alloc_box` insts formed for
    them have an associated borrow scope which in turn requires that type
    lowering for move only structs and enums have their lexical bits set.
    
    rdar://110901430
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    c340d47 View commit details
    Browse the repository at this point in the history
  13. Optimizer: add an additional DeadObjectElimination at the end of the …

    …pipeline
    
    The last dead-store-elimination pass can expose opportunities for dead object elimination.
    
    rdar://110846405
    eeckstein committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    0bf643d View commit details
    Browse the repository at this point in the history
  14. Merge pull request apple#66035 from xedin/rdar-109245375

    [Diagnostics] Skip overloaded locations where all solutions have the same type
    xedin committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    f8bde21 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f10d0df View commit details
    Browse the repository at this point in the history
  16. Merge pull request apple#66706 from aschwaighofer/fix_arm64e_opaque_p…

    …tr_failures
    
    Fix tests on arm64e
    swift-ci committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    a77cc30 View commit details
    Browse the repository at this point in the history
  17. [TypeResolution] Ban local variable packs (apple#66622)

    * Ban explicit local variable packs
    
    * Ban inferred local variable packs
    simanerush committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    e1d2198 View commit details
    Browse the repository at this point in the history
  18. Merge pull request apple#66681 from xedin/enable-inits-on-props-with-…

    …init-accessors
    
    [Sema/SILGen] InitAccessors: Synthesize default arguments for init accessor properties
    xedin committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    9d342f1 View commit details
    Browse the repository at this point in the history
  19. [Macros] Make 'PluginSearchOption' a external union

    Create a 'Kind' enum so that deserialization can use the kind instead of
    a string option name.
    rintaro committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    6fa0c14 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    1ed9df0 View commit details
    Browse the repository at this point in the history
  21. [SILOpt] Don't opt move-only lifetimes.

    According to language rules, such lifetimes are fixed and the relative
    order of their deinits is guaranteed.
    
    rdar://110913116
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    5d7aa84 View commit details
    Browse the repository at this point in the history
  22. Merge pull request apple#66698 from eeckstein/dead-alloc-in-passpipeline

    Optimizer: add an additional DeadObjectElimination at the end of the pipeline
    eeckstein committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    9d4f4af View commit details
    Browse the repository at this point in the history
  23. Merge pull request apple#66705 from nate-chandler/rdar110901430

    [TypeLowering] Move-only types are lexical.
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    13cdc66 View commit details
    Browse the repository at this point in the history
  24. [SILOpt] Don't opt move-only lifetimes.

    According to language rules, such lifetimes are fixed and the relative
    order of their deinits is guaranteed.
    
    rdar://110913116
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    8db8451 View commit details
    Browse the repository at this point in the history
  25. Compute VarDeclScopeMap up front.

    The previous lazy discovery did not always work because sometimes a debug_value
    is emitted before the first SIL instruction in the variable's scope.
    
    rdar://110841130
    adrian-prantl committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    329e428 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    fef3578 View commit details
    Browse the repository at this point in the history
  27. [FieldSensitivePL] NFC: Implemented print.

    The members were declared but undefined.
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    d067453 View commit details
    Browse the repository at this point in the history
  28. [Basic] Removed spurious req from FrozenMultiMap.

    Its storage vector is intended to be of some type like
    `std::vector<std::pair<Key, Optional<Value>>>`, i.e., some collection of
    pairs whose `second` is an `Optional<Value>`.  So when constructing a
    default instance of that pair, just construct an Optional in the None
    case.
    nate-chandler committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    934ec10 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    f4d8761 View commit details
    Browse the repository at this point in the history
  30. [Macros] Add default plugin paths for Darwin SDKs and platforms.

    Corresponding to apple/swift-driver#1377, this
    adds some default plugin paths for Darwin SDKs and platforms.
    Fixes rdar://110819604.
    DougGregor committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    1ec900e View commit details
    Browse the repository at this point in the history
  31. Merge pull request apple#66711 from DougGregor/old-driver-default-plu…

    …gin-paths
    
    [Macros] Add default plugin paths for Darwin SDKs and platforms.
    DougGregor committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    22348e6 View commit details
    Browse the repository at this point in the history
  32. Merge pull request apple#66689 from rintaro/macros-serialization-plug…

    …inopts
    
    [Macros] Update plugin search options serialization
    rintaro committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    13a29a0 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2023

  1. require consume x for noncopyable pattern bindings since they're co…

    …nsuming
    
    this was staged in as a warning initially but it was intended to be
    an error if it is not written so that we can move to a world where
    these pattern matches are done as a borrowing operation instead.
    
    rdar://110908714
    kavon committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    36451ef View commit details
    Browse the repository at this point in the history
  2. [IRGen] Use EnumImplStrategy to generate getEnumTag function for layo… (

    apple#66707)
    
    * [IRGen] Use EnumImplStrategy to generate getEnumTag function for layout strings
    
    rdar://110794898
    
    The implementation in TypeLayout seems to have a bug causing wrong tags to be returned on 32 bit systems.
    
    * Don't use unsupported types in tests
    drexin committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    874b577 View commit details
    Browse the repository at this point in the history
  3. Merge pull request apple#66495 from karwa/patch-16

    Enable IRGen/protocol_metadata test on Apple Silicon
    rjmccall committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    4e5ff2c View commit details
    Browse the repository at this point in the history
  4. Merge pull request apple#66716 from nate-chandler/rdar110913116

    [SILOptimizer] Don't optimize move-only lifetimes.
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    ca29d53 View commit details
    Browse the repository at this point in the history
  5. Merge pull request apple#66713 from kavon/require-switch-consume

    require `consume x` for noncopyable pattern bindings since they're consuming
    swift-ci committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    6709648 View commit details
    Browse the repository at this point in the history
  6. [FieldSensitivePL] Fix vectorization.

    FieldSensitivePrunedLiveness is used as a vectorization of
    PrunedLiveness.  An instance of FSPL with N elements needs to be able to
    represent the same states as N instances of PL.
    
    Previously, it failed to do that in two significant ways:
    
    (1) It attempted to save space for which elements were live by using
        a range.  This failed to account for instructions which are users of
        non-contiguous fields of an aggregate.
    
        apply(
          @owned (struct_element_addr %s, #S.f1),
          @owned (struct_element_addr %s, #S.f3)
        )
    
    (2) It used a single bit to represent whether the instruction was
        consuming.  This failed to account for instructions which consumed
        some fields and borrowed others.
    
        apply(
          @owned (struct_element_addr %s, #S.f1),
          @guaranteed (struct_element_addr %s, #S.f2)
        )
    
    The fix for (1) is to use a bit vector to represent which elements
    are used by the instruction.  The fix for (2) is to use a second bit
    vector to represent which elements are _consumed_ by the instruction.
    
    Adapted the move-checker to use the new representation.
    
    rdar://110909290
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    f4e3292 View commit details
    Browse the repository at this point in the history
  7. [MoveOnlyAddressChecker] NFC: Promoted assertion.

    Dumped more info and called llvm_unreachable on bad state.
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    b97712c View commit details
    Browse the repository at this point in the history
  8. [MoveOnlyAddressChecker] Maximize lifetimes.

    Previously, the checker inserted destroys after each last use.  Here,
    extend the lifetimes of fields as far as possible within their original
    (unchecked) limits.
    
    rdar://99681073
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    eaf4560 View commit details
    Browse the repository at this point in the history
  9. [move-only] Avoid loc from func decl.

    It's always the first line of the function, so try to do better.
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    11443f2 View commit details
    Browse the repository at this point in the history
  10. [MoveOnlyAddressChecker] Added extension flag.

    Passing
    
    ```
    -Xllvm -move-only-address-checker-disable-lifetime-extension=true
    ```
    
    will skip the maximization of unconsumed field lifetimes.
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    2bfa723 View commit details
    Browse the repository at this point in the history
  11. Merge pull request apple#66712 from felipepiovezan/felipe/update_debu…

    …g_info_opaque_ptrs
    
    [DebugInfo] Update tests to use opaque ptrs
    felipepiovezan committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    cbd0b15 View commit details
    Browse the repository at this point in the history
  12. Merge pull request apple#66692 from adrian-prantl/110841130

    SILDebugScopes: Don't ignore ConditionalClauseInitializerScope.
    adrian-prantl committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    c2f164d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    606eef6 View commit details
    Browse the repository at this point in the history
  14. Merge pull request apple#66690 from nate-chandler/rdar110676577

    [FieldSensitivePL] Fix vectorization.
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    91ee824 View commit details
    Browse the repository at this point in the history
  15. Merge pull request apple#66585 from nate-chandler/rdar99681073

    [MoveOnlyAddressChecker] Maximize lifetimes.
    nate-chandler committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    d312589 View commit details
    Browse the repository at this point in the history