Skip to content

Commit 654c523

Browse files
milsemantkremenek
authored andcommitted
[CoreGraphics] fix up a few inconsistent names (#3912)
* [CoreGraphics] fix up a few inconsistent names * [test] Remove LLVM value names to pass no-assert builds
1 parent f42158b commit 654c523

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

apinotes/CoreGraphics.apinotes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ Enumerators:
514514
SwiftName: CGColorRenderingIntent.saturation
515515
- Name: kCGMomentumScrollPhaseContinue
516516
SwiftName: CGMomentumScrollPhase.continuous
517+
- Name: kCGColorSpaceModelRGB
518+
SwiftName: CGColorSpaceModel.rgb
519+
- Name: kCGColorSpaceModelCMYK
520+
SwiftName: CGColorSpaceModel.cmyk
521+
517522
# CGContext
518523
- Name: kCGBlendModeXOR
519524
SwiftName: CGBlendMode.xor

test/ClangModules/CoreGraphics_test.swift

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ 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+
829
// CHECK-LABEL: define void {{.*}}rotationAround{{.*}} {
930
// Get a transform that will rotate around a given offset
1031
public func rotationAround(offset: CGPoint, angle: CGFloat,
@@ -104,7 +125,7 @@ public func testRenames(transform: CGAffineTransform, context: CGContext,
104125
from: edge)
105126
assert((slice, remainder) == rect.divided(atDistance: CGFloat(2.0),
106127
from: edge))
107-
// CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %slice, %struct.CGRect* nonnull %remainder, double {{2\.0+.*}}, i32 %{{.*}})
128+
// CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %{{.*}}, %struct.CGRect* nonnull %{{.*}}, double {{2\.0+.*}}, i32 %{{.*}})
108129
//
109130
// CHECK: ret void
110131
}

0 commit comments

Comments
 (0)