Skip to content

Commit 08d38cb

Browse files
committed
---
yaml --- r: 326559 b: refs/heads/tensorflow c: aa212d5 h: refs/heads/master i: 326557: f432eac 326555: 350f79e 326551: ec44276 326543: 6b1f30f 326527: e67cc5e
1 parent d59b033 commit 08d38cb

File tree

84 files changed

+1189
-1735
lines changed

Some content is hidden

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

84 files changed

+1189
-1735
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: c3b98ef63ed2ba9de96a3b5631dfbfa06a170689
819+
refs/heads/tensorflow: aa212d54ef6cca5006a12ebeafda3e8fb2f98143
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/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: 30 additions & 16 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,11 +56,37 @@ 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;
62+
63+
/// Look for declarations associated with the given name.
64+
///
65+
/// \param name The name we're searching for.
66+
virtual void lookupValue(DeclName name, VisibleDeclConsumer &consumer) {}
67+
68+
/// Look up a type declaration by its Clang name.
69+
///
70+
/// Note that this method does no filtering. If it finds the type in a loaded
71+
/// module, it returns it. This is intended for use in reflection / debugging
72+
/// contexts where access is not a problem.
73+
virtual void lookupTypeDecl(StringRef clangName, Demangle::Node::Kind kind,
74+
llvm::function_ref<void(TypeDecl *)> receiver) {}
75+
76+
/// Look up type a declaration synthesized by the Clang importer itself, using
77+
/// a "related entity kind" to determine which type it should be. For example,
78+
/// this can be used to find the synthesized error struct for an
79+
/// NS_ERROR_ENUM.
80+
///
81+
/// Note that this method does no filtering. If it finds the type in a loaded
82+
/// module, it returns it. This is intended for use in reflection / debugging
83+
/// contexts where access is not a problem.
84+
virtual void
85+
lookupRelatedEntity(StringRef clangName, StringRef relatedEntityKind,
86+
llvm::function_ref<void(TypeDecl *)> receiver) {}
7487
};
7588

7689
} // namespace swift
7790

7891
#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/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

branches/tensorflow/include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ namespace swift {
115115
/// Only used by lldb-moduleimport-test.
116116
bool EnableMemoryBufferImporter = false;
117117

118+
/// Enable the DWARFImporter. Only used by lldb-moduleimport-test.
119+
bool EnableDWARFImporter = false;
120+
118121
/// Allows using identifiers with a leading dollar.
119122
bool EnableDollarIdentifiers = false;
120123

@@ -212,9 +215,6 @@ namespace swift {
212215
/// before termination of the shrink phrase of the constraint solver.
213216
unsigned SolverShrinkUnsolvedThreshold = 10;
214217

215-
/// Enable one-way constraints in function builders.
216-
bool FunctionBuilderOneWayConstraints = false;
217-
218218
/// Disable the shrink phase of the expression type checker.
219219
bool SolverDisableShrink = false;
220220

@@ -268,9 +268,6 @@ namespace swift {
268268
/// whether it is. The warning is useful for testing.
269269
bool WarnIfASTScopeLookup = false;
270270

271-
/// Build the ASTScope tree lazily
272-
bool LazyASTScopes = false;
273-
274271
/// Whether to use the import as member inference system
275272
///
276273
/// When importing a global, try to infer whether we can import it as a

0 commit comments

Comments
 (0)