Skip to content

Commit 148c325

Browse files
committed
---
yaml --- r: 315311 b: refs/heads/master-next c: 433410f h: refs/heads/master i: 315309: c33264c 315307: 78a40cf 315303: 74fcdc8 315295: b83c635
1 parent 71f49df commit 148c325

File tree

382 files changed

+2188
-6284
lines changed

Some content is hidden

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

382 files changed

+2188
-6284
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3fe9333052029c114ef816ea805c335eb1ee8a99
3-
refs/heads/master-next: de0cfbd41f2c11861cec4387753547fdf3162894
3+
refs/heads/master-next: 433410f0a96ba2d5bd3a36bcc6eed43134d6ce05
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ if(MSVC OR "${CMAKE_SIMULATE_ID}" STREQUAL MSVC)
450450
endif()
451451

452452
if(CMAKE_SYSTEM_NAME STREQUAL Darwin OR
453-
EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}")
453+
EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
454454
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
455455
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
456456
else()

branches/master-next/docs/DebuggingTheCompiler.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ diagnostic engine to assert on the first error/warning:
8686
These allow one to dump a stack trace of where the diagnostic is being emitted
8787
(if run without a debugger) or drop into the debugger if a debugger is attached.
8888

89-
Finding Diagnostic Names
90-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91-
92-
Some diagnostics rely heavily on format string arguments, so it can be difficult
93-
to find their implementation by searching for parts of the emitted message in
94-
the codebase. To print the corresponding diagnostic name at the end of each
95-
emitted message, use the ``-Xfrontend -debug-diagnostic-names`` argument.
96-
9789
Debugging the Type Checker
9890
--------------------------
9991

branches/master-next/docs/SIL.rst

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,8 +2342,8 @@ assign_by_wrapper
23422342
assign_by_wrapper %0 : $S to %1 : $*T, init %2 : $F, set %3 : $G
23432343
// $S can be a value or address type
23442344
// $T must be the type of a property wrapper.
2345-
// $F must be a function type, taking $S as a single argument (or multiple arguments in case of a tuple) and returning $T
2346-
// $G must be a function type, taking $S as a single argument (or multiple arguments in case of a tuple) and without a return value
2345+
// $F must be a function type, taking $S as a single argument and returning $T
2346+
// $G must be a function type, taking $S as a single argument and with not return value
23472347

23482348
Similar to the ``assign`` instruction, but the assignment is done via a
23492349
delegate.
@@ -3484,14 +3484,13 @@ has an escaping function type (not ``[on_stack]``) the closure context will be
34843484
allocated with retain count 1 and initialized to contain the values ``%1``,
34853485
``%2``, etc. The closed-over values will not be retained; that must be done
34863486
separately before the ``partial_apply``. The closure does however take ownership
3487-
of the partially applied arguments (except for ``@inout_aliasable`` parameters);
3488-
when the closure reference count reaches zero, the contained values will be
3489-
destroyed. If the ``partial_apply`` has a ``@noescape`` function type
3490-
(``partial_apply [on_stack]``) the closure context is allocated on the stack and
3491-
initialized to contain the closed-over values. The closed-over values are not
3492-
retained, lifetime of the closed-over values must be managed separately. The
3493-
lifetime of the stack context of a ``partial_apply [on_stack]`` must be
3494-
terminated with a ``dealloc_stack``.
3487+
of the partially applied arguments; when the closure reference count reaches
3488+
zero, the contained values will be destroyed. If the ``partial_apply`` has a
3489+
``@noescape`` function type (``partial_apply [on_stack]``) the closure context
3490+
is allocated on the stack and initialized to contain the closed-over values. The
3491+
closed-over values are not retained, lifetime of the closed-over values must be
3492+
managed separately. The lifetime of the stack context of a ``partial_apply
3493+
[on_stack]`` must be terminated with a ``dealloc_stack``.
34953494

34963495
If the callee is generic, all of its generic parameters must be bound by the
34973496
given substitution list. The arguments are given with these generic
@@ -3500,11 +3499,6 @@ type with the given substitutions applied. The generic parameters themselves
35003499
cannot be partially applied; all of them must be bound. The result is always
35013500
a concrete function.
35023501

3503-
If an address argument has ``@inout_aliasable`` convention, the closure
3504-
obtained from ``partial_apply`` will not own its underlying value.
3505-
The ``@inout_aliasable`` parameter convention is used when a ``@noescape``
3506-
closure captures an ``inout`` argument.
3507-
35083502
TODO: The instruction, when applied to a generic function,
35093503
currently implicitly performs abstraction difference transformations enabled
35103504
by the given substitutions, such as promoting address-only arguments and returns

