Commit Graph

111 Commits

Author SHA1 Message Date
Xi Ge
c7b4e36476 [migrator] Handle renaming from explicit argument label to empty argument label at call sites. rdar://32241559 (#9873) 2017-05-23 11:34:05 -07:00
Xi Ge
1019396663 [migrator] Handle getter function to property change in function overrides. (#9844)
We used to only migrate them in call sites, e.g. changing from
``p.getHeight()`` to ``p.Height``. However, with experimenting on more real-world
projects, we realize migrating overrides is equally important.

rdar://32265583
2017-05-22 16:11:53 -07:00
Xi Ge
058d7f62e8 [migrator] Various quality improvement on type-hoist API migrations. rdar://32186526 (#9600) 2017-05-14 19:25:01 -07:00
David Farler
0baa7c6dd8 [Migrator] Migrate Static member abs function calls to Swift.abs
These are deprecated in Swift 3, but are hard obsoleted in Swift 4.

rdar://problem/31070486
2017-05-14 16:55:34 -07:00
Xi Ge
ff2622734e migrator: handle the special migration cases of NSOpenGLSetOption/NSOpenGLGetOption. rdar://32178753 (#9591) 2017-05-14 13:00:03 -07:00
Xi Ge
65b9043eb1 migrator: handle function hoist API changes and several its varieties. rdar://31234806 (#9544) 2017-05-12 21:34:06 -07:00
Xi Ge
fb77682b5a [Migrator] Add a stub for authored API change list to handle API changes that are not detected automatically. (#9477) 2017-05-10 21:51:25 -07:00
swift-ci
c352f98ae9 Merge pull request #9428 from practicalswift/gardening-20170509b 2017-05-09 15:01:08 -07:00
practicalswift
8c40c65c80 [gardening] Fix typos. 2017-05-09 21:50:04 +02:00
Nathan Hawes
0410f17c1b [Migrator] Fix optional types not being updated correctly in some cases
If the replacement type was a function type or protocol-constrained type (e.g.  'Class & Proto) and the existing type had a postfix ? or !, we weren't wrapping the replacement in parens. This would result in an incorrect/ambiguous new type. This patch wraps the replacement in parens if it contains an & or ->, the existing type has a trailing ? or !.

Resolves rdar://problem/32082269.
2017-05-09 12:08:13 -07:00
David Farler
0774db030f [Migrator] Separate AST Pass implementations
The SyntacticMigratorPass is getting Too Big To Fail and covers
multiple migrations. There was already an early exit to not run
the pass if APIDigesterDataStorePath wasn't supplied, so SE-0110
tuple splat fix-its weren't getting run. This manifested in Migrator
tests not printing migrated contents on Linux.

New: ASTMigratorPass
Renamed: SyntacticMigratorPass -> APIDiffMigratorPass
New: TupleSplatMigratorPass

These implementations are entirely hidden and can only be invoked
by a swift::migrator function.

rdar://problem/32025974
2017-05-05 23:35:13 -07:00