Skip to content

Commit a127461

Browse files
committed
---
yaml --- r: 326605 b: refs/heads/tensorflow c: 6473b9d h: refs/heads/master i: 326603: 9cb078e
1 parent 6ffafb2 commit a127461

File tree

143 files changed

+8185
-10756
lines changed

Some content is hidden

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

143 files changed

+8185
-10756
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: 158dae0b243711564cbb24307473e107bac39aa2
819+
refs/heads/tensorflow: 6473b9d7cd0ef7b89d17cfb161153a7090d4aec1
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/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/tensorflow/include/swift/AST/ASTScope.h

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,8 @@ class ASTScopeImpl {
177177
void addChild(ASTScopeImpl *child, ASTContext &);
178178
std::vector<ASTScopeImpl *> rescueYoungestChildren(unsigned count);
179179

180-
/// When reexpanding, do we always create a new body?
181-
virtual NullablePtr<ASTScopeImpl> getParentOfRescuedScopes();
182-
std::vector<ASTScopeImpl *> rescueScopesToReuse();
183-
void addReusedScopes(ArrayRef<ASTScopeImpl *>);
180+
virtual std::vector<ASTScopeImpl *> rescueScopesToReuse();
181+
virtual void addReusedScopes(ArrayRef<ASTScopeImpl *>);
184182

185183
private:
186184
void removeChildren();
@@ -203,8 +201,7 @@ class ASTScopeImpl {
203201
/// InterpolatedStringLiteralExprs and EditorPlaceHolders respond to
204202
/// getSourceRange with the starting point. But we might be asked to lookup an
205203
/// identifer within one of them. So, find the real source range of them here.
206-
///
207-
/// FIXME: Alter how these are parsed so getSourceRange is enough.
204+
/// /// FIXME: Alter how these are parsed so getSourceRange is enough.
208205
SourceRange getEffectiveSourceRange(ASTNode) const;
209206

210207
void cacheSourceRangeOfMeAndDescendants(bool omitAssertions = false) const;
@@ -306,12 +303,6 @@ class ASTScopeImpl {
306303
virtual void beCurrent();
307304
virtual bool isCurrent() const;
308305

309-
/// Some scopes can be expanded lazily.
310-
/// Such scopes must: not change their source ranges after expansion, and
311-
/// their expansion must return an insertion point outside themselves.
312-
virtual NullablePtr<ASTScopeImpl> insertionPointForDeferredExpansion();
313-
virtual SourceRange sourceRangeForDeferredExpansion() const;
314-
315306
public:
316307
// Some nodes (VarDecls and Accessors) are created directly from
317308
// pattern scope code and should neither be deferred nor should
@@ -557,10 +548,6 @@ class Portion {
557548

558549
virtual void beCurrent(IterableTypeScope *) const;
559550
virtual bool isCurrent(const IterableTypeScope *) const;
560-
virtual NullablePtr<ASTScopeImpl>
561-
insertionPointForDeferredExpansion(IterableTypeScope *) const;
562-
virtual SourceRange
563-
sourceRangeForDeferredExpansion(const IterableTypeScope *) const;
564551
};
565552

566553
// For the whole Decl scope of a GenericType or an Extension
@@ -636,10 +623,6 @@ class IterableTypeBodyPortion final
636623

637624
void beCurrent(IterableTypeScope *) const override;
638625
bool isCurrent(const IterableTypeScope *) const override;
639-
NullablePtr<ASTScopeImpl>
640-
insertionPointForDeferredExpansion(IterableTypeScope *) const override;
641-
SourceRange
642-
sourceRangeForDeferredExpansion(const IterableTypeScope *) const override;
643626
};
644627

645628
/// GenericType or Extension scope
@@ -719,6 +702,7 @@ class IterableTypeScope : public GenericTypeScope {
719702
/// Because of \c parseDelayedDecl members can get added after the tree is
720703
/// constructed, and they can be out of order. Detect this happening by
721704
/// remembering the member count.
705+
/// TODO: unify with \c numberOfDeclsAlreadySeen
722706
unsigned memberCount = 0;
723707

724708
public:
@@ -737,8 +721,6 @@ class IterableTypeScope : public GenericTypeScope {
737721
public:
738722
void makeBodyCurrent();
739723
bool isBodyCurrent() const;
740-
NullablePtr<ASTScopeImpl> insertionPointForDeferredExpansion() override;
741-
SourceRange sourceRangeForDeferredExpansion() const override;
742724
};
743725

744726
class NominalTypeScope final : public IterableTypeScope {
@@ -976,7 +958,8 @@ class AbstractFunctionBodyScope : public ASTScopeImpl {
976958
Decl *getDecl() const { return decl; }
977959
static bool isAMethod(const AbstractFunctionDecl *);
978960

979-
NullablePtr<ASTScopeImpl> getParentOfRescuedScopes() override;
961+
std::vector<ASTScopeImpl *> rescueScopesToReuse() override;
962+
void addReusedScopes(ArrayRef<ASTScopeImpl *>) override;
980963

981964
protected:
982965
bool lookupLocalsOrMembers(ArrayRef<const ASTScopeImpl *>,
@@ -1139,6 +1122,7 @@ class PatternEntryDeclScope final : public AbstractPatternEntryScope {
11391122
SourceRange
11401123
getChildlessSourceRange(bool omitAssertions = false) const override;
11411124

1125+
static bool isHandledSpecially(const ASTNode n);
11421126
NullablePtr<const void> getReferrent() const override;
11431127

11441128
protected:
@@ -1388,7 +1372,8 @@ class TopLevelCodeScope final : public ASTScopeImpl {
13881372
Decl *getDecl() const { return decl; }
13891373
NullablePtr<const void> getReferrent() const override;
13901374

1391-
NullablePtr<ASTScopeImpl> getParentOfRescuedScopes() override;
1375+
std::vector<ASTScopeImpl *> rescueScopesToReuse() override;
1376+
void addReusedScopes(ArrayRef<ASTScopeImpl *>) override;
13921377
};
13931378

13941379
/// The \c _@specialize attribute.

branches/tensorflow/include/swift/AST/ClangModuleLoader.h

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define SWIFT_AST_CLANG_MODULE_LOADER_H
1515

1616
#include "swift/AST/ModuleLoader.h"
17+
#include "swift/Demangling/Demangle.h"
1718

1819
namespace clang {
1920
class ASTContext;
@@ -27,24 +28,11 @@ namespace swift {
2728
class DeclContext;
2829
class VisibleDeclConsumer;
2930

30-
/// Represents the different namespaces for types in C.
31-
///
32-
/// A simplified version of clang::Sema::LookupKind.
33-
enum class ClangTypeKind {
34-
Typedef,
35-
ObjCClass = Typedef,
36-
/// Structs, enums, and unions.
37-
Tag,
38-
ObjCProtocol,
39-
};
40-
4131
class ClangModuleLoader : public ModuleLoader {
4232
private:
4333
virtual void anchor();
44-
4534
protected:
4635
using ModuleLoader::ModuleLoader;
47-
4836
public:
4937
virtual clang::ASTContext &getClangASTContext() const = 0;
5038
virtual clang::Preprocessor &getClangPreprocessor() const = 0;
@@ -68,23 +56,22 @@ class ClangModuleLoader : public ModuleLoader {
6856
///
6957
/// This routine is used for various hacks that are only permitted within
7058
/// overlays of imported modules, e.g., Objective-C bridging conformances.
71-
virtual bool
72-
isInOverlayModuleForImportedModule(const DeclContext *overlayDC,
73-
const DeclContext *importedDC) = 0;
59+
virtual bool isInOverlayModuleForImportedModule(
60+
const DeclContext *overlayDC,
61+
const DeclContext *importedDC) = 0;
7462

7563
/// Look for declarations associated with the given name.
7664
///
7765
/// \param name The name we're searching for.
78-
virtual void lookupValue(DeclName name, VisibleDeclConsumer &consumer) = 0;
66+
virtual void lookupValue(DeclName name, VisibleDeclConsumer &consumer) {}
7967

8068
/// Look up a type declaration by its Clang name.
8169
///
8270
/// Note that this method does no filtering. If it finds the type in a loaded
8371
/// module, it returns it. This is intended for use in reflection / debugging
8472
/// contexts where access is not a problem.
85-
virtual void
86-
lookupTypeDecl(StringRef clangName, ClangTypeKind kind,
87-
llvm::function_ref<void(TypeDecl *)> receiver) = 0;
73+
virtual void lookupTypeDecl(StringRef clangName, Demangle::Node::Kind kind,
74+
llvm::function_ref<void(TypeDecl *)> receiver) {}
8875

8976
/// Look up type a declaration synthesized by the Clang importer itself, using
9077
/// a "related entity kind" to determine which type it should be. For example,
@@ -95,11 +82,11 @@ class ClangModuleLoader : public ModuleLoader {
9582
/// module, it returns it. This is intended for use in reflection / debugging
9683
/// contexts where access is not a problem.
9784
virtual void
98-
lookupRelatedEntity(StringRef clangName, ClangTypeKind kind,
99-
StringRef relatedEntityKind,
100-
llvm::function_ref<void(TypeDecl *)> receiver) = 0;
85+
lookupRelatedEntity(StringRef clangName, StringRef relatedEntityKind,
86+
llvm::function_ref<void(TypeDecl *)> receiver) {}
10187
};
10288

10389
} // namespace swift
10490

10591
#endif // LLVM_SWIFT_AST_CLANG_MODULE_LOADER_H
92+

branches/tensorflow/include/swift/AST/Decl.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,17 +1523,6 @@ class GenericContext : private _GenericContext, public DeclContext {
15231523

15241524
/// Determine whether this context has generic parameters
15251525
/// of its own.
1526-
///
1527-
/// \code
1528-
/// class C<T> {
1529-
/// func f1() {} // isGeneric == false
1530-
/// func f2<T>() {} // isGeneric == true
1531-
/// }
1532-
///
1533-
/// protocol P { // isGeneric == true due to implicit Self param
1534-
/// func p() // isGeneric == false
1535-
/// }
1536-
/// \endcode
15371526
bool isGeneric() const { return GenericParams != nullptr; }
15381527

15391528
/// Retrieve the trailing where clause for this extension, if any.

branches/tensorflow/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/tensorflow/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/tensorflow/include/swift/AST/Expr.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5321,33 +5321,6 @@ class KeyPathDotExpr : public Expr {
53215321
}
53225322
};
53235323

5324-
/// Expression node that effects a "one-way" constraint in
5325-
/// the constraint system, allowing type information to flow from the
5326-
/// subexpression outward but not the other way.
5327-
///
5328-
/// One-way expressions are generally implicit and synthetic, introduced by
5329-
/// the type checker. However, there is a built-in expression of the
5330-
/// form \c Builtin.one_way(x) that forms a one-way constraint coming out
5331-
/// of expression `x` that can be used for testing purposes.
5332-
class OneWayExpr : public Expr {
5333-
Expr *SubExpr;
5334-
5335-
public:
5336-
/// Construct an implicit one-way expression from the given subexpression.
5337-
OneWayExpr(Expr *subExpr)
5338-
: Expr(ExprKind::OneWay, /*isImplicit=*/true), SubExpr(subExpr) { }
5339-
5340-
SourceLoc getLoc() const { return SubExpr->getLoc(); }
5341-
SourceRange getSourceRange() const { return SubExpr->getSourceRange(); }
5342-
5343-
Expr *getSubExpr() const { return SubExpr; }
5344-
void setSubExpr(Expr *subExpr) { SubExpr = subExpr; }
5345-
5346-
static bool classof(const Expr *E) {
5347-
return E->getKind() == ExprKind::OneWay;
5348-
}
5349-
};
5350-
53515324
inline bool Expr::isInfixOperator() const {
53525325
return isa<BinaryExpr>(this) || isa<IfExpr>(this) ||
53535326
isa<AssignExpr>(this) || isa<ExplicitCastExpr>(this);

branches/tensorflow/include/swift/AST/ExprNodes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ EXPR(EditorPlaceholder, Expr)
191191
EXPR(ObjCSelector, Expr)
192192
EXPR(KeyPath, Expr)
193193
UNCHECKED_EXPR(KeyPathDot, Expr)
194-
UNCHECKED_EXPR(OneWay, Expr)
195194
EXPR(Tap, Expr)
196195
LAST_EXPR(Tap)
197196

0 commit comments

Comments
 (0)