branches/master-next/include/swift/AST/ASTContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,10 @@ class ASTContext final {
829829
/// \param IDC The context whose member decls should be lazily parsed.
830830
void parseMembers(IterableDeclContext *IDC);
831831

832+
/// Use the lazy parsers associated with the context to check whether the decl
833+
/// context has been parsed.
834+
bool hasUnparsedMembers(const IterableDeclContext *IDC) const;
835+
832836
/// Get the lazy function data for the given generic context.
833837
///
834838
/// \param lazyLoader If non-null, the lazy loader to use when creating the

branches/master-next/include/swift/AST/ASTNode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ namespace swift {
3636
enum class DeclKind : uint8_t;
3737
enum class StmtKind;
3838

39-
struct ASTNode : public llvm::PointerUnion<Expr*, Stmt*, Decl*> {
39+
struct ASTNode : public llvm::PointerUnion3<Expr*, Stmt*, Decl*> {
4040
// Inherit the constructors from PointerUnion.
41-
using PointerUnion::PointerUnion;
42-
41+
using PointerUnion3::PointerUnion3;
42+
4343
SourceRange getSourceRange() const;
4444

4545
/// Return the location of the start of the statement.

branches/master-next/include/swift/AST/Attr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ class TypeAttributes {
101101
AttrLocs[A] = L;
102102
}
103103

104-
void getAttrLocs(SmallVectorImpl<SourceLoc> &Locs) const {
104+
void getAttrRanges(SmallVectorImpl<SourceRange> &Ranges) const {
105105
for (auto Loc : AttrLocs) {
106106
if (Loc.isValid())
107-
Locs.push_back(Loc);
107+
Ranges.push_back(Loc);
108108
}
109109
}
110110

branches/master-next/include/swift/AST/Decl.h

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,13 @@ class alignas(1 << DeclAlignInBits) Decl {
556556

557557
/// \see ClassDecl::ForeignKind
558558
RawForeignKind : 2,
559-
560-
/// \see ClassDecl::getEmittedMembers()
561-
HasForcedEmittedMembers : 1,
559+
560+
/// Whether this class contains a destructor decl.
561+
///
562+
/// A fully type-checked class always contains a destructor member, even if
563+
/// it is implicit. This bit is used during parsing and type-checking to
564+
/// control inserting the implicit destructor.
565+
HasDestructorDecl : 1,
562566

563567
/// Information about the class's ancestry.
564568
Ancestry : 7,
@@ -3761,17 +3765,8 @@ class ClassDecl final : public NominalTypeDecl {
37613765
llvm::PointerIntPair<Type, 1, bool> SuperclassType;
37623766
} LazySemanticInfo;
37633767

3764-
bool hasForcedEmittedMembers() const {
3765-
return Bits.ClassDecl.HasForcedEmittedMembers;
3766-
}
3767-
3768-
void setHasForcedEmittedMembers() {
3769-
Bits.ClassDecl.HasForcedEmittedMembers = true;
3770-
}
3771-
37723768
friend class SuperclassDeclRequest;
37733769
friend class SuperclassTypeRequest;
3774-
friend class EmittedMembersRequest;
37753770
friend class TypeChecker;
37763771

37773772
public:
@@ -3919,9 +3914,23 @@ class ClassDecl final : public NominalTypeDecl {
39193914
/// either from a class itself or its direct or indirect superclasses.
39203915
AbstractFunctionDecl *findImplementingMethod(
39213916
const AbstractFunctionDecl *method) const;
3917+
3918+
/// True if the class has a destructor.
3919+
///
3920+
/// Fully type-checked classes always contain destructors, but during parsing
3921+
/// or type-checking, the implicit destructor may not have been synthesized
3922+
/// yet if one was not explicitly declared.
3923+
bool hasDestructor() const { return Bits.ClassDecl.HasDestructorDecl; }
3924+
3925+
/// Set the 'has destructor' flag.
3926+
void setHasDestructor() { Bits.ClassDecl.HasDestructorDecl = 1; }
39223927

39233928
/// Retrieve the destructor for this class.
3924-
DestructorDecl *getDestructor() const;
3929+
DestructorDecl *getDestructor();
3930+
3931+
/// Synthesize implicit, trivial destructor, add it to this ClassDecl
3932+
/// and return it.
3933+
void addImplicitDestructor();
39253934

39263935
/// Determine whether this class inherits the convenience initializers
39273936
/// from its superclass.
@@ -3984,10 +3993,6 @@ class ClassDecl final : public NominalTypeDecl {
39843993
/// Record the presence of an @objc method with the given selector.
39853994
void recordObjCMethod(AbstractFunctionDecl *method, ObjCSelector selector);
39863995

3987-
/// Get all the members of this class, synthesizing any implicit members
3988-
/// that appear in the vtable if needed.
3989-
DeclRange getEmittedMembers() const;
3990-
39913996
// Implement isa/cast/dyncast/etc.
39923997
static bool classof(const Decl *D) {
39933998
return D->getKind() == DeclKind::Class;
@@ -4795,7 +4800,7 @@ class VarDecl : public AbstractStorageDecl {
47954800
};
47964801

47974802
protected:
4798-
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4803+
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
47994804

48004805
VarDecl(DeclKind kind, bool isStatic, Introducer introducer,
48014806
bool issCaptureList, SourceLoc nameLoc, Identifier name,

branches/master-next/include/swift/AST/DeclContext.h

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,6 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
459459
/// are used.
460460
ResilienceExpansion getResilienceExpansion() const;
461461

462-
/// Returns true if this context may possibly contain members visible to
463-
/// AnyObject dynamic lookup.
464-
bool mayContainMembersAccessedByDynamicLookup() const;
465-
466462
/// Returns true if lookups within this context could affect downstream files.
467463
///
468464
/// \param functionsAreNonCascading If true, functions are considered non-
@@ -701,18 +697,7 @@ class IterableDeclContext {
701697
/// detect when a member has been added. A bit would suffice,
702698
/// but would be more fragile, The scope code could count the members each
703699
/// time, but I think it's a better trade to just keep a count here.
704-
unsigned MemberCount : 29;
705-
706-
/// Whether parsing the members of this context has been delayed.
707-
unsigned HasUnparsedMembers : 1;
708-
709-
/// Whether delayed parsing detected a possible operator definition
710-
/// while skipping the body of this context.
711-
unsigned HasOperatorDeclarations : 1;
712-
713-
/// Whether delayed parsing detect a possible nested class definition
714-
/// while skipping the body of this context.
715-
unsigned HasNestedClassDeclarations : 1;
700+
unsigned memberCount = 0;
716701

717702
template<class A, class B, class C>
718703
friend struct ::llvm::cast_convert_val;
@@ -724,44 +709,13 @@ class IterableDeclContext {
724709

725710
public:
726711
IterableDeclContext(IterableDeclContextKind kind)
727-
: LastDeclAndKind(nullptr, kind) {
728-
MemberCount = 0;
729-
HasOperatorDeclarations = 0;
730-
HasUnparsedMembers = 0;
731-
HasNestedClassDeclarations = 0;
732-
}
712+
: LastDeclAndKind(nullptr, kind) { }
733713

734714
/// Determine the kind of iterable context we have.
735715
IterableDeclContextKind getIterableContextKind() const {
736716
return LastDeclAndKind.getInt();
737717
}
738718

739-
bool hasUnparsedMembers() const {
740-
return HasUnparsedMembers;
741-
}
742-
743-
void setHasUnparsedMembers() {
744-
HasUnparsedMembers = 1;
745-
}
746-
747-
bool maybeHasOperatorDeclarations() const {
748-
return HasOperatorDeclarations;
749-
}
750-
751-
void setMaybeHasOperatorDeclarations() {
752-
assert(hasUnparsedMembers());
753-
HasOperatorDeclarations = 1;
754-
}
755-
756-
bool maybeHasNestedClassDeclarations() const {
757-
return HasNestedClassDeclarations;
758-
}
759-
760-
void setMaybeHasNestedClassDeclarations() {
761-
assert(hasUnparsedMembers());
762-
HasNestedClassDeclarations = 1;
763-
}
764-
765719
/// Retrieve the set of members in this context.
766720
DeclRange getMembers() const;
767721

@@ -774,8 +728,8 @@ class IterableDeclContext {
774728
/// is inserted immediately after the hint.
775729
void addMember(Decl *member, Decl *hint = nullptr);
776730

777-
/// See \c MemberCount
778-
unsigned getMemberCount() const { return MemberCount; }
731+
/// See \c memberCount
732+
unsigned getMemberCount() const { return memberCount; }
779733

780734
/// Check whether there are lazily-loaded members.
781735
bool hasLazyMembers() const {

branches/master-next/include/swift/AST/DiagnosticEngine.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,6 @@ namespace swift {
583583
/// input being compiled.
584584
/// May be invalid.
585585
SourceLoc bufferIndirectlyCausingDiagnostic;
586-
587-
/// Print diagnostic names after their messages
588-
bool printDiagnosticNames = false;
589586

590587
friend class InFlightDiagnostic;
591588
friend class DiagnosticTransaction;
@@ -621,14 +618,6 @@ namespace swift {
621618
return state.getWarningsAsErrors();
622619
}
623620

624-
/// Whether to print diagnostic names after their messages
625-
void setPrintDiagnosticNames(bool val) {
626-
printDiagnosticNames = val;
627-
}
628-
bool getPrintDiagnosticNames() const {
629-
return printDiagnosticNames;
630-
}
631-
632621
void ignoreDiagnostic(DiagID id) {
633622
state.setDiagnosticBehavior(id, DiagnosticState::Behavior::Ignore);
634623
}
@@ -837,8 +826,7 @@ namespace swift {
837826
void emitTentativeDiagnostics();
838827

839828
public:
840-
static const char *diagnosticStringFor(const DiagID id,
841-
bool printDiagnosticName);
829+
static const char *diagnosticStringFor(const DiagID id);
842830

843831
/// If there is no clear .dia file for a diagnostic, put it in the one
844832
/// corresponding to the SourceLoc given here.

branches/master-next/include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ WARNING(implicit_bridging_header_imported_from_module,none,
9191
"is deprecated and will be removed in a later version of Swift",
9292
(StringRef, Identifier))
9393

94+
WARNING(clang_vfs_overlay_is_ignored,none,
95+
"ignoring '-ivfsoverlay' options provided to '-Xcc' in favor of "
96+
"'-vfsoverlay'", ())
97+
9498
#ifndef DIAG_NO_UNDEF
9599
# if defined(DIAG)
96100
# undef DIAG

branches/master-next/include/swift/AST/DiagnosticsParse.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ ERROR(lex_illegal_multiline_string_end,none,
163163
"multi-line string literal closing delimiter must begin on a new line", ())
164164
ERROR(lex_multiline_string_indent_inconsistent,none,
165165
"%select{unexpected space in|unexpected tab in|insufficient}2 indentation of "
166-
"%select{line|next %1 lines}0 in multi-line string literal",
166+
"%select{line|next %1 lines}0 in multi-line string literal",
167167
(bool, unsigned, unsigned))
168168
NOTE(lex_multiline_string_indent_should_match_here,none,
169169
"should match %select{space|tab}0 here", (unsigned))
@@ -252,7 +252,7 @@ ERROR(cskeyword_not_attribute,none,
252252
"'%0' is a declaration modifier, not an attribute", (StringRef))
253253

254254
ERROR(decl_already_static,none,
255-
"%0 cannot appear after another 'static' or 'class' keyword", (StaticSpellingKind))
255+
"%0 specified twice", (StaticSpellingKind))
256256

257257
ERROR(enum_case_dot_prefix,none,
258258
"extraneous '.' in enum 'case' declaration", ())
@@ -881,7 +881,7 @@ WARNING(parameter_extraneous_double_up,none,
881881
"extraneous duplicate parameter name; %0 already has an argument "
882882
"label", (Identifier))
883883
ERROR(parameter_operator_keyword_argument,none,
884-
"%select{operator|closure|enum case}0 cannot have keyword arguments",
884+
"%select{operator|closure|enum case}0 cannot have keyword arguments",
885885
(unsigned))
886886

887887
ERROR(parameter_unnamed,none,

branches/master-next/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ ERROR(could_not_find_value_member,none,
8181
ERROR(could_not_find_value_member_corrected,none,
8282
"value of type %0 has no member %1; did you mean %2?",
8383
(Type, DeclName, DeclName))
84-
ERROR(could_not_find_value_dynamic_member_corrected,none,
85-
"value of type %0 has no dynamic member %2 using key path from root type %1; did you mean %3?",
86-
(Type, Type, DeclName, DeclName))
87-
ERROR(could_not_find_value_dynamic_member,none,
88-
"value of type %0 has no dynamic member %2 using key path from root type %1",
89-
(Type, Type, DeclName))
90-
9184
ERROR(could_not_find_type_member,none,
9285
"type %0 has no member %1", (Type, DeclName))
9386
ERROR(could_not_find_type_member_corrected,none,
@@ -3400,18 +3393,6 @@ ERROR(pattern_type_mismatch_context,none,
34003393

34013394
ERROR(tuple_pattern_in_non_tuple_context,none,
34023395
"tuple pattern cannot match values of the non-tuple type %0", (Type))
3403-
WARNING(matching_pattern_with_many_assoc_values, none,
3404-
"cannot match several associated values at once, "
3405-
"implicitly tupling the associated values and trying to match that "
3406-
"instead", ())
3407-
WARNING(matching_tuple_pattern_with_many_assoc_values,none,
3408-
"a tuple pattern cannot match several associated values at once, "
3409-
"implicitly tupling the associated values and trying to match "
3410-
"that instead", ())
3411-
WARNING(matching_many_patterns_with_tupled_assoc_value,none,
3412-
"the enum case has a single tuple as an associated value, but "
3413-
"there are several patterns here, implicitly tupling the patterns "
3414-
"and trying to match that instead", ())
34153396
ERROR(closure_argument_list_tuple,none,
34163397
"contextual closure type %0 expects %1 argument%s1, "
34173398
"but %2 %select{were|was}3 used in closure body", (Type, unsigned, unsigned, bool))

0 commit comments

Comments
 (0)