Skip to content

Commit e5c6e6c

Browse files
committed
Remove de-initializers that dispose of LLVM objects
1 parent aeb1eb6 commit e5c6e6c

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Sources/LLVM/IRBuilder.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,8 @@ public class IRBuilder {
17061706
return Alias(llvm: LLVMAddAlias(module.llvm, type.asLLVM(), aliasee.asLLVM(), name))
17071707
}
17081708

1709-
deinit {
1710-
LLVMDisposeBuilder(llvm)
1711-
}
1709+
// FIXME: Re-introduce this when disposal becomes safe.
1710+
// deinit {
1711+
// LLVMDisposeBuilder(llvm)
1712+
// }
17121713
}

Sources/LLVM/Module.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ public final class Module: CustomStringConvertible {
193193
return String(cString: cStr)
194194
}
195195

196-
deinit {
197-
LLVMDisposeModule(llvm)
198-
}
196+
// FIXME: Re-introduce this when disposal becomes safe.
197+
// deinit {
198+
// LLVMDisposeModule(llvm)
199+
// }
199200
}
200201

201202
extension Bool {

Sources/LLVM/TargetMachine.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ public class TargetMachine {
212212
return MemoryBuffer(llvm: llvm)
213213
}
214214

215-
deinit {
216-
LLVMDisposeTargetMachine(llvm)
217-
}
215+
// FIXME: Re-introduce this when disposal becomes safe.
216+
// deinit {
217+
// LLVMDisposeTargetMachine(llvm)
218+
// }
218219
}

0 commit comments

Comments
 (0)