Skip to content

Commit adfc67a

Browse files
authored
---
yaml --- r: 262007 b: refs/heads/tensorflow c: 694b153 h: refs/heads/master i: 262005: e71cd0c 262003: 89ba5d0 261999: cfba09c
1 parent 5f32706 commit adfc67a

File tree

189 files changed

+2626
-962
lines changed

Some content is hidden

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

189 files changed

+2626
-962
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
818818
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
819819
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
820820
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
821-
refs/heads/tensorflow: ef76bcf7cfa3d9f0199bf35942df8116ce6c4e08
821+
refs/heads/tensorflow: 694b153992b2cc2f8aaaa7a13134419a03812694
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
823823
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
824824
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,18 @@ script is used by swift.org's CI to produce snapshots and can allow for one to
219219
locally reproduce such builds for development or distribution purposes. E.x.:
220220

221221
```
222-
$ ./utils/build-toolchain $TOOLCHAIN_PREFIX
222+
$ ./utils/build-toolchain $BUNDLE_PREFIX
223223
```
224224

225-
where ``$TOOLCHAIN_PREFIX`` is a string that will be prepended to the swift
226-
package name in the produced tar ball. For instance, if ``$TOOLCHAIN_PREFIX``
227-
was ``macOS``, the produced archive will have the name
228-
``swift-macOS.tar.gz``.
225+
where ``$BUNDLE_PREFIX`` is a string that will be prepended to the build
226+
date to give the bundle identifier of the toolchain's ``Info.plist``. For
227+
instance, if ``$BUNDLE_PREFIX`` was ``com.example``, the toolchain
228+
produced will have the bundle identifier ``com.example.YYYYMMDD``. It
229+
will be created in the directory you run the script with a filename
230+
of the form: ``swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz``.
229231

230-
Beyond building the toolchain, ``build-toolchain`` also supports the following
231-
(non-exhaustive) set of useful options::
232+
Beyond building the toolchain, ``build-toolchain`` also supports the
233+
following (non-exhaustive) set of useful options::
232234

233235
- ``--dry-run``: Perform a dry run build. This is off by default.
234236
- ``--test``: Test the toolchain after it has been compiled. This is off by default.
@@ -246,8 +248,17 @@ On macOS if one wants to install such a toolchain into Xcode:
246248
`~/Library/Developer/Toolchains/`. E.x.:
247249

248250
```
249-
$ tar -xzf swift-macOS.tar.gz -C /
250-
$ tar -xzf swift-macOS.tar.gz -C ~/
251+
$ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C /
252+
$ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C ~/
253+
```
254+
255+
The script also generates an archive containing debug symbols which
256+
can be installed over the main archive allowing symbolication of any
257+
compiler crashes.
258+
259+
```
260+
$ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C /
261+
$ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C ~/
251262
```
252263

253264
2. Specify the local toolchain for Xcode's use via `Xcode->Toolchains`.

branches/tensorflow/docs/ABI/Mangling.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ The following symbolic reference kinds are currently implemented:
9090
dependent-associated-conformance ::= '\x05' .{4} // Reference points directly to associated conformance descriptor (NOT IMPLEMENTED)
9191
dependent-associated-conformance ::= '\x06' .{4} // Reference points indirectly to associated conformance descriptor (NOT IMPLEMENTED)
9292

93-
associated-conformance-acceess-function ::= '\x07' .{4} // Reference points directly to associated conformance access function relative to the protocol
94-
associated-conformance-acceess-function ::= '\x08' .{4} // Reference points directly to associated conformance access function relative to the conforming type
95-
keypath-metadata-access-function ::= '\x09' {.4} // Reference points directly to keypath type metadata access function
93+
associated-conformance-access-function ::= '\x07' .{4} // Reference points directly to associated conformance access function relative to the protocol
94+
associated-conformance-access-function ::= '\x08' .{4} // Reference points directly to associated conformance access function relative to the conforming type
95+
keypath-metadata-access-function ::= '\x09' {.4} // Reference points directly to keypath conformance access function
9696

