Skip to content

Commit 1cbca49

Browse files
---
yaml --- r: 294399 b: refs/heads/tensorflow c: 94a9a9b h: refs/heads/master i: 294397: 1479541 294395: bf9ca51 294391: be15774 294383: a85dac4 294367: fe4a7b9 294335: f716bd5 294271: 6cb8350 294143: 4e34cbd 293887: bed83aa
1 parent 6d992ee commit 1cbca49

File tree

136 files changed

+1207
-3725
lines changed

Some content is hidden

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

136 files changed

+1207
-3725
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: ca3449568f13dda1d7a3c8bafc80af11c15a960a
819+
refs/heads/tensorflow: 94a9a9b68fe966a64541e0add693d7d4a814d0bf
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/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
123123
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
124124
# can be reused when a new version of Swift comes out (assuming the user hasn't
125125
# manually set it as part of their own CMake configuration).
126-
set(SWIFT_VERSION "5.1")
126+
set(SWIFT_VERSION "5.0")
127127

128128
set(SWIFT_VENDOR "" CACHE STRING
129129
"The vendor name of the Swift compiler")
@@ -262,15 +262,9 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
262262
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
263263
"The name of the toolchain to pass to 'xcrun'")
264264

265-
set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "/usr/lib/swift" CACHE STRING
265+
set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "@rpath" CACHE STRING
266266
"The directory of the install_name for standard library dylibs")
267267

268-
# We don't want to use the same install_name_dir as the standard library which
269-
# will be installed in /usr/lib/swift. These private libraries should continue
270-
# to use @rpath for now.
271-
set(SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR "@rpath" CACHE STRING
272-
"The directory of the install_name for the private standard library dylibs")
273-
274268
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.9" CACHE STRING
275269
"Minimum deployment target version for OS X")
276270

branches/tensorflow/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
|**[macOS 10.13 (TensorFlow)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_macos_high_sierra_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow)|
2626
|**[Ubuntu 16.04 (TensorFlow with GPU)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_tensorflow_gpu.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu)|
2727
|**[Debian 9.5](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_debian_9.5.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_5/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_5)|
28-
|**[Windows 2019](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_windows_2019.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-windows-x86_64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-windows-x86_64)|
2928

3029

3130
## Welcome to Swift

