Skip to content

Commit d60cc80

Browse files
authored
Merge pull request #79 from CodaFi/three-point-fun
Update to Swift 3.1
2 parents f8b4743 + 260c0dc commit d60cc80

File tree

8 files changed

+17
-20
lines changed

8 files changed

+17
-20
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
include:
66
- os: osx
77
language: objective-c
8-
osx_image: xcode8.2
8+
osx_image: xcode8.3
99
before_install:
1010
- export PATH=/usr/local/opt/llvm/bin:"${PATH}"
1111
- brew update
@@ -33,10 +33,10 @@ matrix:
3333
- sudo rm -f /usr/bin/llvm-config
3434
- sudo ln -s /usr/bin/llvm-config-${LLVM_API_VERSION} /usr/bin/llvm-config
3535
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
36-
- wget https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
37-
- tar xzf swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
38-
- export PATH=${PWD}/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
39-
- sudo ./swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift
36+
- wget https://swift.org/builds/swift-3.1-release/ubuntu1404/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu14.04.tar.gz
37+
- tar xzf swift-3.1-RELEASE-ubuntu14.04.tar.gz
38+
- export PATH=${PWD}/swift-3.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
39+
- sudo ./swift-3.1-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift
4040
script:
4141
- swift test
4242
notifications:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Plus, it provides common wrappers around oft-used types like `Function`, `Global
4747
There are a couple, annoying steps you need to get it working before it'll
4848
build.
4949

50-
- Install LLVM 3.9 using your favorite package manager. For example:
50+
- Install LLVM 4.0 using your favorite package manager. For example:
5151
- `brew install llvm`
5252
- Ensure `llvm-config` is in your `PATH`
5353
- That will reside in the `/bin` folder wherever your package manager

Sources/LLVM/BasicBlock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public struct BasicBlock: IRValue {
6565

6666
/// Deletes the basic block from its containing function.
6767
/// - note: This does not remove breaks to this block from the
68-
/// function. Ensure you have removed all insructions that reference
68+
/// function. Ensure you have removed all instructions that reference
6969
/// this basic block before deleting it.
7070
public func delete() {
7171
LLVMDeleteBasicBlock(llvm)

Sources/LLVM/Constant.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ public enum Signed: IntegralConstantRepresentation {}
1414
/// Represents floating types and operations.
1515
public enum Floating: ConstantRepresentation {}
1616

17-
// FIXME: When upgrading to Swift 3.1, move this into `Constant`.
18-
internal enum InternalConstantRepresentation {
19-
case unsigned
20-
case signed
21-
case floating
22-
}
23-
2417
/// A `Constant` represents a value initialized to a constant. Constant values
2518
/// may be manipulated with standard Swift arithmetic operations and used with
2619
/// standard IR Builder instructions like any other operand. The difference
@@ -31,8 +24,15 @@ internal enum InternalConstantRepresentation {
3124
/// disallow mixed-type arithmetic. Use the `cast` family of operations to
3225
/// safely convert constants to other representations.
3326
public struct Constant<Repr: ConstantRepresentation>: IRValue {
27+
fileprivate enum Representation {
28+
case unsigned
29+
case signed
30+
case floating
31+
}
32+
fileprivate let repr: Representation
33+
3434
internal let llvm: LLVMValueRef
35-
internal let repr: InternalConstantRepresentation
35+
3636
internal init(llvm: LLVMValueRef!) {
3737
self.llvm = llvm
3838

Sources/LLVM/Function.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public class Function: IRGlobal {
181181

182182
/// Deletes the function from its containing module.
183183
/// - note: This does not remove calls to this function from the
184-
/// module. Ensure you have removed all insructions that reference
184+
/// module. Ensure you have removed all instructions that reference
185185
/// this function before deleting it.
186186
public func delete() {
187187
LLVMDeleteFunction(llvm)

Sources/LLVM/Global.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public struct Global: IRGlobal {
130130

131131
/// Deletes the global variable from its containing module.
132132
/// - note: This does not remove references to this global from the
133-
/// module. Ensure you have removed all insructions that reference
133+
/// module. Ensure you have removed all instructions that reference
134134
/// this global before deleting it.
135135
public func delete() {
136136
LLVMDeleteGlobal(llvm)

Tests/LLVMTests/FileCheck.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import Foundation
22

33
#if os(Linux)
44
import Glibc
5-
6-
typealias NSRegularExpression = RegularExpression
75
#else
86
import Darwin
97
#endif

utils/make-pkgconfig.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import Foundation
33

44
#if os(Linux)
5-
typealias Process = Task
65
let libCPP = "-L/usr/lib -lc++"
76
#elseif os(macOS)
87
let libCPP = "-lc++"

0 commit comments

Comments
 (0)