Commit Graph

110 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
b5ada197f5 [ASTPrinter] When printing interface hide @inline attribute.
rdar://21043283

Swift SVN r28857
2015-05-20 23:12:22 +00:00
Argyrios Kyrtzidis
ef213fddcd [ASTPrinter] Add an extra print option to control printing 'internal' keyword if accessibility printing is enabled.
Swift SVN r28813
2015-05-20 01:45:56 +00:00
Ted Kremenek
62feb5c949 Change @availability to @available.
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.

This is a divergence from Objective-C.

Swift SVN r28484
2015-05-12 20:06:13 +00:00
Joe Groff
6849ebda87 SIL printer: Disambiguate context archetypes with name collisions.
This can happen in witnesses, whose context archetypes are composed from the type-level archetypes of the witnessing type, and the method-level archetypes of the requirement. If you have something like:

protocol Foo {
  func foo<T>(x: T)
}

struct Bar<T>: Foo {
  func foo<U>(x: U)
}

Bar's witness to Foo.foo will end up with two archetypes named "T". Deal with this by having the SIL printer introduce a name mapping that disambiguates colliding archetypes. Refactor the SIL printer to do streaming through the SILPrinter itself, rather than directly on its ostream, so that we make sure it controls how subelements like types are printed, and it can pass the appropriate options down to the AST type printer. Fixes rdar://problem/20659406.

Swift SVN r27991
2015-04-30 18:42:31 +00:00
Doug Gregor
b2cc34c241 Remove '#' for making parameter names into argument labels.
If you want to make the parameter and argument label the same in
places where you don't get the argument label for free (i.e., the
first parameter of a function or a parameter of a subscript),
double-up the identifier:

  func translate(dx dx: Int, dy: Int) { }

Make this a warning with Fix-Its to ease migration. Part of
rdar://problem/17218256.

Swift SVN r27715
2015-04-24 23:58:57 +00:00
Xi Ge
c53aefb874 [ModulePrint] Skip user inaccessible decl attrs when printing module interfaces.
Not skipping them may cause internal-used attributes' leaking to external developers.
rdar://19903962

Swift SVN r27324
2015-04-15 20:06:08 +00:00
Joe Groff
c0a2994564 AST: Start printing function types with @convention instead of old attributes.
And update tests to match.

Swift SVN r27262
2015-04-13 22:51:34 +00:00
Argyrios Kyrtzidis
7fe32e1d6b [AST/Print] Add PrintOptions::printInterface(), used to retrieve the set of options suitable for interface generation.
These will affect how SourceKit prints the interface.

Swift SVN r25639
2015-02-28 19:58:14 +00:00
Xi Ge
95a431885b When printing the interfaces in a module, denit is not informative
. Thus, this change allows swift-ide-test to ignore deinit when printing
interfaces. Also, to ignore is the default setting. Attribut -skip-deinit
can switch it off.
rdar://19079711

Swift SVN r25608
2015-02-27 21:48:23 +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
Argyrios Kyrtzidis
8dba2bc129 [ASTPrinter] Control whether we should skip printing empty extensions or not.
Swift SVN r23469
2014-11-20 05:08:37 +00:00
Argyrios Kyrtzidis
442f34378f [ASTPrinter] Avoid printing @effects attribute by default.
We don't want to expose this attribute currently.
Test on the SourceKit side.

rdar://18262482

Swift SVN r21774
2014-09-08 16:29:56 +00:00
Manman Ren
d23e86fc62 [SILParser] parsing Self as part of where clause.
Do not print @sil_self when dumping top decls.

rdar://17979145


Swift SVN r21155
2014-08-12 21:38:25 +00:00
Jordan Rose
1a65ce0c16 Print @availability and @asmname on their own line.
These attributes are too long and would mess up the flow of the line if
placed directly before the decl introducer.

Swift SVN r20840
2014-07-31 18:58:13 +00:00
Jordan Rose
00b6a5cb08 Import Objective-C properties marked weak/copy as weak/@NSCopying.
...and 'assign' and 'unsafe_unretained' as 'unowned(unsafe)', if the
property is a class type.

