Skip to content

Commit ed611f2

Browse files
authored
Merge pull request #146 from CodaFi/remove-hacks
Remove attribute hacks from LLVM 6.0
2 parents 24decdb + 2063de2 commit ed611f2

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

Sources/LLVM/Function+Attributes.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,6 @@ extension Function {
343343
/// - parameter index: The index representing the function, its return value
344344
/// or one of its parameters.
345345
public func removeAttribute(_ attrKind: AttributeKind, from index: AttributeIndex) {
346-
// FIXME: Remove when LLVM 7.0.0 is released.
347-
guard attrKind != .align
348-
&& attrKind != .alignstack
349-
&& attrKind != .allocsize
350-
&& attrKind != .dereferenceable
351-
&& attrKind != .dereferenceableOrNull else {
352-
fatalError(
353-
"Removing valued enum attributes crashes in LLVM <7.0.0 " +
354-
"and is currently disabled in LLVMSwift.")
355-
}
356-
357346
LLVMRemoveEnumAttributeAtIndex(llvm, index.rawValue, attrKind.id)
358347
}
359348

Tests/LLVMTests/IRAttributesSpec.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ class IRAttributesSpec : XCTestCase {
131131
XCTAssertEqual(enumAttr.value, value)
132132
XCTAssert(fn.attributes(at: .function).contains { $0.asLLVM() == enumAttr.asLLVM() })
133133

134-
// FIXME: Remove when LLVM 7.0.0 is released.
135-
guard value == 0 else { continue }
136-
137134
fn.removeAttribute(enumAttr, from: .function)
138135
XCTAssertFalse(fn.attributes(at: .function).contains { $0.asLLVM() == enumAttr.asLLVM() })
139136

@@ -195,9 +192,6 @@ class IRAttributesSpec : XCTestCase {
195192
XCTAssertEqual(enumAttr.value, value)
196193
XCTAssert(fn.attributes(at: .returnValue).contains { $0.asLLVM() == enumAttr.asLLVM() })
197194

198-
// FIXME: Remove when LLVM 7.0.0 is released.
199-
guard value == 0 else { continue }
200-
201195
fn.removeAttribute(enumAttr, from: .returnValue)
202196
XCTAssertFalse(fn.attributes(at: .returnValue).contains { $0.asLLVM() == enumAttr.asLLVM() })
203197

@@ -211,9 +205,6 @@ class IRAttributesSpec : XCTestCase {
211205
XCTAssertEqual(enumAttr.value, value)
212206
XCTAssert(fn.attributes(at: .argument(0)).contains { $0.asLLVM() == enumAttr.asLLVM() })
213207

214-
// FIXME: Remove when LLVM 7.0.0 is released.
215-
guard value == 0 else { continue }
216-
217208
fn.removeAttribute(enumAttr, from: .argument(0))
218209
XCTAssertFalse(fn.attributes(at: .argument(0)).contains { $0.asLLVM() == enumAttr.asLLVM() })
219210

0 commit comments

Comments
 (0)