File tree 1 file changed +16
-8
lines changed
1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,11 @@ public struct BasicBlock: IRValue {
63
63
}
64
64
}
65
65
66
- /// Deletes the basic block from its containing function.
67
- /// - note: This does not remove breaks to this block from the
68
- /// function. Ensure you have removed all instructions that reference
69
- /// this basic block before deleting it.
70
- public func delete( ) {
71
- LLVMDeleteBasicBlock ( llvm)
72
- }
73
-
74
66
/// Removes this basic block from a function but keeps it alive.
67
+ ///
68
+ /// - note: To ensure correct removal of the block, you must invalidate any
69
+ /// references to it and its child instructions. The block must also
70
+ /// have no successor blocks that make reference to it.
75
71
public func removeFromParent( ) {
76
72
LLVMRemoveBasicBlockFromParent ( llvm)
77
73
}
@@ -87,6 +83,18 @@ public struct BasicBlock: IRValue {
87
83
}
88
84
}
89
85
86
+ extension BasicBlock {
87
+ /// Deletes the basic block from its containing function.
88
+ /// - note: This does not remove breaks to this block from the
89
+ /// function. Ensure you have removed all instructions that reference
90
+ /// this basic block before deleting it.
91
+ @available ( * , deprecated, message: " it is hard to use correctly and will be removed. See BasicBlock.removeFromParent() instead " )
92
+ public func delete( ) {
93
+ LLVMDeleteBasicBlock ( llvm)
94
+ }
95
+
96
+ }
97
+
90
98
extension BasicBlock {
91
99
/// An `Address` represents a function-relative address of a basic block for
92
100
/// use with the `indirectbr` instruction.
You can’t perform that action at this time.
0 commit comments