Commit Graph

35 Commits

Author SHA1 Message Date
Max Moiseev
885b564bf5 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-09 17:16:37 -08:00
Xi Ge
d81edcb6b6 ModulePrinting: Properly substitute via metatype to simplify complex bound generic types appearing in synthesized extensions. rdar://25063840 2016-03-09 17:09:34 -08:00
Max Moiseev
02006f20bc Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-09 16:05:03 -08:00
Argyrios Kyrtzidis
c939234d1f [test] Modify the test so that it can pass on linux as well. 2016-03-08 23:59:13 -08:00
Argyrios Kyrtzidis
345d05e2e9 Introduce an internal attribute '@_show_in_interface' to be used in stdlib for underscored protocols that
should be shown in the interface.

Also switch the option and hide all underscored protocols by default, unless they are marked with the new attribute.
2016-03-08 23:30:58 -08:00
Xi Ge
fbd74a317d [Test] Add a test to make sure every group has decls to print. 2016-02-29 12:03:50 -08:00
Xi Ge
5270e62bb4 [test] swift-ide-test: Add a test to ensure that future stdlib public source files are properly grouped. 2016-02-24 16:21:26 -08:00
Argyrios Kyrtzidis
04e3949985 [ASTPrint] Introduce a printing option to hide underscored protocols in the stdlib. 2015-12-02 22:38:34 -08:00
Argyrios Kyrtzidis
5ac9e39d61 [ASTPrint] Make sure we hide the new literals (color, image, etc.) from the stdlib interface.
rdar://22632345

Swift SVN r31846
2015-09-10 02:03:13 +00:00
Xi Ge
efb19787a1 [InterfaceGen] Not printing '@rethrows' since we print 'rethrows'. rdar://22449614
Swift SVN r31538
2015-08-27 18:47:41 +00:00
Dave Abrahams
ad43a596bd [stdlib] Retire the old lazy subsystem...
...replacing it with the new, after passing API review!

* The lazy free function has become a property.

* Before we could extend protocols, we lacked a means for value types to
  share implementations, and each new lazy algorithm had to be added to
  each of up to four types: LazySequence, LazyForwardCollection,
  LazyBidirectionalCollection, and LazyRandomAccessCollection. These
  generic adapters hid the usual algorithms by defining their own
  versions that returned new lazy generic adapters. Now users can extend
  just one of two protocols to do the same thing: LazySequenceType or
  LazyCollectionType.

* To avoid making the code duplication worse than it already was, the
  generic adapters mentioned above were used to add the lazy generic
  algorithms around simpler adapters such as MapSequence that just
  provided the basic requirements of SequenceType by applying a
  transformation to some base sequence, resulting in deeply nested
  generic types as shown here. Now, MapSequence is an instance of
  LazySequenceType (and is renamed LazyMapSequence), and thus transmits
  laziness to its algorithms automatically.

* Documentation comments have been rewritten.

* The .array property was retired

* various renamings

* A bunch of Gyb files were retired.

Swift SVN r30902
2015-08-01 03:52:13 +00:00
Dave Abrahams
88aaed0a0c [stdlib] Move most of the lazy prototype into the stdlib
Swift SVN r30144
2015-07-13 15:36:17 +00:00
Dave Abrahams
03c44ad654 [stdlib] Fix one more test
Being conscientious about underscore prefixing can be costly.

Swift SVN r29691
2015-06-25 21:59:37 +00:00
Argyrios Kyrtzidis
212989e3cd [stdlib] Underscore a parameter name to hide its initializer from the interface.
Verified by Dmitri.

Swift SVN r29196
2015-06-01 00:26:47 +00:00
Argyrios Kyrtzidis
658d852f68 [IDE] When printing stdlib interface, hide underscored members of protocols, and subscript
decls that have underscored parameters.

Dmitri verified that the removals after this change are ok.

Swift SVN r29177
2015-05-31 00:41:09 +00:00
John McCall
6287d913c3 By default, hide the actual implementing accessors of properties
and subscripts when printing them; just print them as get/set.

The important thing here is that we don't want to show the
names of addressors and mutable addressors when pretty-printing
the stdlib, but hiding observers is also general goodness.

Swift SVN r24875
2015-01-31 05:03:51 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Maxwell Swadling
963619cdc1 [stdlib] C_ARG{c,v} renamed to argc/unsafeArgv
Fixes rdar://problem/17229052
Make it clear C_ARGV var is unsafe.
Made it impossible to set the argc/unsafeArgv outside of the stdlib.
Refactored tests to not use C_ARG{C,V}.
Made C_ARG{C,V} unavailable.

Swift SVN r23249
2014-11-11 22:34:49 +00:00
Dmitri Hrybenko
1335a05e15 stdlib: remove FIXMEs from stdlib doc comments and add a test to catch these in
future

