Commits

Doug Gregor committed 55a3f5398cc
[Clang importer] Import Swift 2 "stubs" to improve errors in "Swift 2" code. When attempting to compile Swift 2 code (or any Swift code using the Swift 2 names) in Swift 3, the compiler diagnostics are often entirely useless because the names have changed radically enough that one generally gets "no member named 'foo'" errors rather than a helpful "'foo' was renamed to 'bar'" error. This makes for a very poor user experience when (e.g.) trying to move Swift 2 code forward to Swift 3. To improve the experience, when the Swift 2 and Swift 3 names of an API differ, the Clang importer will produce a "stub" declaration that matches the Swift 2 API. That stub will be marked with a synthesized attribute @available(unavailable, renamed: "the-swift-3-name") that enables better diagnostics (e.g., "'foo' is unavailable: renamed to 'bar') along with Fix-Its (courtesy of @jrose-apple's recent work) that fix the Swift 2 code to compile in Swift 3. This change addresses much of rdar://problem/25309323 (concerning QoI of Swift 2 code compiled with a Swift 3 compiler), but some cleanup remains.