Skip to content

Commit 6589790

Browse files
authored
Delete function bodies instead of replacing them. (#239)
1 parent 8f2e555 commit 6589790

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/driver.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,7 @@ const __llvm_initialized = Ref(false)
197197
f == entry && continue
198198
isdeclaration(f) && continue
199199
LLVM.isintrinsic(f) && continue
200-
# FIXME: expose llvm::Function::deleteBody with a C API
201-
fn = LLVM.name(f)
202-
LLVM.name!(f, "")
203-
f′ = LLVM.Function(ir, fn, eltype(llvmtype(f)))
204-
# copying attributes is broken due to maleadt/LLVM.jl#186,
205-
# but that doesn't matter because `only_entry` is only used for reflection,
206-
# and the emitted code has already been optimized at this point.
207-
replace_uses!(f, f′)
200+
empty!(f)
208201
end
209202
end
210203

0 commit comments

Comments
 (0)