Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to https://github.com/JuliaLang/julia/pull/41328 #223

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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