9797
Globals
9898
~~~~~~~

branches/tensorflow/include/swift/ABI/Metadata.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2611,6 +2611,57 @@ class TargetGenericRequirementDescriptor {
26112611
using GenericRequirementDescriptor =
26122612
TargetGenericRequirementDescriptor<InProcess>;
26132613

2614+
template<typename Runtime>
2615+
class TargetGenericEnvironment
2616+
: public swift::ABI::TrailingObjects<TargetGenericEnvironment<Runtime>,
2617+
uint16_t, GenericParamDescriptor,
2618+
TargetGenericRequirementDescriptor<Runtime>> {
2619+
using GenericRequirementDescriptor =
2620+
TargetGenericRequirementDescriptor<Runtime>;
2621+
using TrailingObjects =
2622+
swift::ABI::TrailingObjects<TargetGenericEnvironment<Runtime>,
2623+
uint16_t, GenericParamDescriptor, GenericRequirementDescriptor>;
2624+
friend TrailingObjects;
2625+
2626+
template<typename T>
2627+
using OverloadToken = typename TrailingObjects::template OverloadToken<T>;
2628+
2629+
size_t numTrailingObjects(OverloadToken<uint16_t>) const {
2630+
return Flags.getNumGenericParameterLevels();
2631+
}
2632+
2633+
size_t numTrailingObjects(OverloadToken<GenericParamDescriptor>) const {
2634+
return getGenericParameterCounts().back();
2635+
}
2636+
2637+
size_t numTrailingObjects(OverloadToken<GenericRequirementDescriptor>) const {
2638+
return Flags.getNumGenericRequirements();
2639+
}
2640+
2641+
GenericEnvironmentFlags Flags;
2642+
2643+
public:
2644+
/// Retrieve the cumulative generic parameter counts at each level of genericity.
2645+
ArrayRef<uint16_t> getGenericParameterCounts() const {
2646+
return ArrayRef<uint16_t>(this->template getTrailingObjects<uint16_t>(),
2647+
Flags.getNumGenericParameterLevels());
2648+
}
2649+
2650+
/// Retrieve the generic parameters descriptors.
2651+
ArrayRef<GenericParamDescriptor> getGenericParameters() const {
2652+
return ArrayRef<GenericParamDescriptor>(
2653+
this->template getTrailingObjects<GenericParamDescriptor>(),
2654+
getGenericParameterCounts().back());
2655+
}
2656+
2657+
/// Retrieve the generic requirements.
2658+
ArrayRef<GenericRequirementDescriptor> getGenericRequirements() const {
2659+
return ArrayRef<GenericRequirementDescriptor>(
2660+
this->template getTrailingObjects<GenericRequirementDescriptor>(),
2661+
Flags.getNumGenericRequirements());
2662+
}
2663+
};
2664+
26142665
/// CRTP class for a context descriptor that includes trailing generic
26152666
/// context description.
26162667
template<class Self,

branches/tensorflow/include/swift/ABI/MetadataValues.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,45 @@ enum class GenericRequirementLayoutKind : uint32_t {
15081508
Class = 0,
15091509
};
15101510

1511+
class GenericEnvironmentFlags {
1512+
uint32_t Value;
1513+
1514+
enum : uint32_t {
1515+
NumGenericParameterLevelsMask = 0xFFF,
1516+
NumGenericRequirementsShift = 12,
1517+
NumGenericRequirementsMask = 0xFFFF << NumGenericRequirementsShift,
1518+
};
1519+
1520+
constexpr explicit GenericEnvironmentFlags(uint32_t value) : Value(value) { }
1521+
1522+
public:
1523+
constexpr GenericEnvironmentFlags() : Value(0) { }
1524+
1525+
constexpr GenericEnvironmentFlags
1526+
withNumGenericParameterLevels(uint16_t numGenericParameterLevels) const {
1527+
return GenericEnvironmentFlags((Value &~ NumGenericParameterLevelsMask)
1528+
| numGenericParameterLevels);
1529+
}
1530+
1531+
constexpr GenericEnvironmentFlags
1532+
withNumGenericRequirements(uint16_t numGenericRequirements) const {
1533+
return GenericEnvironmentFlags((Value &~ NumGenericRequirementsMask)
1534+
| (numGenericRequirements << NumGenericRequirementsShift));
1535+
}
1536+
1537+
constexpr unsigned getNumGenericParameterLevels() const {
1538+
return Value & NumGenericParameterLevelsMask;
1539+
}
1540+
1541+
constexpr unsigned getNumGenericRequirements() const {
1542+
return (Value & NumGenericRequirementsMask) >> NumGenericRequirementsShift;
1543+
}
1544+
1545+
constexpr uint32_t getIntValue() const {
1546+
return Value;
1547+
}
1548+
};
1549+
15111550
/// Flags used by generic metadata patterns.
15121551
class GenericMetadataPatternFlags : public FlagSet<uint32_t> {
15131552
enum {

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,19 @@ class ASTMangler : public Mangler {
137137
std::string mangleKeyPathGetterThunkHelper(const AbstractStorageDecl *property,
138138
GenericSignature *signature,
139139
CanType baseType,
140-
ArrayRef<CanType> subs);
140+
SubstitutionMap subs,
141+
ResilienceExpansion expansion);
141142
std::string mangleKeyPathSetterThunkHelper(const AbstractStorageDecl *property,
142143
GenericSignature *signature,
143144
CanType baseType,
144-
ArrayRef<CanType> subs);
145+
SubstitutionMap subs,
146+
ResilienceExpansion expansion);
145147
std::string mangleKeyPathEqualsHelper(ArrayRef<CanType> indices,
146-
GenericSignature *signature);
148+
GenericSignature *signature,
149+
ResilienceExpansion expansion);
147150
std::string mangleKeyPathHashHelper(ArrayRef<CanType> indices,
148-
GenericSignature *signature);
151+
GenericSignature *signature,
152+
ResilienceExpansion expansion);
149153