rdar://17906333


Swift SVN r21037
2014-08-05 09:31:10 +00:00
Jordan Rose
a2af37a19b Split PrintOptions::printEverything into printEverything and printVerbose.
The former is for debugging, the latter is for detailed presentation to users.
swift -print-ast will continue using printEverything, as will swift-ide-test,
but all other features should use printVerbose.

Swift SVN r20432
2014-07-23 22:28:55 +00:00
Dmitri Hrybenko
36d41e04c4 stdlib printing test: only print public declarations
Swift SVN r20407
2014-07-23 16:15:11 +00:00
Argyrios Kyrtzidis
6ad0245591 [modules] Serialize 'mutating' attribute so we can print it in the interface.
rdar://17585197

Swift SVN r20214
2014-07-20 01:15:36 +00:00
Dmitri Hrybenko
527fbf5893 Module interface printing: change the implementation of the underscore rule so
that important protocols are not hidden

The rule essentially remains the same -- underscored symbols are stdlib
implementation details and users should not be relying on them.  (Even
protocols like _Collection, are conceptually implementation details -- they are
not a part of the original design and we would like to remove them as soon as
the bugs are fixed.)

But since protocols define requirements for user types, we need to display even
underscored protocols, except for _Builtin* protocols, which can never be
satisfied by a user type.

rdar://16986307


Swift SVN r20083
2014-07-17 13:38:31 +00:00
Ben Langmuir
bfef826414 Combine CHECK-NOTs in print_stdlib test
Swift SVN r20068
2014-07-17 03:26:34 +00:00
Ben Langmuir
09f465ee64 Don't print sugar or generic parameters in extensions
Before:
extension [T] : P { }
extension Foo<T> : P { }

After:
extension Array : P { }
extension Foo : P { }

<rdar://problem/16613904>

Swift SVN r20057
2014-07-16 22:55:48 +00:00
Doug Gregor
2f3f6acf21 Make "true" and "false" Boolean literal constants for the BooleanLiteralConvertible protocol.
Introduce the new BooleanLiteralConvertible protocol for Boolean
literals. Take "true" and "false" as real keywords (which is most of the
reason for the testsuite churn). Make Bool BooleanLiteralConvertible
and the default Boolean literal type, and ObjCBool
BooleanLiteralConvertible. Fixes <rdar://problem/17405310> and the
recent regression that made ObjCBool not work with true/false.


Swift SVN r19728
2014-07-09 16:57:35 +00:00
Chris Lattner
60fc0e6cd2 Implement <rdar://problem/16951729> nil should be a literal type
This is all goodness, and eliminates a major source of implicit conversions.
One thing this regresses on though, is that we now reject "x == nil" where
x is an option type and the element of the optional is not Equtatable.  If
this is important, there are ways to enable this, but directly testing it as
a logic value is more straight-forward.

This does not include support for pattern matching against nil, that will be
a follow on patch.



Swift SVN r18918
2014-06-15 22:59:03 +00:00
Argyrios Kyrtzidis
6054e2e685 [AST] Hide as private symbols that use types from the Builtin module.
rdar://17053694

Swift SVN r18657
2014-05-28 21:17:44 +00:00
Argyrios Kyrtzidis
829473a5dd [AST] Print a 'public' typealias with a 'private' underlying type by printing the declaration but not its underlying type.
Swift SVN r18656
2014-05-28 21:17:42 +00:00
Argyrios Kyrtzidis
5718e5fe3d [stdlib] Re-expose 'nil' as a public symbol.
rdar://17053045

Swift SVN r18652
2014-05-28 17:57:41 +00:00
Argyrios Kyrtzidis
c5e19b4afd [AST] Hide operator '~>' as an internal symbol.
Swift SVN r18628
2014-05-25 20:42:23 +00:00
Argyrios Kyrtzidis
b1914701e9 [stdlib] In ContiguousArrayBuffer<T>, vars 'storage' and 'base' where under the 'private' section
so I took the liberty to 'privatize' them with a leading underscore.

This also completely removes '_ArrayBody' from the public interface.
Should be NFC, apart from the public interface change.

Swift SVN r18625
2014-05-25 04:31:13 +00:00
Argyrios Kyrtzidis
95bd9e1d28 [AST/IDE] Centralize the logic to determine if a symbols is a 'private' stdlib one and hide them more extensively.
-Hide vars that have a private type.
-Hide functions that have a parameter with private type or a parameter name with leading underscore.
-Minor change in StringUTF16.swift to avoid printing "func generate() -> IndexingGenerator<_StringCore>".

rdar://17027294

Swift SVN r18623
2014-05-25 03:49:02 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dmitri Hrybenko
f83a6c0c5a AST printing: don't insist on having a Clang module in Swift-only modules
Swift SVN r15966
2014-04-04 23:59:51 +00:00