This isn't important for the compiler, but it is documentation for users
when they look at the generated interface for an Objective-C module.

Note that this actually produces a decl users can't yet write:

  unowned(unsafe) var foo: UIView!

That's <rdar://problem/17277899> unowned pointers can't be optional.

<rdar://problem/17245555>

Swift SVN r20433
2014-07-23 22:29:01 +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
15fe0e2f69 Avoid double negative in comments
Swift SVN r20405
2014-07-23 16:05:13 +00:00
Dmitri Hrybenko
1007ef3f95 Module interface printing: add an option to filter declarations based on
access control

Swift SVN r20399
2014-07-23 15:03:58 +00:00
Manman Ren
1bd9d81971 [SILParser] fix a few issues to enable parsing of sil from swift array
Add PrintForSIL in PrintOptions
1> for NameAliasType, we print getSinglyDesugaredType()
I attempted another option: set FullyQualifiedTypes of PrintOptions, but that
will print xxx.Type.xxx and Parser can’t handle it.
2> for Self, we print @sil_self

We also work around parsing:
sil_witness_table _CocoaArrayType: _CocoaArrayType

sil_vtable uses internal classes in stdlib, so we use lookupTopDecl instead
of lookupValue when parsing sil_vtable, to find internal classes.

Fix rdar://17261925 rdar://17295316 rdar://17046276 rdar://17579890


Swift SVN r20070
2014-07-17 04:43:24 +00:00
Jordan Rose
20bc9ec2b9 Add accessibility printing, and test the accessibility inference so far.
Swift SVN r19144
2014-06-24 21:32:15 +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
Argyrios Kyrtzidis
16d4b98b83 [ASTPrinter] Add more printing options, SkipAttributes/SkipIntroducerKeywords/ArgAndParamPrintingMode.
Swift SVN r17677
2014-05-08 04:17:40 +00:00
Ted Kremenek
0b2c23ffec Remove special printing of ImplicitlyUnwrappedOptional<T>.
Part of <rdar://problem/16836463>

Swift SVN r17610
2014-05-07 06:59:52 +00:00
Argyrios Kyrtzidis
42484084f2 [ASTPrinter] Add an option to always print the keyword argument and the parameter,
even if they are the same.

rdar://16799973

Swift SVN r17412
2014-05-05 00:52:06 +00:00
Argyrios Kyrtzidis
f514d8862e [ASTPrinter] Remove PrintOptions option that is a leftover.
Swift SVN r17411
2014-05-05 00:08:59 +00:00
Argyrios Kyrtzidis
7f2fa7f97e [IDE] Filter out attributes like @objc and @availability when code-completing overrides.
rdar://16766431

Swift SVN r17366
2014-05-04 05:19:11 +00:00
Argyrios Kyrtzidis
bb66d6dd1a [IDE] Don't show '@transparent' in the module interface.
rdar://16804855

Swift SVN r17350
2014-05-04 01:24:55 +00:00
Argyrios Kyrtzidis
c0e69b8d4a [Printer] In PrintOptions, add a general 'exclude attributes' list for the attribute kinds we don't want to print.
Swift SVN r17349
2014-05-04 01:24:52 +00:00
Ted Kremenek
4e70269c53 More renaming 'unchecked optional' to 'implicitly unwrapped optional'.
Swift SVN r17236
2014-05-02 06:22:01 +00:00
Ted Kremenek
050fd53af7 Rename UncheckedOptional to ImplicitlyUnwrappedOptional.
Swift SVN r17232
2014-05-02 06:13:57 +00:00
Argyrios Kyrtzidis
c1fd5b5a31 [IDE] For the module interface, add an option to not print parameter names.
rdar://16600455

Swift SVN r16275
2014-04-13 05:33:06 +00:00
Argyrios Kyrtzidis
293d771905 [IDE] Add an option to skip printing declarations that start with '_', for the module interface.
rdar://16559411

Swift SVN r16272
2014-04-13 04:35:30 +00:00
Argyrios Kyrtzidis
4c91bd074f [IDE] Print out regular comments from the clang module headers, for the module interface.
rdar://16451119

