Skip to content

Commit

Permalink
Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS …
Browse files Browse the repository at this point in the history
…11, and watchOS 4 SDKs.
  • Loading branch information
shahmishal committed Jun 14, 2017
1 parent a31e2bd commit c5ff1f2
Show file tree
Hide file tree
Showing 78 changed files with 2,856 additions and 584 deletions.
61 changes: 61 additions & 0 deletions apinotes/Accelerate.apinotes
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Name: Accelerate
Enumerators:
- Name: BNNSDataTypeFloatBit
Availability: nonswift
- Name: BNNSDataTypeIntBit
Availability: nonswift
- Name: BNNSDataTypeUIntBit
Availability: nonswift
- Name: BNNSDataTypeIndexedBit
Availability: nonswift
- Name: BNNSDataTypeFloat16
SwiftPrivate: true
- Name: BNNSDataTypeFloat32
SwiftPrivate: true
- Name: BNNSDataTypeInt8
SwiftPrivate: true
- Name: BNNSDataTypeInt16
SwiftPrivate: true
- Name: BNNSDataTypeInt32
SwiftPrivate: true
- Name: BNNSDataTypeUInt8
SwiftPrivate: true
- Name: BNNSDataTypeUInt16
SwiftPrivate: true
- Name: BNNSDataTypeUInt32
SwiftPrivate: true
- Name: BNNSDataTypeIndexed8
SwiftPrivate: true

- Name: BNNSPoolingFunctionMax
SwiftPrivate: true
- Name: BNNSPoolingFunctionAverage
SwiftPrivate: true

- Name: BNNSActivationFunctionIdentity
SwiftPrivate: true
- Name: BNNSActivationFunctionRectifiedLinear
SwiftPrivate: true
- Name: BNNSActivationFunctionLeakyRectifiedLinear
SwiftPrivate: true
- Name: BNNSActivationFunctionSigmoid
SwiftPrivate: true
- Name: BNNSActivationFunctionTanh
SwiftPrivate: true
- Name: BNNSActivationFunctionScaledTanh
SwiftPrivate: true
- Name: BNNSActivationFunctionAbs
SwiftPrivate: true
- Name: BNNSActivationFunctionLinear
SwiftPrivate: true
- Name: BNNSActivationFunctionClamp
SwiftPrivate: true
- Name: BNNSActivationFunctionIntegerLinearSaturate
SwiftPrivate: true
- Name: BNNSActivationFunctionIntegerLinearSaturatePerChannel
SwiftPrivate: true
- Name: BNNSActivationFunctionSoftmax
SwiftPrivate: true

