Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk authored Sep 1, 2021
1 parent d82a604 commit c72feb1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/interpreter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,25 @@ function Compiler.transform_result_for_cache(interp::CthulhuInterpreter, linfo::
return inferred_result
end

# branch on https://github.com/JuliaLang/julia/pull/41328
@static if isdefined(Compiler, :is_stmt_inline)
function Compiler.inlining_policy(interp::CthulhuInterpreter, @nospecialize(src), stmt_flag::UInt8)
@assert isa(src, OptimizedSource) || isnothing(src)
if isa(src, OptimizedSource)
if Compiler.is_stmt_inline(stmt_flag) || src.isinlineable
return src.ir
end
end
return nothing
end
else # @static if isdefined(Compiler, :is_stmt_inline)
function Compiler.inlining_policy(interp::CthulhuInterpreter)
function (src)
@assert isa(src, OptimizedSource)
return src.isinlineable ? src.ir : nothing
end
end
end # @static if isdefined(Compiler, :is_stmt_inline)

function Compiler.finish!(interp::CthulhuInterpreter, caller::InferenceResult)
src = caller.src
Expand Down

0 comments on commit c72feb1

Please sign in to comment.