We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 22000f1 + d56bbdf commit 75f3bb5Copy full SHA for 75f3bb5
Sources/LLVM/IRGlobal.swift
@@ -57,4 +57,17 @@ extension IRGlobal {
57
}
58
set { LLVMSetSection(asLLVM(), newValue) }
59
60
+
61
+ /// Removes this global value from the module and deallocates it.
62
+ ///
63
+ /// - note: To ensure correct removal of the global value, you must invalidate
64
+ /// any references to it - usually by performing an
65
+ /// "Replace All Uses With" (RAUW) operation.
66
67
+ /// - warning: The native Swift object wrapping this global becomes a dangling
68
+ /// reference once this function has been invoked. It is
69
+ /// recommended that all references to it be dropped immediately.
70
+ public func eraseFromParent() {
71
+ LLVMDeleteGlobal(self.asLLVM())
72
+ }
73
0 commit comments