Skip to content

Commit

Permalink
use static if everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
willtebbutt committed Nov 23, 2024
1 parent 22ea3a1 commit ff93384
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/interpreter/abstract_interpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function CC.method_table(interp::MooncakeInterpreter)
return CC.OverlayMethodTable(interp.world, mooncake_method_table)
end

if VERSION < v"1.11.0"
@static if VERSION < v"1.11.0"
CC.get_world_counter(interp::MooncakeInterpreter) = interp.world
get_inference_world(interp::CC.AbstractInterpreter) = CC.get_world_counter(interp)
else
Expand Down Expand Up @@ -160,7 +160,7 @@ function Core.Compiler.abstract_call_gf_by_type(
end
end

if VERSION < v"1.11-"
@static if VERSION < v"1.11-"

function CC.inlining_policy(
interp::MooncakeInterpreter{C},
Expand Down
2 changes: 1 addition & 1 deletion src/interpreter/ir_normalisation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ __get_arg(x::QuoteNode) = x.value
__get_arg(x) = x

# memoryrefget and memoryrefset! were introduced in 1.11.
if VERSION >= v"1.11-"
@static if VERSION >= v"1.11-"

"""
lift_memoryrefget_and_memoryrefset_builtins(inst)
Expand Down
4 changes: 2 additions & 2 deletions src/interpreter/ir_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function optimise_ir!(ir::IRCode; show_ir=false, do_inline=true)
ir = __strip_coverage!(ir)
ir = CC.sroa_pass!(ir, inline_state)

if VERSION < v"1.11-"
@static if VERSION < v"1.11-"

Check warning on line 193 in src/interpreter/ir_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/interpreter/ir_utils.jl#L193

Added line #L193 was not covered by tests
ir = CC.adce_pass!(ir, inline_state)
else
ir, _ = CC.adce_pass!(ir, inline_state)
Expand Down Expand Up @@ -227,7 +227,7 @@ function lookup_ir(interp::CC.AbstractInterpreter, tt::Type{<:Tuple}; optimize_u
asts = []
for match in get_matches(matches.matches)
match = match::Core.MethodMatch
if VERSION < v"1.11-"
@static if VERSION < v"1.11-"

Check warning on line 230 in src/interpreter/ir_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/interpreter/ir_utils.jl#L230

Added line #L230 was not covered by tests
meth = Base.func_for_method_checked(match.method, tt, match.sparams)
(code, ty) = CC.typeinf_ircode(
interp, meth, match.spec_types, match.sparams, optimize_until
Expand Down
2 changes: 1 addition & 1 deletion src/rrules/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Required to avoid an ambiguity.
@zero_adjoint MinimalCtx Tuple{Type{Symbol}, TypeVar, Type}

if VERSION >= v"1.11-"
@static if VERSION >= v"1.11-"
@zero_adjoint MinimalCtx Tuple{typeof(Random.hash_seed), Vararg}
@zero_adjoint MinimalCtx Tuple{typeof(Base.dataids), Memory}
end
Expand Down

0 comments on commit ff93384

Please sign in to comment.