Skip to content

Commit 9894ac5

Browse files
authored
Merge pull request #4211 from apple/update-swift-3.0-preview-5-for-beta-5
Update swift-3.0-preview-5-branch to build with Xcode 8 beta 5, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs.
2 parents 71fc302 + 485069f commit 9894ac5

File tree

4 files changed

+11
-39
lines changed

4 files changed

+11
-39
lines changed

apinotes/CoreGraphics.apinotes

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,6 @@ Enumerators:
535535
SwiftName: CGColorRenderingIntent.saturation
536536
- Name: kCGMomentumScrollPhaseContinue
537537
SwiftName: CGMomentumScrollPhase.continuous
538-
- Name: kCGColorSpaceModelRGB
539-
SwiftName: CGColorSpaceModel.rgb
540-
- Name: kCGColorSpaceModelCMYK
541-
SwiftName: CGColorSpaceModel.cmyk
542-
543538
# CGContext
544539
- Name: kCGBlendModeXOR
545540
SwiftName: CGBlendMode.xor

stdlib/public/SDK/CoreGraphics/CoreGraphics.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,19 @@ import Darwin
1818
//===----------------------------------------------------------------------===//
1919

2020
extension CGColor {
21+
@available(OSX 10.3, iOS 2.0, *)
2122
public var components: [CGFloat]? {
2223
guard let pointer = self.__unsafeComponents else { return nil }
2324
let buffer = UnsafeBufferPointer(start: pointer, count: self.numberOfComponents)
2425
return Array(buffer)
2526
}
2627

2728
#if os(macOS)
28-
public class var white: CGColor
29-
{ return CGColor.__constantColor(for: CGColor.__whiteColorName)! }
29+
public class var white: CGColor { return CGColor.__constantColor(for: CGColor.__whiteColorName)! }
3030

31-
public class var black: CGColor
32-
{ return CGColor.__constantColor(for: CGColor.__blackColorName)! }
31+
public class var black: CGColor { return CGColor.__constantColor(for: CGColor.__blackColorName)! }
3332

34-
public class var clear: CGColor
35-
{ return CGColor.__constantColor(for: CGColor.__clearColorName)! }
33+
public class var clear: CGColor { return CGColor.__constantColor(for: CGColor.__clearColorName)! }
3634
#endif
3735
}
3836

@@ -219,4 +217,5 @@ extension CGAffineTransform {
219217
@_transparent // @fragile
220218
get { return CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0) }
221219
}
222-
}
220+
}
221+

test/ClangModules/CoreGraphics_test.swift

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,6 @@ import CoreGraphics
55

66
// REQUIRES: OS=macosx
77

8-
// CHECK: [[SWITCHTABLE:@.*]] = private unnamed_addr constant [8 x i64] [i64 0, i64 12, i64 23, i64 34, i64 45, i64 55, i64 67, i64 71]
9-
10-
// CHECK-LABEL: define i64 {{.*}}testEnums{{.*}} {
11-
public func testEnums(_ model: CGColorSpaceModel) -> Int {
12-
switch model {
13-
case .unknown : return 0
14-
case .monochrome : return 12
15-
case .rgb : return 23
16-
case .cmyk : return 34
17-
case .lab : return 45
18-
case .deviceN : return 55
19-
case .indexed : return 67
20-
case .pattern : return 71
21-
22-
default: return 0
23-
}
24-
// CHECK: [[GEP:%.+]] = getelementptr inbounds [8 x i64], [8 x i64]* [[SWITCHTABLE]], i64 0, i64 %{{.*}}
25-
// CHECK: [[LOAD:%.+]] = load i64, i64* [[GEP]], align 8
26-
// CHECK: ret i64 [[LOAD]]
27-
}
28-
298
// CHECK-LABEL: define void {{.*}}rotationAround{{.*}} {
309
// Get a transform that will rotate around a given offset
3110
public func rotationAround(offset: CGPoint, angle: CGFloat,
@@ -113,8 +92,10 @@ public func testRenames(transform: CGAffineTransform, context: CGContext,
11392
// CHECK: call void @CGContextTranslateCTM(%struct.CGContext* [[CONTEXT]], double {{1\.0+.*}}, double {{1\.0+.*}})
11493

11594
context.clip(to: rect)
95+
context.clip(to: &rect, count: 2)
11696
context.clip(to: rect, mask: image)
11797
// CHECK: call void @CGContextClipToRect(%struct.CGContext* [[CONTEXT]], %struct.CGRect* byval nonnull align 8 %{{.*}})
98+
// CHECK: call void @CGContextClipToRects(%struct.CGContext* [[CONTEXT]], %struct.CGRect* nonnull %{{.*}}, i64 2)
11899
// CHECK: call void @CGContextClipToMask(%struct.CGContext* [[CONTEXT]], %struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGImage* %{{.*}})
119100

120101
var slice = CGRect.zero
@@ -123,7 +104,7 @@ public func testRenames(transform: CGAffineTransform, context: CGContext,
123104
from: edge)
124105
assert((slice, remainder) == rect.divided(atDistance: CGFloat(2.0),
125106
from: edge))
126-
// CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %{{.*}}, %struct.CGRect* nonnull %{{.*}}, double {{2\.0+.*}}, i32 %{{.*}})
107+
// CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %slice, %struct.CGRect* nonnull %remainder, double {{2\.0+.*}}, i32 %{{.*}})
127108
//
128109
// CHECK: ret void
129110
}

tools/swift-reflection-test/swift-reflection-test.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,21 +421,18 @@ int doDumpHeapInstance(const char *BinaryFilename) {
421421
return EXIT_SUCCESS;
422422
break;
423423
case Existential: {
424-
static const char Name[] = "_TtP_";
425424
swift_typeref_t AnyTR
426-
= swift_reflection_typeRefForMangledTypeName(RC,
427-
Name, sizeof(Name)-1);
425+
= swift_reflection_typeRefForMangledTypeName(RC, "_TtP_", 5);
428426

429427
printf("Reflecting an existential.\n");
430428
if (!reflectExistential(RC, Pipe, AnyTR))
431429
return EXIT_SUCCESS;
432430
break;
433431
}
434432
case ErrorExistential: {
435-
static const char ErrorName[] = "_TtPs5Error_";
436433
swift_typeref_t ErrorTR
437434
= swift_reflection_typeRefForMangledTypeName(RC,
438-
ErrorName, sizeof(ErrorName)-1);
435+
"_TtPs5Error_", 21);
439436
printf("Reflecting an error existential.\n");
440437
if (!reflectExistential(RC, Pipe, ErrorTR))
441438
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)