Skip to content

Commit 0af501a

Browse files
authored
Merge pull request #106 from CodaFi/fourth-of-firth-of-fifth
Update to Swift 4.0
2 parents 7fc4caf + 6e718d4 commit 0af501a

11 files changed

+30
-1462
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.3
8+
osx_image: xcode9
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.1.1-release/ubuntu1404/swift-3.1.1-RELEASE/swift-3.1.1-RELEASE-ubuntu14.04.tar.gz
37-
- tar xzf swift-3.1.1-RELEASE-ubuntu14.04.tar.gz
38-
- export PATH=${PWD}/swift-3.1.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
39-
- sudo ./swift-3.1.1-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift
36+
- wget https://swift.org/builds/swift-4.0-release/ubuntu1404/swift-4.0-RELEASE/swift-4.0-RELEASE-ubuntu14.04.tar.gz
37+
- tar xzf swift-4.0-RELEASE-ubuntu14.04.tar.gz
38+
- export PATH=${PWD}/swift-4.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
39+
- sudo ./swift-4.0-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift
4040
script:
4141
- swift test
4242
notifications:

Package.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1+
// swift-tools-version:4.0
2+
13
import PackageDescription
24

35
let package = Package(
46
name: "LLVM",
7+
products: [
8+
.library(
9+
name: "LLVM",
10+
targets: ["LLVM"]),
11+
],
512
dependencies: [
6-
.Package(url: "https://github.com/trill-lang/cllvm.git", majorVersion: 0),
13+
.package(url: "https://github.com/trill-lang/cllvm.git", .branch("master")),
14+
.package(url: "https://github.com/trill-lang/FileCheck.git", .branch("master")),
15+
],
16+
targets: [
17+
.target(
18+
name: "LLVM"),
19+
.testTarget(
20+
name: "LLVMTests",
21+
dependencies: ["LLVM", "FileCheck"]),
722
]
823
)

Sources/LLVM/IntType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public struct IntType: IRType {
5252
/// type's bit width. Defaults to `false`.
5353
public func constant<IntTy: UnsignedInteger>(_ value: IntTy, signExtend: Bool = false) -> Constant<Unsigned> {
5454
return Constant(llvm: LLVMConstInt(asLLVM(),
55-
value.toUIntMax(),
55+
UInt64(value),
5656
signExtend.llvm))
5757
}
5858

@@ -63,7 +63,7 @@ public struct IntType: IRType {
6363
/// type's bit width. Defaults to `false`.
6464
public func constant<IntTy: SignedInteger>(_ value: IntTy, signExtend: Bool = false) -> Constant<Signed> {
6565
return Constant(llvm: LLVMConstInt(asLLVM(),
66-
UInt64(bitPattern: value.toIntMax()),
66+
UInt64(bitPattern: Int64(value)),
6767
signExtend.llvm))
6868
}
6969

Tests/LLVMTests/ANSIColor.swift

Lines changed: 0 additions & 40 deletions
This file was deleted.

Tests/LLVMTests/ColoredStream.swift

Lines changed: 0 additions & 79 deletions
This file was deleted.

Tests/LLVMTests/ConstantSpec.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import LLVM
22
import XCTest
3+
import FileCheck
34
import Foundation
45

56
class ConstantSpec : XCTestCase {

Tests/LLVMTests/FIleCheckSpec.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import LLVM
22
import XCTest
3+
import FileCheck
34
import Foundation
45

56
class FileCheckSpec : XCTestCase {

0 commit comments

Comments
 (0)