Skip to content

Commit

Permalink
compiler: NFC changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Jul 13, 2022
1 parent 4965950 commit 7bab5d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,13 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
add_remark!(interp, sv, "Refusing to infer into `depwarn`")
return MethodCallResult(Any, false, false, nothing, Effects())
end
topmost = nothing

# Limit argument type tuple growth of functions:
# look through the parents list to see if there's a call to the same method
# and from the same method.
# Returns the topmost occurrence of that repeated edge.
edgecycle = false
edgelimited = false
edgecycle = edgelimited = false
topmost = nothing

for infstate in InfStackUnwind(sv)
if method === infstate.linfo.def
Expand Down
11 changes: 4 additions & 7 deletions base/compiler/ssair/passes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -916,14 +916,11 @@ function sroa_pass!(ir::IRCode, inlining::Union{Nothing, InliningState} = nothin
visited_phinodes, field, lifting_cache, result_t, lifted_leaves, val, lazydomtree)

# Insert the undef check if necessary
if any_undef
if val === nothing
insert_node!(compact, SSAValue(idx),
non_effect_free(NewInstruction(Expr(:throw_undef_if_not, Symbol("##getfield##"), false), Nothing)))
else
# val must be defined
end
if any_undef && val === nothing
insert_node!(compact, SSAValue(idx), non_effect_free(NewInstruction(
Expr(:throw_undef_if_not, Symbol("##getfield##"), false), Nothing)))
else
# val must be defined
@assert val !== nothing
end

Expand Down
4 changes: 2 additions & 2 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1192,8 +1192,8 @@ function print_fullname(io::IO, m::Module)
end
end

function sourceinfo_slotnames(src::CodeInfo)
slotnames = src.slotnames
sourceinfo_slotnames(src::CodeInfo) = sourceinfo_slotnames(src.slotnames)
function sourceinfo_slotnames(slotnames::Vector{Symbol})
names = Dict{String,Int}()
printnames = Vector{String}(undef, length(slotnames))
for i in eachindex(slotnames)
Expand Down

0 comments on commit 7bab5d5

Please sign in to comment.