branches/tensorflow/cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,6 @@ function(_add_swift_library_single target name)
744744
DEPLOYMENT_VERSION_TVOS
745745
DEPLOYMENT_VERSION_WATCHOS
746746
INSTALL_IN_COMPONENT
747-
DARWIN_INSTALL_NAME_DIR
748747
MODULE_TARGET
749748
SDK)
750749
set(SWIFTLIB_SINGLE_multiple_parameter_options
@@ -1058,10 +1057,6 @@ function(_add_swift_library_single target name)
10581057
set(install_name_dir "@rpath")
10591058
endif()
10601059

1061-
if(SWIFTLIB_SINGLE_DARWIN_INSTALL_NAME_DIR)
1062-
set(install_name_dir "${SWIFTLIB_SINGLE_DARWIN_INSTALL_NAME_DIR}")
1063-
endif()
1064-
10651060
set_target_properties("${target}"
10661061
PROPERTIES
10671062
INSTALL_NAME_DIR "${install_name_dir}")
@@ -1614,8 +1609,7 @@ function(add_swift_target_library name)
16141609
DEPLOYMENT_VERSION_OSX
16151610
DEPLOYMENT_VERSION_TVOS
16161611
DEPLOYMENT_VERSION_WATCHOS
1617-
INSTALL_IN_COMPONENT
1618-
DARWIN_INSTALL_NAME_DIR)
1612+
INSTALL_IN_COMPONENT)
16191613
set(SWIFTLIB_multiple_parameter_options
16201614
C_COMPILE_FLAGS
16211615
DEPENDS
@@ -1916,7 +1910,6 @@ function(add_swift_target_library name)
19161910
${SWIFTLIB_TARGET_LIBRARY_keyword}
19171911
${SWIFTLIB_FORCE_BUILD_OPTIMIZED_keyword}
19181912
${SWIFTLIB_NOSWIFTRT_keyword}
1919-
DARWIN_INSTALL_NAME_DIR "${SWIFTLIB_DARWIN_INSTALL_NAME_DIR}"
19201913
INSTALL_IN_COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
19211914
DEPLOYMENT_VERSION_OSX "${SWIFTLIB_DEPLOYMENT_VERSION_OSX}"
19221915
DEPLOYMENT_VERSION_IOS "${SWIFTLIB_DEPLOYMENT_VERSION_IOS}"

branches/tensorflow/cmake/modules/StandaloneOverlay.cmake

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ if(DEFINED SWIFT_MASTER_LOADED
99
endif()
1010

1111

12-
list(APPEND CMAKE_MODULE_PATH
13-
"${SWIFT_SOURCE_ROOT}/llvm/cmake/modules"
14-
"${PROJECT_SOURCE_DIR}/../../../../cmake/modules"
15-
"${PROJECT_SOURCE_DIR}/../../../cmake/modules")
16-
17-
1812
# -----------------------------------------------------------------------------
1913
# Preconditions
2014

@@ -75,6 +69,11 @@ set_property(CACHE SWIFT_STDLIB_BUILD_TYPE PROPERTY
7569
set(CMAKE_INSTALL_PREFIX
7670
"${SWIFT_DEST_ROOT}${TOOLCHAIN_DIR}/usr")
7771

72+
list(APPEND CMAKE_MODULE_PATH
73+
"${SWIFT_SOURCE_ROOT}/llvm/cmake/modules"
74+
"${PROJECT_SOURCE_DIR}/../../../../cmake/modules"
75+
"${PROJECT_SOURCE_DIR}/../../../cmake/modules")
76+
7877

7978
set(SWIFT_APPLE_PLATFORMS
8079
OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR)
@@ -84,7 +83,6 @@ set(SWIFT_APPLE_PLATFORMS
8483
set(BUILD_STANDALONE TRUE)
8584
set(SWIFT_BUILD_STANDALONE_OVERLAY TRUE)
8685

87-
set(SWIFT_STDLIB_LIBRARY_BUILD_TYPES "SHARED")
8886
set(SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES "SHARED")
8987

9088

branches/tensorflow/docs/ARCOptimization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ In the following we assume that all loops are canonicalized such that:
439439
2. The loop has one backedge.
440440
3. All exiting edges have a unique exit block.
441441

442-
Motivation
443-
----------
442+
Motiviation
443+
-----------
444444

445445
Consider the following simple loop::
446446

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ enum class ConformanceLookupKind : unsigned {
149149
All,
150150
/// Only the explicit conformance.
151151
OnlyExplicit,
152-
/// All conformances except for inherited ones.
153-
NonInherited,
154152
};
155153

156154
/// Describes a diagnostic for a conflict between two protocol

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -470,27 +470,6 @@ NOTE(switch_value_case_doesnt_yield, none, "missing yield in the %0 case",
470470
NOTE(try_branch_doesnt_yield, none, "missing yield when error is "
471471
"%select{not |}0thrown", (bool))
472472

473-
// OS log optimization dianostics.
474-
475-
ERROR(oslog_message_argument_not_found, none, "no argument of type %0 in "
476-
" the os log call", (Identifier))
477-
478-
ERROR(oslog_dynamic_message, none, "os log methods must be passed a string "
479-
"interpolation literal. 'OSLogMessage' must not be constructed explicitly",
480-
())
481-
482-
ERROR(oslog_const_evaluation_error, none, "constant evaluating 'OSLogMessage'"
483-
"implementation failed.", ())
484-
485-
ERROR(oslog_non_constant_message, none, "'OSLogMessage' struct is "
486-
"unoptimizable: 'init' is not constant evaluable", ())
487-
488-
ERROR(oslog_non_constant_interpolation, none, "'OSLogInterpolation' struct is "
489-
"unoptimizable: 'init' is not constant evaluable", ())
490-
491-
ERROR(oslog_property_not_constant, none, "'OSLogInterpolation.%0' is not a "
492-
"constant: formatting and privacy options must be literals", (StringRef))
493-
494473
#ifndef DIAG_NO_UNDEF
495474
# if defined(DIAG)
496475
# undef DIAG

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ ERROR(serialization_missing_dependencies,Fatal,
625625
ERROR(serialization_circular_dependency,Fatal,
626626
"circular dependency between modules '%0' and %1",
627627
(StringRef, Identifier))
628-
ERROR(serialization_missing_underlying_module,Fatal,
628+
ERROR(serialization_missing_shadowed_module,Fatal,
629629
"cannot load underlying module for %0", (Identifier))
630630
ERROR(serialization_name_mismatch,Fatal,
631631
"cannot load module '%0' as '%1'", (StringRef, StringRef))

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ IDENTIFIER_(ErrorType)
178178
IDENTIFIER(Code)
179179
IDENTIFIER_(nsError)
180180

181-
// Custom string interpolation type used by os log APIs.
182-
IDENTIFIER(OSLogMessage)
183-
184181
#undef IDENTIFIER
185182
#undef IDENTIFIER_
186183
#undef IDENTIFIER_WITH_NAME

branches/tensorflow/include/swift/Basic/Statistics.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ FRONTEND_STATISTIC(AST, NumPrefixOperators)
141141
/// Number of precedence groups in the AST context.
142142
FRONTEND_STATISTIC(AST, NumPrecedenceGroups)
143143

144-
/// Number of precedence groups in the AST context.
145-
FRONTEND_STATISTIC(AST, NumStoredPropertiesQueries)
146-
147144
/// Number of full function bodies parsed.
148145
FRONTEND_STATISTIC(Parse, NumFunctionsParsed)
149146

branches/tensorflow/include/swift/Frontend/ParseableInterfaceModuleLoader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ class ParseableInterfaceModuleLoader : public SerializedModuleLoaderBase {
167167
static bool buildSwiftModuleFromSwiftInterface(
168168
ASTContext &Ctx, StringRef CacheDir, StringRef PrebuiltCacheDir,
169169
StringRef ModuleName, StringRef InPath, StringRef OutPath,
170-
bool SerializeDependencyHashes, bool TrackSystemDependencies,
171-
bool RemarkOnRebuildFromInterface);
170+
bool SerializeDependencyHashes, bool TrackSystemDependencies);
172171
};
173172

174173
/// Extract the specified-or-defaulted -module-cache-path that winds up in

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

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,43 @@ inline bool accessKindMayConflict(SILAccessKind a, SILAccessKind b) {
2929
}
3030

3131
/// Represents the identity of a stored class property as a combination
32-
/// of a base and projection.
32+
/// of a base, projection and projection path.
33+
/// we pre-compute the base and projection path, even though we can
34+
/// lazily do so, because it is more expensive otherwise
35+
/// We lazily compute the projection path,
36+
/// In the rare occasions we need it, because of Its destructor and
37+
/// its non-trivial copy constructor
3338
class ObjectProjection {
3439
SILValue object;
40+
const RefElementAddrInst *REA;
3541
Projection proj;
3642

3743
public:
38-
ObjectProjection(SILValue object, const Projection &projection)
39-
: object(object), proj(projection) {
40-
assert(object->getType().isObject());
41-
}
44+
ObjectProjection(const RefElementAddrInst *REA)
45+
: object(stripBorrow(REA->getOperand())), REA(REA),
46+
proj(Projection(REA)) {}
47+
48+
ObjectProjection(SILValue object, const RefElementAddrInst *REA)
49+
: object(object), REA(REA), proj(Projection(REA)) {}
50+
51+
const RefElementAddrInst *getInstr() const { return REA; }
4252

4353
SILValue getObject() const { return object; }
4454

4555
const Projection &getProjection() const { return proj; }
4656

57+
const Optional<ProjectionPath> getProjectionPath() const {
58+
return ProjectionPath::getProjectionPath(stripBorrow(REA->getOperand()),
59+
REA);
60+
}
61+
4762
bool operator==(const ObjectProjection &other) const {
48-
return object == other.object && proj == other.proj;
63+
return getObject() == other.getObject() &&
64+
getProjection() == other.getProjection();
4965
}
5066

5167
bool operator!=(const ObjectProjection &other) const {
52-
return object != other.object || proj != other.proj;
68+
return !operator==(other);
5369
}
5470
};
5571

@@ -173,8 +189,8 @@ class AccessedStorage {
173189

174190
AccessedStorage(SILValue base, Kind kind);
175191

176-
AccessedStorage(SILValue object, Projection projection)
177-
: objProj(object, projection) {
192+
AccessedStorage(SILValue object, const RefElementAddrInst *REA)
193+
: objProj(object, REA) {
178194
initKind(Class);
179195
}
180196

@@ -279,20 +295,20 @@ class AccessedStorage {
279295
if (isUniquelyIdentified() && other.isUniquelyIdentified()) {
280296
return !hasIdenticalBase(other);
281297
}
282-
if (getKind() != Class || other.getKind() != Class)
283-
// At least one side is an Argument or Yield, or is unidentified.
298+
if (getKind() != Class || other.getKind() != Class) {
299+
return false;
300+
}
301+
if (getObjectProjection().getProjection() ==
302+
other.getObjectProjection().getProjection()) {
303+
return false;
304+
}
305+
auto projPath = getObjectProjection().getProjectionPath();
306+
auto otherProjPath = other.getObjectProjection().getProjectionPath();
307+
if (!projPath.hasValue() || !otherProjPath.hasValue()) {
284308
return false;
285-
286-
// Classes are not uniquely identified by their base. However, if the
287-
// underling objects have identical types and distinct property indices then
288-
// they are distinct storage locations.
289-
auto &proj = getObjectProjection();
290-
auto &otherProj = other.getObjectProjection();
291-
if (proj.getObject()->getType() == otherProj.getObject()->getType()
292-
&& proj.getProjection() != otherProj.getProjection()) {
293-
return true;
294309
}
295-
return false;
310+
return projPath.getValue().hasNonEmptySymmetricDifference(
311+
otherProjPath.getValue());
296312
}
297313

298314
/// Returns the ValueDecl for the underlying storage, if it can be

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ class Projection {
289289

290290
/// Apply this projection to \p BaseType and return the relevant subfield's
291291
/// SILType if BaseField has less subtypes than projection's offset.
292-
///
293-
/// WARNING: This is not a constant time operation because it is implemented
294-
/// in terms of getVarDecl, which requests all BaseType's stored properties.
295292
SILType getType(SILType BaseType, SILModule &M) const {
296293
assert(isValid());
297294
switch (getKind()) {
@@ -317,8 +314,6 @@ class Projection {
317314
llvm_unreachable("Unhandled ProjectionKind in switch.");
318315
}
319316

320-
/// WARNING: This is not a constant time operation because it requests all
321-
/// BaseType's stored properties.
322317
VarDecl *getVarDecl(SILType BaseType) const {
323318
assert(isValid());
324319
assert((getKind() == ProjectionKind::Struct ||

0 commit comments

Comments
 (0)