Skip to content

Commit f7b89c3

Browse files
committed
---
yaml --- r: 349076 b: refs/heads/master c: ce59d76 h: refs/heads/master
1 parent e6609fd commit f7b89c3

File tree

85 files changed

+975
-1967
lines changed

Some content is hidden

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

85 files changed

+975
-1967
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: 7b9f30b51716a95bffe0512ee04fb5cfc3bad43a
2+
refs/heads/master: ce59d76c53e978435ef9648dbfa1b94da5d8e619
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/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ endif()
1111
list(APPEND CMAKE_MODULE_PATH
1212
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1313

14+
set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)
15+
1416
if(DEFINED CMAKE_JOB_POOLS)
1517
# CMake < 3.11 doesn't support CMAKE_JOB_POOLS. Manually set the property.
1618
set_property(GLOBAL PROPERTY JOB_POOLS "${CMAKE_JOB_POOLS}")

trunk/cmake/modules/SwiftSource.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ function(_compile_swift_files
333333
"-emit-module-interface-path" "${interface_file}")
334334
endif()
335335

336+
if (NOT SWIFTFILE_IS_STDLIB_CORE)
337+
list(APPEND swift_module_flags
338+
"-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
339+
endif()
340+
336341
# If we have extra regexp flags, check if we match any of the regexps. If so
337342
# add the relevant flags to our swift_flags.
338343
if (SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS OR SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS)

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: 39 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
);
@@ -2978,6 +2985,9 @@ class TypeAliasDecl : public GenericTypeDecl {
29782985
/// Retrieve a sugared interface type containing the structure of the interface
29792986
/// type before any semantic validation has occured.
29802987
Type getStructuralType() const;
2988+
2989+
/// Set the interface type of this typealias declaration from the underlying type.
2990+
void computeType();
29812991

29822992
bool isCompatibilityAlias() const {
29832993
return Bits.TypeAliasDecl.IsCompatibilityAlias;
@@ -3166,6 +3176,10 @@ class AssociatedTypeDecl : public AbstractTypeParamDecl {
31663176
TrailingWhere = trailingWhereClause;
31673177
}
31683178

3179+
/// Set the interface type of this associated type declaration to a dependent
3180+
/// member type of 'Self'.
3181+
void computeType();
3182+
31693183
/// Retrieve the associated type "anchor", which is the associated type
31703184
/// declaration that will be used to describe this associated type in the
31713185
/// ABI.
@@ -3355,6 +3369,10 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33553369
Bits.NominalTypeDecl.AddedImplicitInitializers = true;
33563370
}
33573371

3372+
/// Set the interface type of this nominal type to the metatype of the
3373+
/// declared interface type.
3374+
void computeType();
3375+
33583376
/// getDeclaredType - Retrieve the type declared by this entity, without
33593377
/// any generic parameters bound if this is a generic type.
33603378
Type getDeclaredType() const;
@@ -4786,7 +4804,8 @@ class VarDecl : public AbstractStorageDecl {
47864804
bool issCaptureList, SourceLoc nameLoc, Identifier name,
47874805
DeclContext *dc, StorageIsMutable_t supportsMutation);
47884806

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

47914810
Type typeInContext;
47924811

@@ -4806,10 +4825,8 @@ class VarDecl : public AbstractStorageDecl {
48064825
return hasName() ? getBaseName().getIdentifier().str() : "_";
48074826
}
48084827

4809-
/// Retrieve the TypeRepr corresponding to the parsed type of the parent
4810-
/// pattern, if it exists.
4811-
TypeRepr *getTypeRepr() const { return ParentRepr; }
4812-
void setTypeRepr(TypeRepr *repr) { ParentRepr = repr; }
4828+
TypeLoc &getTypeLoc() { return typeLoc; }
4829+
TypeLoc getTypeLoc() const { return typeLoc; }
48134830

48144831
bool hasType() const {
48154832
// We have a type if either the type has been computed already or if
@@ -5184,8 +5201,10 @@ class ParamDecl : public VarDecl {
51845201
Identifier argumentName, SourceLoc parameterNameLoc,
51855202
Identifier parameterName, DeclContext *dc);
51865203

5187-
/// Create a new ParamDecl identical to the first except without the interface type.
5188-
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);
51895208

51905209
/// Retrieve the argument (API) name for this function parameter.
51915210
Identifier getArgumentName() const { return ArgumentName; }
@@ -5202,7 +5221,10 @@ class ParamDecl : public VarDecl {
52025221
SourceLoc getParameterNameLoc() const { return ParameterNameLoc; }
52035222

52045223
SourceLoc getSpecifierLoc() const { return SpecifierLoc; }
5205-
5224+
5225+
bool isTypeLocImplicit() const { return Bits.ParamDecl.IsTypeLocImplicit; }
5226+
void setIsTypeLocImplicit(bool val) { Bits.ParamDecl.IsTypeLocImplicit = val; }
5227+
52065228
DefaultArgumentKind getDefaultArgumentKind() const {
52075229
return static_cast<DefaultArgumentKind>(Bits.ParamDecl.defaultArgumentKind);
52085230
}
@@ -5473,6 +5495,10 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
54735495
TypeLoc &getElementTypeLoc() { return ElementTy; }
54745496
const TypeLoc &getElementTypeLoc() const { return ElementTy; }
54755497

5498+
/// Compute the interface type of this subscript from the parameter and
5499+
/// element types.
5500+
void computeType();
5501+
54765502
/// Determine the kind of Objective-C subscripting this declaration
54775503
/// implies.
54785504
ObjCSubscriptKind getObjCSubscriptKind() const;
@@ -6343,6 +6369,10 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63436369
return hasName() ? getBaseName().getIdentifier().str() : "_";
63446370
}
63456371

6372+
/// Set the interface type of this enum element to the constructor function
6373+
/// type; (Self.Type) -> Self or (Self.Type) -> (Args...) -> Self.
6374+
void computeType();
6375+
63466376
Type getArgumentInterfaceType() const;
63476377

63486378
void setParameterList(ParameterList *params);

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 4 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",
@@ -4533,6 +4533,8 @@ ERROR(property_wrapper_wrong_initial_value_init, none,
45334533
(DeclName, Type, Type))
45344534
ERROR(property_wrapper_failable_init, none,
45354535
"%0 cannot be failable", (DeclName))
4536+
ERROR(property_wrapper_ambiguous_default_value_init, none,
4537+
"property wrapper type %0 has multiple default-value initializers", (Type))
45364538
ERROR(property_wrapper_type_requirement_not_accessible,none,
45374539
"%select{private|fileprivate|internal|public|open}0 %1 %2 cannot have "
45384540
"more restrictive access than its enclosing property wrapper type %3 "

0 commit comments

Comments
 (0)