Skip to content

Commit f03ee96

Browse files
committed
Extend types with: DiagnosticSeverity, AtomicRMWBinOp, AtomicOrdering, ThreadLocalMode, LandingPadClauseTy, RealPredicate, IntPredicate, ValueKind
1 parent 9015a8c commit f03ee96

21 files changed

+228
-45
lines changed

llvm-api/LLVM/Core/BasicBlock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,6 @@ public struct BasicBlock: BasicBlockRef {
360360

361361
extension BasicBlock: Equatable {
362362
public static func == (lhs: BasicBlock, rhs: BasicBlock) -> Bool {
363-
return lhs.basicBlockRef == rhs.basicBlockRef
363+
lhs.basicBlockRef == rhs.basicBlockRef
364364
}
365365
}

llvm-api/LLVM/Core/Context.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class Context: ContextRef {
5858

5959
/// Retrieve whether the given context is set to discard all value names.
6060
public func shouldDiscardValueNames() -> Bool {
61-
return LLVMContextShouldDiscardValueNames(llvm) != 0
61+
LLVMContextShouldDiscardValueNames(llvm) != 0
6262
}
6363

6464
/// Set whether the given context discards all value names.
@@ -76,7 +76,7 @@ public class Context: ContextRef {
7676
public var discardValueNames: Bool {
7777
get {
7878
// Retrieve whether the given context is set to discard all value names.
79-
return shouldDiscardValueNames()
79+
shouldDiscardValueNames()
8080
}
8181
set {
8282
// Set whether the given context discards all value names.
@@ -204,17 +204,17 @@ public class Context: ContextRef {
204204

205205
/// Check for the types of attributes.
206206
public static func isEnumAttribute(attributeRef: AttributeRef) -> Bool {
207-
return LLVMIsEnumAttribute(attributeRef.attributeRef) != 0
207+
LLVMIsEnumAttribute(attributeRef.attributeRef) != 0
208208
}
209209

210210
/// Check for the types of attributes.
211211
public static func isStringAttribute(attributeRef: AttributeRef) -> Bool {
212-
return LLVMIsStringAttribute(attributeRef.attributeRef) != 0
212+
LLVMIsStringAttribute(attributeRef.attributeRef) != 0
213213
}
214214

215215
/// Check for the types of attributes.
216216
public static func isTypeAttribute(attributeRef: AttributeRef) -> Bool {
217-
return LLVMIsTypeAttribute(attributeRef.attributeRef) != 0
217+
LLVMIsTypeAttribute(attributeRef.attributeRef) != 0
218218
}
219219

220220
/// Obtain a Type from a context by its registered name.

llvm-api/LLVM/Core/Core.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ enum Core {
3030
///
3131
/// - SeeAlso: `disposeLLVMMessage`
3232
public static func createMessage(with message: String) -> UnsafeMutablePointer<CChar>? {
33-
return message.withCString { cString in
33+
message.withCString { cString in
3434
LLVMCreateMessage(cString)
3535
}
3636
}
@@ -43,7 +43,7 @@ enum Core {
4343
/// This function permanently loads the dynamic library at the given path.
4444
/// It is safe to call this function multiple times for the same library.
4545
public static func loadLibraryPermanently(filename: String) -> Bool {
46-
return filename.withCString { cString in
46+
filename.withCString { cString in
4747
LLVMLoadLibraryPermanently(cString) != 0
4848
}
4949
}
@@ -67,7 +67,7 @@ enum Core {
6767
/// libraries for the symbol `symbolName`. If it is found, the address of
6868
/// that symbol is returned. If not, null is returned.
6969
public static func searchForAddressOfSymbol(symbolName: String) -> UnsafeMutableRawPointer? {
70-
return symbolName.withCString { cString in
70+
symbolName.withCString { cString in
7171
LLVMSearchForAddressOfSymbol(cString)
7272
}
7373
}

llvm-api/LLVM/Core/Diagnostic.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,3 @@ public struct Diagnostic: DiagnosticInfoRef {
2121
}
2222
}
2323

24-
public enum DiagnosticSeverity: Int {
25-
case error = 0
26-
case warning = 1
27-
case remark = 2
28-
case note = 3
29-
30-
public init?(from cSeverity: LLVMDiagnosticSeverity) {
31-
self.init(rawValue: Int(cSeverity.rawValue))
32-
}
33-
}

llvm-api/LLVM/Core/Functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ public struct Function: ValueRef {
130130

131131
extension Function: Equatable {
132132
public static func == (lhs: Function, rhs: Function) -> Bool {
133-
return lhs.valueRef == rhs.valueRef
133+
lhs.valueRef == rhs.valueRef
134134
}
135135
}

llvm-api/LLVM/Core/Types/Array.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ public struct ArrayType: TypeRef {
107107

108108
extension ArrayType: Equatable {
109109
public static func == (lhs: ArrayType, rhs: ArrayType) -> Bool {
110-
return lhs.typeRef == rhs.typeRef
110+
lhs.typeRef == rhs.typeRef
111111
}
112112
}

llvm-api/LLVM/Core/Types/Float.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,6 @@ public class PPCFP128Type: FloatingType {
152152

153153
extension FloatingType: Equatable {
154154
public static func == (lhs: FloatingType, rhs: FloatingType) -> Bool {
155-
return lhs.typeRef == rhs.typeRef
155+
lhs.typeRef == rhs.typeRef
156156
}
157157
}

llvm-api/LLVM/Core/Types/Function.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ public struct FunctionType: TypeRef {
7777

7878
extension FunctionType: Equatable {
7979
public static func == (lhs: FunctionType, rhs: FunctionType) -> Bool {
80-
return lhs.typeRef == rhs.typeRef
80+
lhs.typeRef == rhs.typeRef
8181
}
8282
}

llvm-api/LLVM/Core/Types/Int.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ public class Int128Type: IntType {
157157

158158
extension IntType: Equatable {
159159
public static func == (lhs: IntType, rhs: IntType) -> Bool {
160-
return lhs.typeRef == rhs.typeRef
160+
lhs.typeRef == rhs.typeRef
161161
}
162162
}

llvm-api/LLVM/Core/Types/Other/Label.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public struct LabelType: TypeRef {
3131

3232
extension LabelType: Equatable {
3333
public static func == (lhs: LabelType, rhs: LabelType) -> Bool {
34-
return lhs.typeRef == rhs.typeRef
34+
lhs.typeRef == rhs.typeRef
3535
}
3636
}

0 commit comments

Comments
 (0)