From 56df665622629aab47999824e55a035ac41085fd Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Fri, 4 Feb 2022 02:27:36 +0000 Subject: [PATCH] Make use of Base.donotdelete if available Goes with https://github.com/JuliaLang/julia/pull/44036. --- src/execution.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/execution.jl b/src/execution.jl index d2346a66..773eec8f 100644 --- a/src/execution.jl +++ b/src/execution.jl @@ -479,6 +479,9 @@ function generate_benchmark_definition(eval_module, out_vars, setup_vars, quote_ invocation = :($(Expr(:tuple, out_vars...)) = $(signature)) core_body = :($(core); $(returns)) end + if isdefined(Base, :donotdelete) + invocation = :(Base.donotdelete($invocation)) + end return Core.eval(eval_module, quote @noinline $(signature_def) = begin $(core_body) end @noinline function $(samplefunc)($(Expr(:tuple, quote_vars...)), __params::$BenchmarkTools.Parameters) @@ -611,4 +614,4 @@ macro bprofile(args...) $BenchmarkTools.Profile.clear() $BenchmarkTools.@profile $BenchmarkTools.run($tmp) end) -end \ No newline at end of file +end