150154
std::string mangleTypeForDebugger(Type decl, const DeclContext *DC);
151155

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

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class alignas(1 << DeclAlignInBits) Decl {
324324
IsUserAccessible : 1
325325
);
326326

327-
SWIFT_INLINE_BITFIELD(AbstractStorageDecl, ValueDecl, 1+1+1+1+2,
327+
SWIFT_INLINE_BITFIELD(AbstractStorageDecl, ValueDecl, 1+1+1+1+2+1+1,
328328
/// Whether the getter is mutating.
329329
IsGetterMutating : 1,
330330

@@ -338,7 +338,12 @@ class alignas(1 << DeclAlignInBits) Decl {
338338
SupportsMutation : 1,
339339

340340
/// Whether an opaque read of this storage produces an owned value.
341-
OpaqueReadOwnership : 2
341+
OpaqueReadOwnership : 2,
342+
343+
/// Whether a keypath component can directly reference this storage,
344+
/// or if it must use the overridden declaration instead.
345+
HasComputedValidKeyPathComponent : 1,
346+
ValidKeyPathComponent : 1
342347
);
343348

344349
SWIFT_INLINE_BITFIELD(VarDecl, AbstractStorageDecl, 1+4+1+1+1+1,
@@ -4263,6 +4268,8 @@ class AbstractStorageDecl : public ValueDecl {
42634268
Bits.AbstractStorageDecl.SupportsMutation = supportsMutation;
42644269
}
42654270

4271+
void computeIsValidKeyPathComponent();
4272+
42664273
public:
42674274

42684275
/// \brief Should this declaration be treated as if annotated with transparent
@@ -4503,7 +4510,8 @@ class AbstractStorageDecl : public ValueDecl {
45034510
/// Determine how this storage declaration should actually be accessed.
45044511
AccessStrategy getAccessStrategy(AccessSemantics semantics,
45054512
AccessKind accessKind,
4506-
DeclContext *accessFromDC = nullptr) const;
4513+
ModuleDecl *module,
4514+
ResilienceExpansion expansion) const;
45074515

45084516
/// \brief Should this declaration behave as if it must be accessed
45094517
/// resiliently, even when we're building a non-resilient module?
@@ -4541,7 +4549,20 @@ class AbstractStorageDecl : public ValueDecl {
45414549
BehaviorRecord *getMutableBehavior() {
45424550
return BehaviorInfo.getPointer();
45434551
}
4544-
4552+
4553+
void setIsValidKeyPathComponent(bool value) {
4554+
Bits.AbstractStorageDecl.HasComputedValidKeyPathComponent = true;
4555+
Bits.AbstractStorageDecl.ValidKeyPathComponent = value;
4556+
}
4557+
4558+
/// True if the storage can be referenced by a keypath directly.
4559+
/// Otherwise, its override must be referenced.
4560+
bool isValidKeyPathComponent() const {
4561+
if (!Bits.AbstractStorageDecl.HasComputedValidKeyPathComponent)
4562+
const_cast<AbstractStorageDecl *>(this)->computeIsValidKeyPathComponent();
4563+
return Bits.AbstractStorageDecl.ValidKeyPathComponent;
4564+
}
4565+
45454566
/// True if the storage exports a property descriptor for key paths in
45464567
/// other modules.
45474568
bool exportsPropertyDescriptor() const;
@@ -4854,11 +4875,17 @@ class ParamDecl : public VarDecl {
48544875
StringRef StringRepresentation;
48554876
};
48564877

4857-
/// The default value, if any, along with whether this is varargs.
4858-
llvm::PointerIntPair<StoredDefaultArgument *, 1> DefaultValueAndIsVariadic;
4878+
enum class Flags : uint8_t {
4879+
/// Whether or not this parameter is vargs.
4880+
IsVariadic = 1 << 0,
4881+
4882+
/// Whether or not this parameter is `@autoclosure`.
4883+
IsAutoClosure = 1 << 1,
4884+
};
48594885

4860-
/// `@autoclosure` flag associated with this parameter.
4861-
bool IsAutoClosure = false;
4886+
/// The default value, if any, along with flags.
4887+
llvm::PointerIntPair<StoredDefaultArgument *, 2, OptionSet<Flags>>
4888+
DefaultValueAndFlags;
48624889

48634890
public:
48644891
ParamDecl(VarDecl::Specifier specifier,
@@ -4899,15 +4926,15 @@ class ParamDecl : public VarDecl {
48994926
}
49004927

49014928
Expr *getDefaultValue() const {
4902-
if (auto stored = DefaultValueAndIsVariadic.getPointer())
4929+
if (auto stored = DefaultValueAndFlags.getPointer())
49034930
return stored->DefaultArg;
49044931
return nullptr;
49054932
}
49064933

49074934
void setDefaultValue(Expr *E);
49084935

49094936
Initializer *getDefaultArgumentInitContext() const {
4910-
if (auto stored = DefaultValueAndIsVariadic.getPointer())
4937+
if (auto stored = DefaultValueAndFlags.getPointer())
49114938
return stored->InitContext;
49124939
return nullptr;
49134940
}
@@ -4941,12 +4968,24 @@ class ParamDecl : public VarDecl {
49414968
void setDefaultValueStringRepresentation(StringRef stringRepresentation);
49424969

49434970
/// Whether or not this parameter is varargs.
4944-
bool isVariadic() const { return DefaultValueAndIsVariadic.getInt(); }
4945-
void setVariadic(bool value = true) {DefaultValueAndIsVariadic.setInt(value);}
4971+
bool isVariadic() const {
4972+
return DefaultValueAndFlags.getInt().contains(Flags::IsVariadic);
4973+
}
4974+
void setVariadic(bool value = true) {
4975+
auto flags = DefaultValueAndFlags.getInt();
4976+
DefaultValueAndFlags.setInt(value ? flags | Flags::IsVariadic
4977+
: flags - Flags::IsVariadic);
4978+
}
49464979

49474980
/// Whether or not this parameter is marked with `@autoclosure`.
4948-
bool isAutoClosure() const { return IsAutoClosure; }
4949-
void setAutoClosure(bool value = true) { IsAutoClosure = value; }
4981+
bool isAutoClosure() const {
4982+
return DefaultValueAndFlags.getInt().contains(Flags::IsAutoClosure);
4983+
}
4984+
void setAutoClosure(bool value = true) {
4985+
auto flags = DefaultValueAndFlags.getInt();
4986+
DefaultValueAndFlags.setInt(value ? flags | Flags::IsAutoClosure
4987+
: flags - Flags::IsAutoClosure);
4988+
}
49504989

49514990
/// Remove the type of this varargs element designator, without the array
49524991
/// type wrapping it. A parameter like "Int..." will have formal parameter

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ class ModuleDecl : public DeclContext, public TypeDecl {
385385
Optional<ProtocolConformanceRef>
386386
lookupConformance(Type type, ProtocolDecl *protocol);
387387

388+
/// Look for the conformance of the given existential type to the given
389+
/// protocol.
390+
Optional<ProtocolConformanceRef>
391+
lookupExistentialConformance(Type type, ProtocolDecl *protocol);
392+
388393
/// Find a member named \p name in \p container that was declared in this
389394
/// module.
390395
///

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ struct SingleRawComment {
2626
BlockDoc, ///< \code /** stuff */ \endcode
2727
};
2828

29-
const CharSourceRange Range;
30-
const StringRef RawText;
29+
CharSourceRange Range;
30+
StringRef RawText;
3131

3232
unsigned Kind : 8;
3333
unsigned StartColumn : 16;

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ namespace swift {
241241
/// This is for bootstrapping. It can't be in SILOptions because the
242242
/// TypeChecker uses it to set resolve the ParameterConvention.
243243
bool EnableSILOpaqueValues = false;
244-
245-
/// Enables key path resilience.
246-
bool EnableKeyPathResilience = true;
247244

248245
/// If set to true, the diagnosis engine can assume the emitted diagnostics
249246
/// will be used in editor. This usually leads to more aggressive fixit.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class CharSourceRange {
130130

131131
public:
132132
/// \brief Constructs an invalid range.
133-
CharSourceRange() {}
133+
CharSourceRange() = default;
134+
135+
CharSourceRange &operator=(const CharSourceRange &) = default;
134136

135137
CharSourceRange(SourceLoc Start, unsigned ByteLength)
136138
: Start(Start), ByteLength(ByteLength) {}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ template <typename K, typename V> class TreeScopedHashTableVal {
3737
TreeScopedHashTableVal(const K &Key, const V &Val) : Key(Key), Val(Val) {}
3838

3939
public:
40+
TreeScopedHashTableVal(const TreeScopedHashTableVal &) = delete;
41+
TreeScopedHashTableVal(TreeScopedHashTableVal &&) = delete;
42+
TreeScopedHashTableVal &operator=(const TreeScopedHashTableVal &) = delete;
43+
TreeScopedHashTableVal &operator=(TreeScopedHashTableVal &&) = delete;
44+
4045
const K &getKey() const { return Key; }
4146
const V &getValue() const { return Val; }
4247
V &getValue() { return Val; }
@@ -144,6 +149,11 @@ class TreeScopedHashTableDetachedScope {
144149
const ImplTy *getImpl() { return DetachedImpl; }
145150

146151
public:
152+
TreeScopedHashTableDetachedScope &operator=(
153+
const TreeScopedHashTableDetachedScope &) = default;
154+
TreeScopedHashTableDetachedScope &operator=(
155+
TreeScopedHashTableDetachedScope &&) = default;
156+
147157
TreeScopedHashTableDetachedScope() : DetachedImpl(0) {}
148158

149159
TreeScopedHashTableDetachedScope(TreeScopedHashTableDetachedScope &&Other)

0 commit comments

Comments
 (0)