diff --git a/.travis.yml b/.travis.yml index 32a96101..9fc8e935 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ matrix: include: - os: osx language: objective-c - osx_image: xcode8.2 + osx_image: xcode8.3 before_install: - export PATH=/usr/local/opt/llvm/bin:"${PATH}" - brew update @@ -33,10 +33,10 @@ matrix: - sudo rm -f /usr/bin/llvm-config - sudo ln -s /usr/bin/llvm-config-${LLVM_API_VERSION} /usr/bin/llvm-config - wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import - - - 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 - - tar xzf swift-3.0.2-RELEASE-ubuntu14.04.tar.gz - - export PATH=${PWD}/swift-3.0.2-RELEASE-ubuntu14.04/usr/bin:"${PATH}" - - sudo ./swift-3.0.2-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift + - wget https://swift.org/builds/swift-3.1-release/ubuntu1404/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu14.04.tar.gz + - tar xzf swift-3.1-RELEASE-ubuntu14.04.tar.gz + - export PATH=${PWD}/swift-3.1-RELEASE-ubuntu14.04/usr/bin:"${PATH}" + - sudo ./swift-3.1-RELEASE-ubuntu14.04/usr/bin/swift utils/make-pkgconfig.swift script: - swift test notifications: diff --git a/README.md b/README.md index 78da280d..e7bb8aad 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Plus, it provides common wrappers around oft-used types like `Function`, `Global There are a couple, annoying steps you need to get it working before it'll build. -- Install LLVM 3.9 using your favorite package manager. For example: +- Install LLVM 4.0 using your favorite package manager. For example: - `brew install llvm` - Ensure `llvm-config` is in your `PATH` - That will reside in the `/bin` folder wherever your package manager diff --git a/Sources/LLVM/BasicBlock.swift b/Sources/LLVM/BasicBlock.swift index 6d7f01e1..63ee2121 100644 --- a/Sources/LLVM/BasicBlock.swift +++ b/Sources/LLVM/BasicBlock.swift @@ -65,7 +65,7 @@ public struct BasicBlock: IRValue { /// Deletes the basic block from its containing function. /// - note: This does not remove breaks to this block from the - /// function. Ensure you have removed all insructions that reference + /// function. Ensure you have removed all instructions that reference /// this basic block before deleting it. public func delete() { LLVMDeleteBasicBlock(llvm) diff --git a/Sources/LLVM/Constant.swift b/Sources/LLVM/Constant.swift index 12f4a250..ab8c22e3 100644 --- a/Sources/LLVM/Constant.swift +++ b/Sources/LLVM/Constant.swift @@ -14,13 +14,6 @@ public enum Signed: IntegralConstantRepresentation {} /// Represents floating types and operations. public enum Floating: ConstantRepresentation {} -// FIXME: When upgrading to Swift 3.1, move this into `Constant`. -internal enum InternalConstantRepresentation { - case unsigned - case signed - case floating -} - /// A `Constant` represents a value initialized to a constant. Constant values /// may be manipulated with standard Swift arithmetic operations and used with /// standard IR Builder instructions like any other operand. The difference @@ -31,8 +24,15 @@ internal enum InternalConstantRepresentation { /// disallow mixed-type arithmetic. Use the `cast` family of operations to /// safely convert constants to other representations. public struct Constant: IRValue { + fileprivate enum Representation { + case unsigned + case signed + case floating + } + fileprivate let repr: Representation + internal let llvm: LLVMValueRef - internal let repr: InternalConstantRepresentation + internal init(llvm: LLVMValueRef!) { self.llvm = llvm diff --git a/Sources/LLVM/Function.swift b/Sources/LLVM/Function.swift index 3ef270c2..6ed3b363 100644 --- a/Sources/LLVM/Function.swift +++ b/Sources/LLVM/Function.swift @@ -181,7 +181,7 @@ public class Function: IRGlobal { /// Deletes the function from its containing module. /// - note: This does not remove calls to this function from the - /// module. Ensure you have removed all insructions that reference + /// module. Ensure you have removed all instructions that reference /// this function before deleting it. public func delete() { LLVMDeleteFunction(llvm) diff --git a/Sources/LLVM/Global.swift b/Sources/LLVM/Global.swift index ce858f5a..ec7a5bd6 100644 --- a/Sources/LLVM/Global.swift +++ b/Sources/LLVM/Global.swift @@ -130,7 +130,7 @@ public struct Global: IRGlobal { /// Deletes the global variable from its containing module. /// - note: This does not remove references to this global from the - /// module. Ensure you have removed all insructions that reference + /// module. Ensure you have removed all instructions that reference /// this global before deleting it. public func delete() { LLVMDeleteGlobal(llvm) diff --git a/Tests/LLVMTests/FileCheck.swift b/Tests/LLVMTests/FileCheck.swift index 369873e7..ca2f5aa4 100644 --- a/Tests/LLVMTests/FileCheck.swift +++ b/Tests/LLVMTests/FileCheck.swift @@ -2,8 +2,6 @@ import Foundation #if os(Linux) import Glibc - - typealias NSRegularExpression = RegularExpression #else import Darwin #endif diff --git a/utils/make-pkgconfig.swift b/utils/make-pkgconfig.swift index b09acfad..43cc1b3f 100644 --- a/utils/make-pkgconfig.swift +++ b/utils/make-pkgconfig.swift @@ -2,7 +2,6 @@ import Foundation #if os(Linux) - typealias Process = Task let libCPP = "-L/usr/lib -lc++" #elseif os(macOS) let libCPP = "-lc++"