Swift SVN r16249
2014-04-12 05:21:08 +00:00
Dmitri Hrybenko
3972e2b23a Reimplement @unchecked suppression: print '@unchecked T?' as 'T?' instead of
plain 'T'

rdar://16530754


Swift SVN r16213
2014-04-11 11:02:45 +00:00
Dmitri Hrybenko
6f099be5cd AST printer: add an option to disable printing function representation
attributes (@thin, @objc_block)


Swift SVN r16208
2014-04-11 10:03:07 +00:00
Dmitri Hrybenko
0fc4f3949c AST printer: add an option to hide @exported
Swift SVN r16168
2014-04-10 19:39:25 +00:00
Dmitri Hrybenko
e68fd4abd3 AST printer: add an option to hide 'override' keywords
rdar://16530754


Swift SVN r16162
2014-04-10 14:27:00 +00:00
Dmitri Hrybenko
cc30070f68 AST printer: add an option to suppress @unchecked in imported declarations
This is rdar://16530754.  For @unchecked in code completion see
rdar://16576739.


Swift SVN r16156
2014-04-10 10:40:30 +00:00
Doug Gregor
9e75a46c8c swift-ide-test: Add a -skip-unavailable option to skip unavailable declarations
Swift SVN r16056
2014-04-08 16:34:44 +00:00
Dmitri Hrybenko
f198c28d75 Serialize @required as a DeclAttribute
Also introduce an invalid bit on a DeclAttribute for use by semantic analysis.

This fixes AST printing for @required.


Swift SVN r15938
2014-04-04 15:24:47 +00:00
Dmitri Hrybenko
78e354b2b9 AST printing: make PrintDefaultParameterPlaceholder the default (since we are
not going to implement expression printing any time soon), and fix a bug in its
implementation: when used with deserialized modules, "= default" was not
printed.


Swift SVN r15798
2014-04-02 13:56:54 +00:00
Argyrios Kyrtzidis
5bc01ea0a2 [IDE] Allow the caller of ide::printModuleInterface() to control whether documentation comments should be printed
Part of rdar://16450298

Swift SVN r15584
2014-03-28 18:51:47 +00:00
Dmitri Hrybenko
1d6c76c352 Module interface printing: pass through documentation comments for imported
declarations

rdar://16408910


Swift SVN r15576
2014-03-28 10:54:06 +00:00
Sonny Falk
275eb64dd6 Rename the option for default parameter placeholder to better reflect
the meaning, PrintDefaultParameterPlaceholder.

Swift SVN r15566
2014-03-27 21:26:42 +00:00
Sonny Falk
7f83777900 Add an option to print a placeholder for variable initializers.
This allows us to pretty print default function parameters as:
func foo(arg1: Int = default)

Swift SVN r15564
2014-03-27 20:53:58 +00:00
Dmitri Hrybenko
92b29ef045 Revert "Module interface printing: pass through documentation comments for
imported declarations"

rdar://16408910


Swift SVN r15527
2014-03-26 21:28:42 +00:00
Dmitri Hrybenko
30c6eeff16 Module interface printing: pass through documentation comments for imported
declarations

rdar://16408910


Swift SVN r15511
2014-03-26 16:16:02 +00:00
Dmitri Hrybenko
5e571043d8 Unindent and fix comment
Swift SVN r15506
2014-03-26 11:40:30 +00:00
Dmitri Hrybenko
94eb4f986a Module interface printing: don't print { get set } when it is the default
rdar://16070050


Swift SVN r14286
2014-02-23 15:14:28 +00:00
Jordan Rose
0b2541b58f Rename the standard library to "Swift" (instead of "swift")
This is more in line with all other modules currently on our system.
If/when we get our final name for the language, we're at least now set
up to rename the library without /too/ much trouble. (This is mostly just
a lot of searching for "import swift", "swift.", "'swift'", and '"swift"'.
The compiler itself is pretty much just using STDLIB_NAME consistently now,
per r13758.)

<rdar://problem/15972383>

Swift SVN r14001
2014-02-17 19:30:47 +00:00