Skip to content

Commit 967e77e

Browse files
committed
---
yaml --- r: 292347 b: refs/heads/tensorflow c: 1a38073 h: refs/heads/master i: 292345: 0f750fc 292343: e964fb1
1 parent 12cd886 commit 967e77e

File tree

59 files changed

+302
-783
lines changed

Some content is hidden

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

59 files changed

+302
-783
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: 07a29d5ff712180e23dcf042558d2673b7d40fe3
819+
refs/heads/tensorflow: 1a38073c6e384c93d618c0e438e2c8666a27082d
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/docs/WindowsBuild.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cmake -G Ninja^
125125
-DLLVM_ENABLE_ASSERTIONS=ON^
126126
-DLLVM_ENABLE_PDB=YES^
127127
-DLLVM_ENABLE_PROJECTS=clang^
128-
-DLLVM_TARGETS_TO_BUILD="AArch64;ARM;X86"^
128+
-DLLVM_TARGETS_TO_BUILD=X86^
129129
S:/llvm
130130
popd
131131
cmake --build "S:\b\llvm"
@@ -208,7 +208,7 @@ cmake -G Ninja^
208208
-DLLDB_PATH_TO_LLVM_BUILD="S:\b\llvm"^
209209
-DLLDB_PATH_TO_SWIFT_BUILD="S:\b\swift"^
210210
-DLLVM_ENABLE_ASSERTIONS=ON^
211-
-DPYTHON_HOME="%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64"^
211+
-DPYTHON_HOME=%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64^
212212
S:\lldb
213213
popd
214214
cmake --build S:\b\lldb

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

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,7 +4715,7 @@ class VarDecl : public AbstractStorageDecl {
47154715
/// Set \p v to be the pattern produced VarDecl that is the parent of this
47164716
/// var decl.
47174717
void setParentVarDecl(VarDecl *v) {
4718-
assert(v && v != this);
4718+
assert(v);
47194719
Parent = v;
47204720
}
47214721

@@ -4906,7 +4906,7 @@ class ParamDecl : public VarDecl {
49064906
SourceLoc SpecifierLoc;
49074907

49084908
struct StoredDefaultArgument {
4909-
PointerUnion<Expr *, VarDecl *> DefaultArg;
4909+
Expr *DefaultArg = nullptr;
49104910
Initializer *InitContext = nullptr;
49114911
StringRef StringRepresentation;
49124912
};
@@ -4963,20 +4963,12 @@ class ParamDecl : public VarDecl {
49634963

49644964
Expr *getDefaultValue() const {
49654965
if (auto stored = DefaultValueAndFlags.getPointer())
4966-
return stored->DefaultArg.dyn_cast<Expr *>();
4967-
return nullptr;
4968-
}
4969-
4970-
VarDecl *getStoredProperty() const {
4971-
if (auto stored = DefaultValueAndFlags.getPointer())
4972-
return stored->DefaultArg.dyn_cast<VarDecl *>();
4966+
return stored->DefaultArg;
49734967
return nullptr;
49744968
}
49754969

49764970
void setDefaultValue(Expr *E);
49774971

4978-
void setStoredProperty(VarDecl *var);
4979-
49804972
Initializer *getDefaultArgumentInitContext() const {
49814973
if (auto stored = DefaultValueAndFlags.getPointer())
49824974
return stored->InitContext;
@@ -5569,14 +5561,12 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
55695561

55705562
class OperatorDecl;
55715563

5564+
/// Note: These align with '%select's in diagnostics.
55725565
enum class SelfAccessKind : uint8_t {
5573-
NonMutating,
5574-
Mutating,
5575-
__Consuming,
5566+
NonMutating = 0,
5567+
Mutating = 1,
5568+
__Consuming = 2,
55765569
};
5577-
5578-
/// Diagnostic printing of \c SelfAccessKind.
5579-
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, SelfAccessKind SAK);
55805570

55815571
/// FuncDecl - 'func' declaration.
55825572
class FuncDecl : public AbstractFunctionDecl {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ enum class DefaultArgumentKind : uint8_t {
5252
EmptyArray,
5353
/// An empty dictionary literal.
5454
EmptyDictionary,
55-
/// A reference to the stored property. This is a special default argument
56-
/// kind for the synthesized memberwise constructor to emit a call to the
57-
// property's initializer.
58-
StoredProperty,
5955
};
6056
enum { NumDefaultArgumentKindBits = 4 };
6157

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ namespace swift {
3030
class ValueDecl;
3131

3232
enum class PatternKind : uint8_t;
33-
enum class SelfAccessKind : uint8_t;
3433
enum class ReferenceOwnership : uint8_t;
3534
enum class StaticSpellingKind : uint8_t;
3635
enum class DescriptiveDeclKind : uint8_t;
@@ -78,7 +77,6 @@ namespace swift {
7877
Type,
7978
TypeRepr,
8079
PatternKind,
81-
SelfAccessKind,
8280
ReferenceOwnership,
8381
StaticSpellingKind,
8482
DescriptiveDeclKind,
@@ -107,7 +105,6 @@ namespace swift {
107105
Type TypeVal;
108106
TypeRepr *TyR;
109107
PatternKind PatternKindVal;
110-
SelfAccessKind SelfAccessKindVal;
111108
ReferenceOwnership ReferenceOwnershipVal;
112109
StaticSpellingKind StaticSpellingKindVal;
113110
DescriptiveDeclKind DescriptiveDeclKindVal;
@@ -172,10 +169,6 @@ namespace swift {
172169
: Kind(DiagnosticArgumentKind::ReferenceOwnership),
173170
ReferenceOwnershipVal(RO) {}
174171

175-
DiagnosticArgument(SelfAccessKind SAK)
176-
: Kind(DiagnosticArgumentKind::SelfAccessKind),
177-
SelfAccessKindVal(SAK) {}
178-
179172
DiagnosticArgument(StaticSpellingKind SSK)
180173
: Kind(DiagnosticArgumentKind::StaticSpellingKind),
181174
StaticSpellingKindVal(SSK) {}
@@ -256,11 +249,6 @@ namespace swift {
256249
return ReferenceOwnershipVal;
257250
}
258251

259-
SelfAccessKind getAsSelfAccessKind() const {
260-
assert(Kind == DiagnosticArgumentKind::SelfAccessKind);
261-
return SelfAccessKindVal;
262-
}
263-
264252
StaticSpellingKind getAsStaticSpellingKind() const {
265253
assert(Kind == DiagnosticArgumentKind::StaticSpellingKind);
266254
return StaticSpellingKindVal;

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,20 +1108,24 @@ ERROR(attribute_requires_operator_identifier,none,
11081108
ERROR(attribute_requires_single_argument,none,
11091109
"'%0' requires a function with one argument", (StringRef))
11101110

1111-
ERROR(mutating_invalid_global_scope,none, "%0 is only valid on methods",
1112-
(SelfAccessKind))
1113-
ERROR(mutating_invalid_classes,none, "%0 isn't valid on methods in "
1114-
"classes or class-bound protocols", (SelfAccessKind))
1111+
ERROR(mutating_invalid_global_scope,none,
1112+
"'%select{nonmutating|mutating|__consuming}0' is only valid on methods",
1113+
(unsigned))
1114+
ERROR(mutating_invalid_classes,none,
1115+
"'%select{nonmutating|mutating|__consuming}0' isn't valid on methods in "
1116+
"classes or class-bound protocols", (bool))
11151117

11161118
ERROR(functions_mutating_and_not,none,
1117-
"method must not be declared both %0 and %1",
1118-
(SelfAccessKind, SelfAccessKind))
1119+
"method must not be declared both "
1120+
"%select{nonmutating|mutating|__consuming}0 and "
1121+
"%select{nonmutating|mutating|__consuming}1",
1122+
(unsigned, unsigned))
11191123
ERROR(static_functions_not_mutating,none,
11201124
"static functions must not be declared mutating", ())
11211125

11221126
ERROR(modify_mutatingness_differs_from_setter,none,
1123-
"'modify' accessor cannot be %0 when the setter is %1",
1124-
(SelfAccessKind, SelfAccessKind))
1127+
"'modify' accessor cannot be %select{nonmutating|mutating}0 "
1128+
"when the setter is %select{mutating|nonmutating}0", (bool))
11251129

11261130
ERROR(transparent_in_protocols_not_supported,none,
11271131
"'@_transparent' attribute is not supported on declarations within protocols", ())
@@ -1869,8 +1873,8 @@ NOTE(protocol_witness_prefix_postfix_conflict,none,
18691873
"candidate is %select{|prefix, |postfix, }1not "
18701874
"%select{prefix|postfix}0 as required", (bool, unsigned))
18711875
NOTE(protocol_witness_mutation_modifier_conflict,none,
1872-
"candidate is marked %0 but protocol does not allow it",
1873-
(SelfAccessKind))
1876+
"candidate is marked '%select{nonmutating|mutating|__consuming}0' but "
1877+
"protocol does not allow it", (unsigned))
18741878
NOTE(protocol_witness_settable_conflict,none,
18751879
"candidate is not settable, but protocol requires it", ())
18761880
NOTE(protocol_witness_rethrows_conflict,none,

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

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
#ifndef SWIFT_AST_STMT_H
1818
#define SWIFT_AST_STMT_H
1919

20-
#include "swift/AST/ASTNode.h"
2120
#include "swift/AST/Availability.h"
2221
#include "swift/AST/AvailabilitySpec.h"
22+
#include "swift/AST/ASTNode.h"
2323
#include "swift/AST/IfConfigClause.h"
2424
#include "swift/AST/TypeAlignments.h"
2525
#include "swift/Basic/NullablePtr.h"
26-
#include "llvm/ADT/TinyPtrVector.h"
2726
#include "llvm/Support/TrailingObjects.h"
2827

2928
namespace swift {
@@ -985,22 +984,24 @@ class CaseStmt final
985984
SourceLoc CaseLoc;
986985
SourceLoc ColonLoc;
987986

988-
llvm::PointerIntPair<Stmt *, 1, bool> BodyAndHasFallthrough;
987+
llvm::PointerIntPair<Stmt *, 1, bool> BodyAndHasBoundDecls;
989988

990-
Optional<MutableArrayRef<VarDecl *>> CaseBodyVariables;
989+
/// Set to true if we have a fallthrough.
990+
///
991+
/// TODO: Once we have CaseBodyVarDecls, use the bit in BodyAndHasBoundDecls
992+
/// for this instead. This is separate now for staging reasons.
993+
bool hasFallthrough;
991994

992995
CaseStmt(SourceLoc CaseLoc, ArrayRef<CaseLabelItem> CaseLabelItems,
993-
SourceLoc UnknownAttrLoc, SourceLoc ColonLoc, Stmt *Body,
994-
Optional<MutableArrayRef<VarDecl *>> CaseBodyVariables,
995-
Optional<bool> Implicit,
996+
bool HasBoundDecls, SourceLoc UnknownAttrLoc, SourceLoc ColonLoc,
997+
Stmt *Body, Optional<bool> Implicit,
996998
NullablePtr<FallthroughStmt> fallthroughStmt);
997999

9981000
public:
9991001
static CaseStmt *
10001002
create(ASTContext &C, SourceLoc CaseLoc,
1001-
ArrayRef<CaseLabelItem> CaseLabelItems, SourceLoc UnknownAttrLoc,
1002-
SourceLoc ColonLoc, Stmt *Body,
1003-
Optional<MutableArrayRef<VarDecl *>> CaseBodyVariables,
1003+
ArrayRef<CaseLabelItem> CaseLabelItems, bool HasBoundDecls,
1004+
SourceLoc UnknownAttrLoc, SourceLoc ColonLoc, Stmt *Body,
10041005
Optional<bool> Implicit = None,
10051006
NullablePtr<FallthroughStmt> fallthroughStmt = nullptr);
10061007

@@ -1019,18 +1020,18 @@ class CaseStmt final
10191020
}
10201021

10211022
NullablePtr<CaseStmt> getFallthroughDest() {
1022-
if (!hasFallthroughDest())
1023+
if (!hasFallthrough)
10231024
return nullptr;
10241025
return (*getTrailingObjects<FallthroughStmt *>())->getFallthroughDest();
10251026
}
10261027

1027-
bool hasFallthroughDest() const { return BodyAndHasFallthrough.getInt(); }
1028+
bool hasFallthroughDest() const { return hasFallthrough; }
10281029

1029-
Stmt *getBody() const { return BodyAndHasFallthrough.getPointer(); }
1030-
void setBody(Stmt *body) { BodyAndHasFallthrough.setPointer(body); }
1030+
Stmt *getBody() const { return BodyAndHasBoundDecls.getPointer(); }
1031+
void setBody(Stmt *body) { BodyAndHasBoundDecls.setPointer(body); }
10311032

10321033
/// True if the case block declares any patterns with local variable bindings.
1033-
bool hasBoundDecls() const { return CaseBodyVariables.hasValue(); }
1034+
bool hasBoundDecls() const { return BodyAndHasBoundDecls.getInt(); }
10341035

10351036
/// Get the source location of the 'case' or 'default' of the first label.
10361037
SourceLoc getLoc() const { return CaseLoc; }
@@ -1055,38 +1056,14 @@ class CaseStmt final
10551056
return UnknownAttrLoc.isValid();
10561057
}
10571058

1058-
Optional<ArrayRef<VarDecl *>> getCaseBodyVariables() const {
1059-
if (!CaseBodyVariables)
1060-
return None;
1061-
ArrayRef<VarDecl *> a = *CaseBodyVariables;
1062-
return a;
1063-
}
1064-
1065-
Optional<MutableArrayRef<VarDecl *>> getCaseBodyVariables() {
1066-
return CaseBodyVariables;
1067-
}
1068-
1069-
ArrayRef<VarDecl *> getCaseBodyVariablesOrEmptyArray() const {
1070-
if (!CaseBodyVariables)
1071-
return ArrayRef<VarDecl *>();
1072-
ArrayRef<VarDecl *> a = *CaseBodyVariables;
1073-
return a;
1074-
}
1075-
1076-
MutableArrayRef<VarDecl *> getCaseBodyVariablesOrEmptyArray() {
1077-
if (!CaseBodyVariables)
1078-
return MutableArrayRef<VarDecl *>();
1079-
return *CaseBodyVariables;
1080-
}
1081-
10821059
static bool classof(const Stmt *S) { return S->getKind() == StmtKind::Case; }
10831060

10841061
size_t numTrailingObjects(OverloadToken<CaseLabelItem>) const {
10851062
return getNumCaseLabelItems();
10861063
}
10871064

10881065
size_t numTrailingObjects(OverloadToken<FallthroughStmt *>) const {
1089-
return hasFallthroughDest() ? 1 : 0;
1066+
return hasFallthrough ? 1 : 0;
10901067
}
10911068
};
10921069

branches/tensorflow/include/swift/SIL/SILInstruction.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,17 +4186,9 @@ class ConvertEscapeToNoEscapeInst final
41864186
SILFunction &F, SILOpenedArchetypesState &OpenedArchetypes,
41874187
bool lifetimeGuaranteed);
41884188
public:
4189-
/// Return true if we have extended the lifetime of the argument of the
4190-
/// convert_escape_to_no_escape to be over all uses of the trivial type.
41914189
bool isLifetimeGuaranteed() const {
41924190
return lifetimeGuaranteed;
41934191
}
4194-
4195-
/// Mark that we have extended the lifetime of the argument of the
4196-
/// convert_escape_to_no_escape to be over all uses of the trivial type.
4197-
///
4198-
/// NOTE: This is a one way operation.
4199-
void setLifetimeGuaranteed() { lifetimeGuaranteed = true; }
42004192
};
42014193

42024194
/// ThinFunctionToPointerInst - Convert a thin function pointer to a

branches/tensorflow/include/swift/Serialization/ModuleFormat.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5252
/// describe what change you made. The content of this comment isn't important;
5353
/// it just ensures a conflict if two people change the module format.
5454
/// Don't worry about adhering to the 80-column limit for this line.
55-
const uint16_t SWIFTMODULE_VERSION_MINOR = 479; // stored property default arg
55+
const uint16_t SWIFTMODULE_VERSION_MINOR = 477; // SILUndef serialized with ownership kind
5656

5757
using DeclIDField = BCFixed<31>;
5858

@@ -379,7 +379,6 @@ enum class DefaultArgumentKind : uint8_t {
379379
NilLiteral,
380380
EmptyArray,
381381
EmptyDictionary,
382-
StoredProperty,
383382
};
384383
using DefaultArgumentField = BCFixed<4>;
385384

branches/tensorflow/lib/AST/ASTDumper.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ static StringRef getDefaultArgumentKindString(DefaultArgumentKind value) {
305305
case DefaultArgumentKind::EmptyArray: return "[]";
306306
case DefaultArgumentKind::EmptyDictionary: return "[:]";
307307
case DefaultArgumentKind::Normal: return "normal";
308-
case DefaultArgumentKind::StoredProperty: return "stored property";
309308
}
310309

311310
llvm_unreachable("Unhandled DefaultArgumentKind in switch.");
@@ -1620,24 +1619,6 @@ class PrintStmt : public StmtVisitor<PrintStmt> {
16201619
printCommon(S, "case_stmt");
16211620
if (S->hasUnknownAttr())
16221621
OS << " @unknown";
1623-
1624-
if (auto caseBodyVars = S->getCaseBodyVariables()) {
1625-
OS << '\n';
1626-
OS.indent(Indent + 2);
1627-
PrintWithColorRAII(OS, ParenthesisColor) << '(';
1628-
PrintWithColorRAII(OS, StmtColor) << "case_body_variables";
1629-
OS << '\n';
1630-
for (auto *vd : *caseBodyVars) {
1631-
OS.indent(2);
1632-
// TODO: Printing a var decl does an Indent ... dump(vd) ... '\n'. We
1633-
// should see if we can factor this dumping so that the caller of
1634-
// printRec(VarDecl) has more control over the printing.
1635-
printRec(vd);
1636-
}
1637-
OS.indent(Indent + 2);
1638-
PrintWithColorRAII(OS, ParenthesisColor) << ')';
1639-
}
1640-
16411622
for (const auto &LabelItem : S->getCaseLabelItems()) {
16421623
OS << '\n';
16431624
OS.indent(Indent + 2);

0 commit comments

Comments
 (0)