Commit Graph

18 Commits

Author SHA1 Message Date
practicalswift
8efa5f587e [gardening] Remove "-*- C++ -*-" tag from .cpp files
Emacs assumes .h files are C files by default which is why the
tag "-*- C++ -*-" is needed.

.cpp files do not have this problem.
2016-01-23 12:09:32 +01:00
Doug Gregor
67c81154af Add a swift3_migration attribute to describe how an API gets migrated.
Introduce a new attribute, swift3_migration, that lets us describe the
transformation required to map a Swift 2.x API into its Swift 3
equivalent. The only transformation understood now is "renamed" (to
some other declaration name), but there's a message field where we can
record information about other changes. The attribute can grow
somewhat (e.g., to represent parameter reordering) as we need it.

Right now, we do nothing but store and validate this attribute.
2016-01-13 16:53:01 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Doug Gregor
b27e88b70b Record Objective-C method lookup tables in Swift modules.
Include a mapping from Objective-C selectors to the @objc methods that
produce Objective-c methods with those selectors. Use this to lazily
populate the Objective-C method lookup tables in each class. This makes
@objc override checking work across Swift modules, which is part of
rdar://problem/18391046.

Note that we use a single, unified selector table, both because it is
simpler and because it makes global queries ("is there any method with
the given selector?") easier.

Swift SVN r23214
2014-11-11 00:19:03 +00:00
Doug Gregor
89e5e5b6fa Diagnose redeclarations of Objective-C methods.
@objc methods, initializers, deinitializers, properties, and
subscripts all produce Objective-C methods. Diagnose cases where two
such entities (which may be of different kinds) produce the same
Objective-C method in the same class.

As a special exception, one can have an Objective-C method in an
extension that conflicts with an Objective-C method in the original
class definition, so long as the original class definition is from a
different model. This reflects the reality in Objective-C that the
category definition wins over the original definition, and is used in
at least one overlay (SpriteKit).

This is the first part of rdar://problem/18391046; the second part
involves checking that overrides are sane.

Swift SVN r23147
2014-11-07 01:15:14 +00:00
Doug Gregor
3d4df3427a Pretty-print DeclNames with no keyword arguments by dropping the parenthsized bit.
Instead of printing "f(_:_:)", just print "f". 


Swift SVN r17078
2014-04-30 06:28:36 +00:00
Doug Gregor
1d4731e7d9 Reinstate the '_' for "no keyword argument" in the name of a function/method/initializer.
Swift SVN r17076
2014-04-30 06:09:42 +00:00
Doug Gregor
7bef9c45c4 Simplify the declaration naming scheme to use a blank rather than _ for unnamed arguments.
Arguments without API names are going to get more common soon, so
simplify names like "tableView(_:rowViewForRow:)" to
"tableView(:rowViewForRow:)".

Swift SVN r16982
2014-04-28 16:00:02 +00:00
Argyrios Kyrtzidis
9638623493 [AST] Make dump functions const, NFC.
Swift SVN r16917
2014-04-27 05:33:38 +00:00
Doug Gregor
fa8a10e36e Unbreak ObjCSelector and the new ObjCAttr.
Swift SVN r16329
2014-04-14 20:22:10 +00:00
Doug Gregor
cd4ca76b6a Introduce the ObjCSelector class to store an Objective-C selector.
We have to work with selectors quite often, so provide an efficient
representation for them. Switch ObjCAttr over to this representation,
which has the nice property that it efficiently represents implicit
@objc attributes with names and allows us to overwrite the Objective-C
name without losing all source information. Addresses
<rdar://problem/16478678>, and sets us up for dealing with selectors
better.

Swift SVN r16327
2014-04-14 20:05:35 +00:00
Doug Gregor
e418e93511 Start cleaning up method name importing.
Import a selector into a Swift method name, performing splitting at
that point. Use the resulting method name to determine the argument
names of the parameters, rather than trying to chop up the selector
again. There's more refactoring to do here.

This fixes a longstanding bug where the first argument of an
Objective-C method got the internal parameter name when it should
have gotten no name at all.

Swift SVN r15850
2014-04-03 00:34:40 +00:00
Doug Gregor
9189145cc5 Change DeclName over to basename(arg1:arg2:...argN:).
Swift will use the basename + argument names formulation for
names. Update the DeclName interfaces, printing, and __FUNCTION__ to
use the method syntax.

We'll still need to rework the "x.foo:bar:wibble:" syntax; that will
come (significantly) later.

Swift SVN r15763
2014-04-02 00:00:03 +00:00
Joe Groff
96c09d7179 Renovate name lookup to prepare for compound name lookup.
Make the name lookup interfaces all take DeclNames instead of identifiers, and update the lookup caches of the various file units to index their members by both compound name and simple name. Serialized modules are keyed by identifiers, so as a transitional hack, do simple name lookup then filter the results by compound name.

Swift SVN r14768
2014-03-07 03:21:29 +00:00
Chris Lattner
96947b2606 Change silgen to lower string literal lengths to an explicit value, instead of using
the result of the string_literal instruction.

This fixes:
<rdar://problem/15883849> Diagnostic CCP should be able to fold operations on string_literal lengths

I will follow up with cleanups this enables.




Swift SVN r13361
2014-02-03 18:26:46 +00:00
Chris Lattner
3af81cccbe raw_ostream and NullablePtr. While there are more types that
could be handled in similar ways, this gets the most of them.


Swift SVN r424
2011-07-19 06:09:31 +00:00
Chris Lattner
cbecebb18d -ast-dump shouldn't crash on empty identifiers
Swift SVN r153
2010-08-05 22:40:48 +00:00
Chris Lattner
ed1be4f17a add printing support for Identifier, switch VarDecl to have an
identifier instead of a stringref.


Swift SVN r63
2010-07-23 03:50:09 +00:00