Commit Graph

2129 Commits

Author SHA1 Message Date
Doug Gregor
129aa191a6 Remove the use of ArgParamPatterns in the AST printer and dumper.
Swift SVN r16436
2014-04-17 03:33:46 +00:00
Argyrios Kyrtzidis
a9ea63a7f7 [IDE/ModuleInterface] Adjust the indentation of regular comments to match the current indentation level.
Swift SVN r16362
2014-04-15 06:27:40 +00:00
Joe Groff
f7cf592777 Add a SIL-only '@block_storage T' type to represent on-stack storage for blocks.
Blocks need to be born on the stack, so we need a way to represent that on-stack storage. @block_storage T will represent the layout of a block that contains storage for a capture of type T.

Swift SVN r16355
2014-04-15 03:56:09 +00:00
Chris Lattner
6e90d343be At long last, land the implementation of <rdar://problem/16397000> Should be able to override stored properties
This means that we now synthesize getters and setters a lot more than we used to, so the
implementation work on this shook out a ton of bugs with them.

There is still one failure that I don't understand at all (test/stdlib/NewArray.swift.gyb), 
nor do I understand how to diagnose the problem, so I XFAILed it and filed rdar://16604980 to
track fixing it.



Swift SVN r16299
2014-04-14 04:48:54 +00:00
Argyrios Kyrtzidis
f931674573 [IDE/ModuleInterface] Pick up the vertical spacing/grouping that is used in the clang module header.
Swift SVN r16294
2014-04-14 03:28:08 +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
defccdea36 [ASTPrinter] Introduce a function for the logic of whether to print a declaration or not.
Swift SVN r16270
2014-04-13 04:35:27 +00:00
Dmitri Hrybenko
01c26070ec AST printer: default to new-style function declaration syntax:
func f(paramName argName: Type)


Swift SVN r16260
2014-04-12 18:21:25 +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
John McCall
8a85750c4c Plumb a lot of querying for different kinds of existential
type.

Swift SVN r16232
2014-04-11 22:30:14 +00:00
Dmitri Hrybenko
6a24e5475e Remove a separate bit for @objc inference, and use normal implicit attributes
This allows us to get rid of /* @objc(inferred) */ completely.


Swift SVN r16215
2014-04-11 14:34:28 +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
Dmitri Hrybenko
069469c485 Unindent code within a namespace. NFC.
Swift SVN r16124
2014-04-09 18:27:07 +00:00
Dmitri Hrybenko
f90e0c153b Make 'override' a keyword
rdar://16462192

Swift SVN r16115
2014-04-09 14:19:50 +00:00
Joe Groff
8adaab0233 Fold ExtInfo::isThin and ::isBlock into a "Representation" enum.
These bits are orthogonal to each other, so combine them into one, and diagnose attempts to produce a type that's both. Spot-fix a bunch of places this revealed by inspection that we would have crashed in SILGen or IRGen if blocks were be handled.

Swift SVN r16088
2014-04-09 00:37:26 +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
f661691962 Don't serialize @final twice and add tests for printing @final
Swift SVN r15962
2014-04-04 23:20:55 +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
Doug Gregor
5fd25eb4ef Revert "AST printing for functions where the first parameter has a separate name."
This reverts r15141.

Conflicts:
	lib/AST/ASTPrinter.cpp

Swift SVN r15845
2014-04-02 23:27:50 +00:00
Doug Gregor
6496d69cb8 Simplify down to a single command-line option for preposition splitting.
Swift SVN r15835
2014-04-02 21:44:19 +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
Dmitri Hrybenko
e42a3e5762 AST printer: undo the damage of r15737, while retaining the whitespace handling
refactoring, allowing ASTPrinter callbacks to be called exactly when a first
non-whitespace character of the declaration is printed, ignoring the
indentation and leading blank lines.


Swift SVN r15743
2014-04-01 20:07:41 +00:00
Dmitri Hrybenko
95cc4ef483 AST printer: print a blank line before a declaration with a documentation
comment

rdar://16432279


