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

Fixes for assorted SILGen bugs #6543

Merged
merged 8 commits into from Jan 4, 2017

Commits on Jan 4, 2017

  1. Copy the full SHA
    ad01c1e View commit details
    Browse the repository at this point in the history
  2. SILGen: Emit local types with a separate pass instead of while walkin…

    …g statements
    
    Otherwise we might miss emitting a local type that's inside
    unreachable code. Normally such a type cannot be found via
    name lookup either, but IRGen will walk the list of local types
    and try to emit a class with no SIL vtable, which will crash.
    
    Fixes <https://bugs.swift.org/browse/SR-1924>.
    slavapestov committed Jan 4, 2017
    Copy the full SHA
    2517701 View commit details
    Browse the repository at this point in the history
  3. SILGen: Fix for tuple conversions in function argument position

    Swift admits implicit conversions between tuple types to
    introduce and eliminate argument labels, and re-order
    argument labels. These are expressed as TupleShuffleExpr
    in the AST.
    
    SILGen has two different code paths for lowering TupleShuffleExpr,
    which is also used for varargs and default arguments in call
    argument emission.
    
    These two code paths support different subsets of TupleShuffleExpr;
    neither one supports the full generality of the other, but there
    is some overlap.
    
    Work around the damage by routing the two different "kinds" of
    TupleShuffleExprs to the correct place in argument emission.
    
    The next incremental step here would be to refactor ArgEmitter to
    make it usable when lowering SubscriptExpr; then the RValueEmitter's
    support for varargs in TupleShuffleExpr can go away. Once that's
    done we can split off an ArgumentExpr from TupleShuffleExpr, and
    in the fullness of time, fold ArgumentExpr into ApplyExpr.
    
    At that point this dark corner of the AST will start to be sane...
    
    Fixes <https://bugs.swift.org/browse/SR-2887>.
    slavapestov committed Jan 4, 2017
    Copy the full SHA
    9f8ccd4 View commit details
    Browse the repository at this point in the history
  4. SIL: Fix SILType substitution bug with DynamicSelfType vs MetatypeType

    Previously, SIL type lowering would assume a MetatypeType was
    completely lowered if it had a representation, but this is not
    quite right; after substitution, we can have a MetatypeType
    whose instance type is a DynamicSelfType. Strip these away more
    eagerly, since they show up in SILType::subst(), where we first
    substitute AST-level generic parameters, and then lower the
    result to get the final SIL type.
    
    Fixes <https://bugs.swift.org/browse/SR-2733>.
    slavapestov committed Jan 4, 2017
    Copy the full SHA
    ab81426 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    54754c5 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    4daf56b View commit details
    Browse the repository at this point in the history
  7. SILGen: Fix crash with non-scalar casts requiring re-abstraction

    This might only come up in invalid code, but for example
    casting a function type to String would trigger it.
    slavapestov committed Jan 4, 2017
    Copy the full SHA
    5f9fe6f View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    3b388df View commit details
    Browse the repository at this point in the history