Commit Graph

66 Commits

Author SHA1 Message Date
swift-ci
6465a90a2b Merge remote-tracking branch 'origin/master' into master-next 2017-04-28 19:48:32 -07:00
Nate Cook
e2328885c1 [stdlib] Dictionary/Set enhancements
A variety of enhancements from SE-154 and SE-165:

- Custom Keys and Values collections for Dictionary
- Two sequence-based Dictionary initializers
- Merging methods for Dictionary
- Capacity checking and reserving for Dictionary and Set
- Type-specific filter(_:) methods for Dictionary and Set
- A mapValues(_:) method for Dictionary
- A grouping Dictionary initializer
2017-04-26 11:21:16 -05:00
swift-ci
5c54b21b06 Merge remote-tracking branch 'origin/master' into master-next 2017-04-21 15:28:32 -07:00
Xi Ge
72e7f9a7d7 [test] Add some tests for swift-api-digester's data generation for complex type changes. (#8917) 2017-04-21 15:15:45 -07:00
swift-ci
019d53d07a Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 18:48:30 -07:00
Xi Ge
a644ab33a0 swift-api-digester: fix recently found false positives. (#8899)
* swift-api-digester: ensure constructors are detected as removed if not moved. rdar://31694119

* swift-api-digester: types with the same printed name are considered behavior-preserving. rdar://31694085

* [test] Using tmp directory from build.
2017-04-20 18:34:52 -07:00
swift-ci
34f3319946 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 12:48:38 -07:00
Xi Ge
b089bab40e swift-api-digester: avoid reporting moved constructors. rdar://31694119 (#8885)
They don't make more sense than renamed decls.
2017-04-20 12:48:17 -07:00
swift-ci
b733669ef5 Merge remote-tracking branch 'origin/master' into master-next 2017-04-20 01:08:30 -07:00
Doug Gregor
29a15ce402 [Stdlib] Apply SE-0142 to fix ABI FIXME #92, part of ABI FIXME #99. 2017-04-19 23:15:33 -07:00
swift-ci
b56ee3d799 Merge remote-tracking branch 'origin/master' into master-next 2017-04-17 16:48:32 -07:00
Max Moiseev
8ca814cc8c Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-04-17 14:40:20 -07:00
swift-ci
2c5c7d573e Merge remote-tracking branch 'origin/master' into master-next 2017-04-17 13:08:41 -07:00
Xi Ge
ba33fd6236 swift-api-digester: Add a data structure APIDiffItemStore. (#8794)
This structure serves multiple purposes:
	a. Allow migrator to speak in the same language with swift-api-digester in terms of API changes.
	b. Serialize/Deserialize detected API change items in JSON format.
	c. Manage memory after deserializing API change items.
	d. Facilitate look up by USRs of APIs under migration.
The structure is tested by round-trip serialization and deserialization.
2017-04-17 13:04:02 -07:00
Max Moiseev
9b53efd72c Merge branch 'master' into new-integer-protocols 2017-04-17 09:53:44 -07:00
swift-ci
8be8d2cd8d Merge remote-tracking branch 'origin/master' into master-next 2017-04-16 09:48:32 -07:00
Maxim Moiseev
dd2ad785cd Removing the tmp folder even when api-stability test fails (#8785) 2017-04-16 09:40:25 -07:00
Max Moiseev
40184728e5 Listing expected source stability exceptions 2017-04-14 17:40:14 -07:00
swift-ci
a12feb83ac Merge remote-tracking branch 'origin/master' into master-next 2017-04-13 15:08:45 -07:00
Xi Ge
8b26dd000f swift-api-digester: Various improvements for migrator script generation. (#8745)
* swift-api-digester: Add a test for generating migrator script.

* swift-api-digester: Add #ifndef guard before each macro category.

* swift-api-digester: Avoid printing macro categories with empty content.

* swift-api-digester: Add test for multiple type changes in a single decl.

* swift-api-digester: simplify some code. NFC
2017-04-13 15:02:04 -07:00
swift-ci
d484795ba3 Merge remote-tracking branch 'origin/master' into master-next 2017-04-11 18:08:30 -07:00
Dave Abrahams
1f7ec57b04 Merge pull request #1527 from codestergit/master
[Stdlib] Improves Collection.sort  to accept throwing closure
2017-04-11 18:03:17 -07:00
swift-ci
80a6ad1920 Merge remote-tracking branch 'origin/master' into master-next 2017-04-10 14:08:30 -07:00
Xi Ge
7ccef06aa8 Swift-api-digester: check self-parameter explicitly instead of using its context. NFC (#8660) 2017-04-10 13:53:48 -07:00
Bob Wilson
7b75291625 Fix Swift lit tests after LLVM r299775
LLVM's lit implementation switched to use process pools in r299775.
This exposed some pickling problems in Swift's lit files. For a function
or class to be pickle-able, it has to be in the top-level of a real
Python module.

* The SwiftTest lit format class was embedded in the lit.cfg file, so
I moved it out to a separate Python file.

* The inferSwiftBinary function was being stashed in the
config.inferSwiftBinary field and later used to find tools for SourceKit
testing. I moved the config settings for those tools into the top-level
lit.cfg file. I expect this will cause warnings about them not existing
in some cases, but that should be fairly harmless. Maybe someone can
come up with a better solution later.

* The config.substitutions for SourceKit's lit.local.cfg was storing a
reference to an embedded sed_clean function, which just returned a
constant string. I changed the function to be a string, using Python's
raw string feature to avoid the problems that likely led to it being a
function in the first place. (Just guessing.)
2017-04-10 11:07:42 -07:00
codestergit
aa9e9edc8a [Stdlib] Improves sort and sorted to accept throwing clousre
This commit resolves https://bugs.swift.org/browse/SR-715
2017-04-03 16:59:02 +05:30
Roman Levenstein
2c811b82a1 Adjust some tests to pass in non-resilient and resilient modes. 2017-03-16 19:46:11 -07:00
Xi Ge
f4e478e93f swift-api-digester: use 0-based parameter index. rdar://30763215 2017-03-02 16:48:19 -08:00
Erik Eckstein
7995d3d35a SourceKit: Use new mangling for USR generation. 2017-02-23 12:47:10 -08:00
Slava Pestov
66bcf5b756 stdlib: Address a couple of ABI FIXMEs by deleting code
We have an implicit conversion to AnyHashable, so there's no
need to have the special subscript on Dictionary at all.
2017-02-21 20:28:49 -08:00
Doug Gregor
fbb7dcf971 Replace concrete init(stringInterpolationSegment:)'s with generic ones
Remove 16 concrete init(stringInterpolationSegment:) overloads and
replace them with 3 generic overloads, significantly reducing the
exponential blow-up from larger string interpolations.

Fixes rdar://problem/29389887.
2017-02-08 21:01:09 -08:00
Doug Gregor
e387361194 Revert "Replace concrete init(stringInterpolationSegment:)'s with generic ones"
This reverts commit f6cac54606.
2017-02-08 13:38:11 -08:00
Doug Gregor
f6cac54606 Replace concrete init(stringInterpolationSegment:)'s with generic ones
Remove 16 concrete init(stringInterpolationSegment:) overloads and
replace them with 3 generic overloads, significantly reducing the
exponential blow-up from larger string interpolations.

Fixes rdar://problem/29389887.
2017-01-27 21:54:59 -08:00
Slava Pestov
6c75bf8dc5 Update source-stability test
It looks like we print generic parameters differently from
typealiases created to point to them.
2017-01-08 21:41:37 -08:00
Ben Cohen
8ade724c24 Tweak expected source stability results to handle specified rather than inferred iterator types 2017-01-05 11:59:49 -08:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
Slava Pestov
a598ed68e6 Sema: Fixes for generic typealiases and nested type lookup
This patch contains several intertwined changes:

- Remove some unnecessary complexity and duplication.

- Adds a new TypeChecker::lookupUnqualifiedType() which bypasses most of
  the logic in TypeChecker::lookupUnqualified(), such as the
  LookupResultBuilder. Use this when resolving unqualified references
  to types.

- Fixes for generic typealiases to better preserve the type parameters of
  the parent type, and clean up the logic for applying the inner generic
  arguments. Some uses of generic typealiases that used to crash now work,
  and those tests have been uncommented.

- Avoid an unnecessary desugaring of TypeAliasDecls which map directly
  to GenericTypeParamTypes. Once again this perturbs the source-stability
  test.

- When looking up a nested type of a base class with a derived class base,
  always use the base class as the parent of the nested type. This fixes
  a recent regression where in some cases we were using the wrong parent.

Fixes <rdar://problem/29782186>.
2017-01-03 16:57:42 -08:00
Slava Pestov
2c6b9f71b6 AST: Change TypeAliasDecls to store an interface type as their underlying type
- TypeAliasDecl::getAliasType() is gone. Now, getDeclaredInterfaceType()
  always returns the NameAliasType.

- NameAliasTypes now always desugar to the underlying type as an
  interface type.

- The NameAliasType of a generic type alias no longer desugars to an
  UnboundGenericType; call TypeAliasDecl::getUnboundGenericType() if you
  want that.

- The "lazy mapTypeOutOfContext()" hack for deserialized TypeAliasDecls
  is gone.

- The process of constructing a synthesized TypeAliasDecl is much simpler
  now; instead of calling computeType(), setInterfaceType() and then
  setting the recursive properties in the right order, just call
  setUnderlyingType(), passing it either an interface type or a
  contextual type.

  In particular, many places weren't setting the recursive properties,
  such as the ClangImporter and deserialization. This meant that queries
  such as hasArchetype() or hasTypeParameter() would return incorrect
  results on NameAliasTypes, which caused various subtle problems.

- Finally, add some more tests for generic typealiases, most of which
  fail because they're still pretty broken.
2016-12-15 22:46:15 -08:00
Xi Ge
583da52348 swift-api-digester: re-enable swift-api-digester tests after fixing a release-only failure. rdar://29591753 (#6276) 2016-12-14 17:00:24 -08:00
Xi Ge
d3b5dfa8d9 Revert "swift-api-digester: initialize vector with a reasonable capacity." (#6184)
This did not resolve the test failure.
2016-12-09 18:39:29 -08:00
Xi Ge
e6dcd443eb swift-api-digester: initialize vector with a reasonable capacity.
In Jenkins bot, we've seen "exception std::length_error: vector" for
api-digester tests. Tentatively, this patch initializes a major vector with a
reasonably large size, which may avoid its wild capacity growth.
2016-12-09 16:45:18 -08:00
Xi Ge
73bd3526ca [test] Disable failing api-digester test while investigating. (#6166) 2016-12-09 11:15:56 -08:00
Slava Pestov
1a991da16d AST: Assign interface types to ParamDecls
First, ensure all ParamDecls that are synthesized from scratch are given
both a contextual type and an interface type.

For ParamDecls written in source, add a new recordParamType() method to
GenericTypeResolver. This calls setType() or setInterfaceType() as
appropriate.

Interestingly enough a handful of diagnostics in the test suite have
improved. I'm not sure why, but I'll take it.

The ParamDecl::createUnboundSelf() method is now only used in the parser,
and no longer sets the type of the self parameter to the unbound generic
type. This was wrong anyway, since the type was always being overwritten.
This allows us to remove DeclContext::getSelfTypeOfContext().

Also, ensure that FuncDecl::getBodyResultTypeLoc() always has an interface
type for synthesized declarations, eliminating a mapTypeOutOfContext()
call when computing the function interface type in configureInterfaceType().

Finally, clean up the logic for resolving the DynamicSelfType. We now
get the interface or contextual type of 'Self' via the resolver, instead
of always getting the contextual type and patching it up inside
configureInterfaceType().
2016-12-04 00:02:21 -08:00
Slava Pestov
f6e692198c AST: Remove FuncDecl::getResultType() 2016-11-29 03:05:23 -07:00
Graydon Hoare
7c1dc18b64 Revert "Give all declarations an explicit interface type" 2016-11-24 09:55:27 -08:00
Slava Pestov
5b8524a9d1 AST: Remove FuncDecl::getResultType() 2016-11-24 02:35:35 -05:00
Slava Pestov
7ba5617a9d Update api-digester/source-stability.swift test
The swift-api-digester doesn't know about generic typealiases (yet?).
So it picks up some changes that are not actually source-breaking from
the previous patch.
2016-11-18 00:39:16 -08:00
Xi Ge
2db243723a swift-api-digester: fix a crash when an SDKNode matches a null node. rdar://29312301 2016-11-17 11:28:19 -08:00
Maxim Moiseev
32feae52b6 Marking .abs() method for floating point types as obsolete in Swift 4 (#5810)
* Marking .abs() method for floating point types as obsolete in Swift 4

...and deprecated in Swift 3.1
2016-11-16 14:00:10 -08:00
Xi Ge
adf0408cad swift-api-digester: perform deep comparison to ensure type alias are considered equivalent. rdar://29182045 2016-11-10 12:22:06 -08:00