Skip to content

Commit 48ce759

Browse files
committed
improve some method signatures
1 parent b490b84 commit 48ce759

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

base/compiler/optimize.jl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ function OptimizationState(linfo::MethodInstance, params::Params)
6666
return OptimizationState(linfo, src, params)
6767
end
6868

69-
include("compiler/ssair/driver.jl")
70-
7169
_topmod(sv::OptimizationState) = _topmod(sv.mod)
7270

7371
function update_valid_age!(min_valid::UInt, max_valid::UInt, sv::OptimizationState)
@@ -343,17 +341,15 @@ function finish(me::InferenceState)
343341
nothing
344342
end
345343

346-
function maybe_widen_conditional(vt)
347-
if isa(vt, Conditional)
348-
if vt.vtype === Bottom
349-
vt = Const(false)
350-
elseif vt.elsetype === Bottom
351-
vt = Const(true)
352-
else
353-
vt = Bool
354-
end
344+
maybe_widen_conditional(@nospecialize vt) = vt
345+
function maybe_widen_conditional(vt::Conditional)
346+
if vt.vtype === Bottom
347+
Const(false)
348+
elseif vt.elsetype === Bottom
349+
Const(true)
350+
else
351+
Bool
355352
end
356-
vt
357353
end
358354

359355
function annotate_slot_load!(e::Expr, vtypes::VarTable, sv::InferenceState, undefs::Array{Bool,1})
@@ -988,3 +984,5 @@ function return_type(@nospecialize(f), @nospecialize(t))
988984
end
989985
return rt
990986
end
987+
988+
include("compiler/ssair/driver.jl")

base/compiler/ssair/inlining2.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,9 @@ function singleton_type(@nospecialize(ft))
577577
return nothing
578578
end
579579

580-
function analyze_method!(idx, f, ft, metharg, methsp, method, stmt, atypes, sv, atype_unlimited, isinvoke, isapply, invoke_data,
581-
stmttyp)
580+
function analyze_method!(idx::Int, @nospecialize(f), @nospecialize(ft), @nospecialize(metharg), methsp::SimpleVector,
581+
method::Method, stmt::Expr, atypes::Vector{Any}, sv::OptimizationState, @nospecialize(atype_unlimited),
582+
isinvoke::Bool, isapply::Bool, invoke_data::Union{InvokeData,Nothing}, @nospecialize(stmttyp))
582583
methsig = method.sig
583584

584585
# Check whether this call just evaluates to a constant

0 commit comments

Comments
 (0)