- Name: BNNSFlagsUseClientPtr
SwiftPrivate: true
1 change: 1 addition & 0 deletions apinotes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(SWIFT_API_NOTES_INPUTS
Accelerate
AVFoundation
AVKit
AppKit
Expand Down
2 changes: 2 additions & 0 deletions apinotes/Dispatch.apinotes
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ Protocols:
SwiftName: DispatchSourceUserDataOr
- Name: OS_dispatch_source_data_add
SwiftName: DispatchSourceUserDataAdd
- Name: OS_dispatch_source_data_replace
SwiftName: DispatchSourceUserDataReplace
- Name: OS_dispatch_source_vnode
SwiftName: DispatchSourceFileSystemObject
- Name: OS_dispatch_source_write
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/DarwinSDKs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ is_sdk_requested(IOS_SIMULATOR swift_build_ios_simulator)
if(swift_build_ios_simulator)
configure_sdk_darwin(
IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
iphonesimulator ios-simulator ios "i386;x86_64")
iphonesimulator ios-simulator ios "x86_64")
configure_target_variant(
IOS_SIMULATOR-DA "iOS Debug+Asserts" IOS_SIMULATOR DA "Debug+Asserts")
configure_target_variant(
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/DiagnosticsDriver.def
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ ERROR(error_os_minimum_deployment,none,
"Swift requires a minimum deployment target of %0", (StringRef))
ERROR(error_sdk_too_old,none,
"Swift does not support the SDK '%0'", (StringRef))
ERROR(error_ios_maximum_deployment_32,none,
"iOS %0 does not support 32-bit programs", (unsigned))

ERROR(error_two_files_same_name,none,
"filename \"%0\" used twice: '%1' and '%2'",
Expand Down
10 changes: 7 additions & 3 deletions lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ static void validateArgs(DiagnosticEngine &diags, const ArgList &Args) {
if (triple.isOSVersionLT(7))
diags.diagnose(SourceLoc(), diag::error_os_minimum_deployment,
"iOS 7");
if (triple.isArch32Bit() && !triple.isOSVersionLT(11)) {
diags.diagnose(SourceLoc(), diag::error_ios_maximum_deployment_32,
triple.getOSMajorVersion());
}
} else if (triple.isWatchOS()) {
if (triple.isOSVersionLT(2, 0)) {
diags.diagnose(SourceLoc(), diag::error_os_minimum_deployment,
Expand Down Expand Up @@ -1034,14 +1038,14 @@ static bool isSDKTooOld(StringRef sdkPath, clang::VersionTuple minVersion,
/// the given target.
static bool isSDKTooOld(StringRef sdkPath, const llvm::Triple &target) {
if (target.isMacOSX()) {
return isSDKTooOld(sdkPath, clang::VersionTuple(10, 12), "OSX");
return isSDKTooOld(sdkPath, clang::VersionTuple(10, 13), "OSX");

} else if (target.isiOS()) {
// Includes both iOS and TVOS.
return isSDKTooOld(sdkPath, clang::VersionTuple(10, 0), "Simulator", "OS");
return isSDKTooOld(sdkPath, clang::VersionTuple(11, 0), "Simulator", "OS");

} else if (target.isWatchOS()) {
return isSDKTooOld(sdkPath, clang::VersionTuple(3, 0), "Simulator", "OS");
return isSDKTooOld(sdkPath, clang::VersionTuple(4, 0), "Simulator", "OS");

} else {
return false;
Expand Down
57 changes: 57 additions & 0 deletions stdlib/public/SDK/ARKit/ARKit.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

@_exported import ARKit

@available(iOS, introduced: 11.0)
extension ARCamera {
/**
A value describing the camera's tracking state.
*/
public enum TrackingState {
public enum Reason {
/** Tracking is limited due to a excessive motion of the camera. */
case excessiveMotion

/** Tracking is limited due to a lack of features visible to the camera. */
case insufficientFeatures
}

/** Tracking is not available. */
case notAvailable

/** Tracking is limited. See tracking reason for details. */
case limited(Reason)

/** Tracking is normal. */
case normal
}

/**
The tracking state of the camera.
*/
public var trackingState: TrackingState {
switch __trackingState {
case .notAvailable: return .notAvailable
case .normal: return .normal
case .limited:
let reason: TrackingState.Reason

switch __trackingStateReason {
case .excessiveMotion: reason = .excessiveMotion
default: reason = .insufficientFeatures
}

return .limited(reason)
}
}
}
14 changes: 14 additions & 0 deletions stdlib/public/SDK/ARKit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.4.3)
include("../../../../cmake/modules/StandaloneOverlay.cmake")

add_swift_library(swiftARKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
ARKit.swift

SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
TARGET_SDKS IOS IOS_SIMULATOR
SWIFT_MODULE_DEPENDS_IOS Darwin AVFoundation CoreAudio CoreFoundation CoreGraphics CoreImage CoreMedia Dispatch Foundation GLKit ObjectiveC QuartzCore SceneKit simd SpriteKit UIKit # auto-updated
FRAMEWORK_DEPENDS_WEAK ARKit

DEPLOYMENT_VERSION_IOS ${SWIFTLIB_DEPLOYMENT_VERSION_ARKIT_IOS}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

@_exported import AVFoundation // Clang module
import Foundation


#if os(iOS)
@available(iOS, introduced: 11.0)
extension AVCaptureSynchronizedDataCollection : Sequence {
public func makeIterator() -> Iterator {
return Iterator(self)
}

public struct Iterator : IteratorProtocol {
internal var fastIterator: NSFastEnumerationIterator

internal init(_ collection: AVCaptureSynchronizedDataCollection) {
self.fastIterator = NSFastEnumerationIterator(collection)
}

public mutating func next() -> AVCaptureSynchronizedData? {
guard let nextAny = fastIterator.next() else { return nil }
return nextAny as! AVCaptureSynchronizedData
}
}
}

#endif
1 change: 1 addition & 0 deletions stdlib/public/SDK/AVFoundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.4.3)
include("../../../../cmake/modules/StandaloneOverlay.cmake")

add_swift_library(swiftAVFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
AVCaptureSynchronizedDataCollection.swift
AVError.swift
NSValue.swift.gyb

Expand Down
Loading

0 comments on commit c5ff1f2

Please sign in to comment.