Skip to content

Commit 2b2218b

Browse files
committed
---
yaml --- r: 349039 b: refs/heads/master c: 05e24c0 h: refs/heads/master i: 349037: 66fed9e 349035: 2b8d877 349031: def82f1 349023: 5e9bffe
1 parent 23e93e3 commit 2b2218b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+378
-1086
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7d437ec4a8e8594fcc754cea8d6e699353e10188
2+
refs/heads/master: 05e24c0aaf6467e42815d6bf422cd28e2d761843
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/ASTContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ namespace swift {
109109
class TypeAliasDecl;
110110
class VarDecl;
111111
class UnifiedStatsReporter;
112-
class IndexSubset;
113112

114113
enum class KnownProtocolKind : uint8_t;
115114

trunk/include/swift/AST/Decl.h

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,21 @@ class alignas(1 << DeclAlignInBits) Decl {
369369
IsPropertyWrapperBackingProperty : 1
370370
);
371371

372-
SWIFT_INLINE_BITFIELD(ParamDecl, VarDecl, 1+2+NumDefaultArgumentKindBits,
372+
SWIFT_INLINE_BITFIELD(ParamDecl, VarDecl, 1+2+1+NumDefaultArgumentKindBits,
373373
/// Whether we've computed the specifier yet.
374374
SpecifierComputed : 1,
375375

376376
/// The specifier associated with this parameter. This determines
377377
/// the storage semantics of the value e.g. mutability.
378378
Specifier : 2,
379379

380+
/// True if the type is implicitly specified in the source, but this has an
381+
/// apparently valid typeRepr. This is used in accessors, which look like:
382+
/// set (value) {
383+
/// but need to get the typeRepr from the property as a whole so Sema can
384+
/// resolve the type.
385+
IsTypeLocImplicit : 1,
386+
380387
/// Information about a symbolic default argument, like #file.
381388
defaultArgumentKind : NumDefaultArgumentKindBits
382389
);
@@ -4797,7 +4804,8 @@ class VarDecl : public AbstractStorageDecl {
47974804
bool issCaptureList, SourceLoc nameLoc, Identifier name,
47984805
DeclContext *dc, StorageIsMutable_t supportsMutation);
47994806

4800-
TypeRepr *ParentRepr = nullptr;
4807+
/// This is the type specified, including location information.
4808+
TypeLoc typeLoc;
48014809

48024810
Type typeInContext;
48034811

@@ -4817,10 +4825,8 @@ class VarDecl : public AbstractStorageDecl {
48174825
return hasName() ? getBaseName().getIdentifier().str() : "_";
48184826
}
48194827

4820-
/// Retrieve the TypeRepr corresponding to the parsed type of the parent
4821-
/// pattern, if it exists.
4822-
TypeRepr *getTypeRepr() const { return ParentRepr; }
4823-
void setTypeRepr(TypeRepr *repr) { ParentRepr = repr; }
4828+
TypeLoc &getTypeLoc() { return typeLoc; }
4829+
TypeLoc getTypeLoc() const { return typeLoc; }
48244830

48254831
bool hasType() const {
48264832
// We have a type if either the type has been computed already or if
@@ -5195,8 +5201,10 @@ class ParamDecl : public VarDecl {
51955201
Identifier argumentName, SourceLoc parameterNameLoc,
51965202
Identifier parameterName, DeclContext *dc);
51975203

5198-
/// Create a new ParamDecl identical to the first except without the interface type.
5199-
static ParamDecl *cloneWithoutType(const ASTContext &Ctx, ParamDecl *PD);
5204+
/// Clone constructor, allocates a new ParamDecl identical to the first.
5205+
/// Intentionally not defined as a typical copy constructor to avoid
5206+
/// accidental copies.
5207+
ParamDecl(ParamDecl *PD, bool withTypes);
52005208

52015209
/// Retrieve the argument (API) name for this function parameter.
52025210
Identifier getArgumentName() const { return ArgumentName; }
@@ -5213,7 +5221,10 @@ class ParamDecl : public VarDecl {
52135221
SourceLoc getParameterNameLoc() const { return ParameterNameLoc; }
52145222

52155223
SourceLoc getSpecifierLoc() const { return SpecifierLoc; }
5216-
5224+
5225+
bool isTypeLocImplicit() const { return Bits.ParamDecl.IsTypeLocImplicit; }
5226+
void setIsTypeLocImplicit(bool val) { Bits.ParamDecl.IsTypeLocImplicit = val; }
5227+
52175228
DefaultArgumentKind getDefaultArgumentKind() const {
52185229
return static_cast<DefaultArgumentKind>(Bits.ParamDecl.defaultArgumentKind);
52195230
}

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ ERROR(cannot_convert_argument_value,none,
381381
(Type,Type))
382382

383383
NOTE(candidate_has_invalid_argument_at_position,none,
384-
"candidate expects %select{|in-out }2value of type %0 for parameter #%1",
385-
(Type, unsigned, bool))
384+
"candidate expects value of type %0 for parameter #%1",
385+
(Type, unsigned))
386386

387387
ERROR(cannot_convert_array_to_variadic,none,
388388
"cannot pass array of type %0 as variadic arguments of type %1",

trunk/include/swift/AST/IndexSubset.h

Lines changed: 0 additions & 276 deletions
This file was deleted.

trunk/include/swift/AST/ParameterList.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class alignas(ParamDecl *) ParameterList final :
111111
/// The cloned pattern is for an inherited constructor; mark default
112112
/// arguments as inherited, and mark unnamed arguments as named.
113113
Inherited = 0x02,
114+
/// The cloned pattern will strip type information.
115+
WithoutTypes = 0x04,
114116
};
115117

116118
friend OptionSet<CloneFlags> operator|(CloneFlags flag1, CloneFlags flag2) {

trunk/include/swift/Parse/ASTGen.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ class ASTGen {
108108
const SourceLoc Loc);
109109
Expr *generate(const syntax::PoundDsohandleExprSyntax &Expr,
110110
const SourceLoc Loc);
111-
Expr *generate(const syntax::ObjcKeyPathExprSyntax &Expr,
112-
const SourceLoc Loc);
113111
Expr *generate(const syntax::ObjectLiteralExprSyntax &Expr,
114112
const SourceLoc Loc);
115113
Expr *generate(const syntax::CodeCompletionExprSyntax &Expr,

trunk/include/swift/Parse/Parser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,6 @@ class Parser {
14521452
ParserResult<Expr> parseExprPrimary(Diag<> ID, bool isExprBasic);
14531453
ParserResult<Expr> parseExprUnary(Diag<> ID, bool isExprBasic);
14541454
ParserResult<Expr> parseExprKeyPathObjC();
1455-
ParsedSyntaxResult<ParsedExprSyntax> parseExprObjcKeyPathSyntax();
14561455
ParserResult<Expr> parseExprKeyPath();
14571456
ParserResult<Expr> parseExprSelector();
14581457
ParserResult<Expr> parseExprSuper();

0 commit comments

Comments
 (0)