Swift SVN r15741
2014-04-01 17:53:19 +00:00
Dmitri Hrybenko
e531e4dd0f AST printer: improve handling of newlines and indentation to more precisely
capture source ranges of declarations


Swift SVN r15737
2014-04-01 17:10:41 +00:00
John McCall
f1180f5e6d in order to work correctly for non-@objc protocols.
Language features like erasing concrete metatype
values are also left for the future.  Still, baby steps.

The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.

I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.

An existential metatype is the formal type
 \exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
 (\exists t:P . t).Type
which is singleton.  Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.

This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation.  Eventually, we will
need them to be able to carry protocol witness tables

Swift SVN r15716
2014-04-01 00:38:28 +00:00
Doug Gregor
d51744e396 Clang importer: add @objc(name) attributes to imported classes and protocols.
Now that we represent the Objective-C runtime names of classes and
protocols in a uniform way, stop peeking into the Clang AST nodes to
get this information for imported classes and protocols. This is
better layering and helps test that new code path.


Swift SVN r15632
2014-03-29 21:15:29 +00:00
Doug Gregor
055e0ef136 Add an "implicit" bit to DeclAttribute.
Swift SVN r15623
2014-03-29 17:24:15 +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
Sonny Falk
4867e37b01 Restore r15378: fix the AST printer to print "let" for let variables.
Update the associated tests.

Swift SVN r15536
2014-03-26 23:44:52 +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
Doug Gregor
1cdd295182 Move the @objc attribute over to a DeclAttribute.
Swift SVN r15517
2014-03-26 19:33:07 +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
7e294eea4d Module interface printing: print imported Clang declarations in header source
order

rdar://problem/16408837


Swift SVN r15505
2014-03-26 11:36:25 +00:00
Doug Gregor
38c6b197b8 AST printing using the proposed unified function syntax, when splitting selectors.
No tests and no parsing support; this is for experimentation only.


Swift SVN r15456
2014-03-25 16:13:02 +00:00
Dmitri Hrybenko
46fbf21e59 Remove trailing whitespace
Swift SVN r15454
2014-03-25 14:48:12 +00:00
Chris Lattner
0bec9700e8 Add a hack to the ASTPrinter, when printing PatternBindingDecls to print
immutable variables with a let prefix instead of a 'var' prefix.  This allows
us to AST print this as 'let' instead of 'var', which isn't totally awesome,
but is better than misleading people with var.

func f() {
  let x : Int  = 42
}

Also, fix the SILPrinter to explode pattern binding decls, so that it doesn't
fall into the booby traps inherent in PatternBindingDecl printing.


Swift SVN r15393
2014-03-23 16:37:51 +00:00
Chris Lattner
4b0808f47e revert r15378. It turns out that PatternBindingDecls are the ones that are botching
the immutability issue.


Swift SVN r15392
2014-03-23 16:17:55 +00:00
Chris Lattner
00e546adda fix the AST printer to print "let" for let variables.
Swift SVN r15378
2014-03-23 05:24:53 +00:00
Dmitri Hrybenko
11fea869c1 Change 'switch' not to fall through between empty cases and always require at
least one statement per case

rdar://16301313


Swift SVN r15266
2014-03-20 11:44:59 +00:00
John McCall
c40a2e54b2 Extract a method to print a CheckedCastKind and dump
it on CheckedCastExprs.

Swift SVN r15245
2014-03-19 20:25:09 +00:00
Doug Gregor
39da9742b1 AST printing for functions where the first parameter has a separate name.
Swift SVN r15141
2014-03-17 16:36:06 +00:00
Joe Groff
34400bd64b Add 'print' and 'dump' methods to GenericSignature.
Swift SVN r14944
2014-03-12 00:50:41 +00:00
Joe Groff
b08f06f191 Revert "Accept (and prefer) "import type" as a scoped import for any non-protocol type."
This reverts commit r14488, since we're demoting 'type' back to a plain old identifier.

We could consider reallowing 'type' as a contextual keyword here, but from talking to Jordan he was OK with just reverting this functionality.

Swift SVN r14931
2014-03-11 23:18:30 +00:00