Skip to content

Commit

Permalink
improve some method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jun 12, 2018
1 parent 12abe05 commit 83ce7ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
22 changes: 10 additions & 12 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ function OptimizationState(linfo::MethodInstance, params::Params)
return OptimizationState(linfo, src, params)
end

include("compiler/ssair/driver.jl")

_topmod(sv::OptimizationState) = _topmod(sv.mod)

function update_valid_age!(min_valid::UInt, max_valid::UInt, sv::OptimizationState)
Expand Down Expand Up @@ -343,17 +341,15 @@ function finish(me::InferenceState)
nothing
end

function maybe_widen_conditional(vt)
if isa(vt, Conditional)
if vt.vtype === Bottom
vt = Const(false)
elseif vt.elsetype === Bottom
vt = Const(true)
else
vt = Bool
end
maybe_widen_conditional(@nospecialize vt) = vt
function maybe_widen_conditional(vt::Conditional)
if vt.vtype === Bottom
Const(false)
elseif vt.elsetype === Bottom
Const(true)
else
Bool
end
vt
end

function annotate_slot_load!(e::Expr, vtypes::VarTable, sv::InferenceState, undefs::Array{Bool,1})
Expand Down Expand Up @@ -988,3 +984,5 @@ function return_type(@nospecialize(f), @nospecialize(t))
end
return rt
end

include("compiler/ssair/driver.jl")
5 changes: 3 additions & 2 deletions base/compiler/ssair/inlining2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,9 @@ function singleton_type(@nospecialize(ft))
return nothing
end

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

# Check whether this call just evaluates to a constant
Expand Down

0 comments on commit 83ce7ba

Please sign in to comment.