Skip to content

Commit 33ccf2d

Browse files
CodaFiharlanhaskins
authored andcommitted
1 parent 58a027b commit 33ccf2d

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

Sources/LLVMSwift/Function.swift

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,5 @@
11
import cllvm
22

3-
public enum Attribute {
4-
case zExt, sExt, noReturn, inReg, structRet, noUnwind, noAlias
5-
case byVal, nest, readOnly, noInline, alwaysInline, optimizeForSize
6-
case stackProtect, stackProtectReq, alignment, noCapture, noRedZone
7-
case noImplicitFloat, naked, inlineHint, stackAlignment, returnsTwice
8-
case uwTable, nonLazyBind
9-
10-
/* FIXME: These attributes are currently not included in the C API as
11-
a temporary measure until the API/ABI impact to the C API is understood
12-
and the path forward agreed upon.
13-
case sanitizeAddress, stackProtectStrong, cold, optimizeNone, inAlloca
14-
case nonNull, jumpTable, convergent, safeStack, swiftSelf, swiftError
15-
*/
16-
17-
private static let mapping: [Attribute: LLVMAttribute] = [
18-
.zExt: LLVMZExtAttribute, .sExt: LLVMSExtAttribute, .noReturn: LLVMNoReturnAttribute,
19-
.inReg: LLVMInRegAttribute, .structRet: LLVMStructRetAttribute, .noUnwind: LLVMNoUnwindAttribute,
20-
.noAlias: LLVMNoAliasAttribute, .byVal: LLVMByValAttribute, .nest: LLVMNestAttribute,
21-
.readOnly: LLVMReadOnlyAttribute, .noInline: LLVMNoInlineAttribute, .alwaysInline: LLVMAlwaysInlineAttribute,
22-
.optimizeForSize: LLVMOptimizeForSizeAttribute, .stackProtect: LLVMStackProtectAttribute,
23-
.stackProtectReq: LLVMStackProtectReqAttribute, .alignment: LLVMAlignment,
24-
.noCapture: LLVMNoCaptureAttribute, .noRedZone: LLVMNoRedZoneAttribute,
25-
.noImplicitFloat: LLVMNoImplicitFloatAttribute, .naked: LLVMNakedAttribute,
26-
.inlineHint: LLVMInlineHintAttribute, .stackAlignment: LLVMStackAlignment,
27-
.returnsTwice: LLVMReturnsTwice, .uwTable: LLVMUWTable, .nonLazyBind: LLVMNonLazyBind
28-
]
29-
30-
public func asLLVM() -> LLVMAttribute {
31-
return Attribute.mapping[self]!
32-
}
33-
}
34-
353
public class Function: IRValue {
364
internal let llvm: LLVMValueRef
375
internal init(llvm: LLVMValueRef) {
@@ -106,14 +74,6 @@ public class Function: IRValue {
10674
public struct Parameter: IRValue {
10775
internal let llvm: LLVMValueRef
10876

109-
func addAttribute(_ attr: Attribute) {
110-
LLVMAddAttribute(asLLVM(), attr.asLLVM())
111-
}
112-
113-
func removeAttribute(_ attr: Attribute) {
114-
LLVMRemoveAttribute(asLLVM(), attr.asLLVM())
115-
}
116-
11777
public func next() -> Parameter? {
11878
guard let param = LLVMGetNextParam(llvm) else { return nil }
11979
return Parameter(llvm: param)

0 commit comments

Comments
 (0)