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

compiler: Get rid of has_struct_const_info #46564

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
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
8 changes: 1 addition & 7 deletions base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1583,12 +1583,6 @@ function apply_type_tfunc(@nospecialize(headtypetype), @nospecialize args...)
end
add_tfunc(apply_type, 1, INT_INF, apply_type_tfunc, 10)

function has_struct_const_info(x)
isa(x, PartialTypeVar) && return true
isa(x, Conditional) && return true
return has_nontrivial_const_info(x)
end

# convert the dispatch tuple type argtype to the real (concrete) type of
# the tuple of those values
function tuple_tfunc(argtypes::Vector{Any})
Expand All @@ -1607,7 +1601,7 @@ function tuple_tfunc(argtypes::Vector{Any})
anyinfo = false
for i in 1:length(argtypes)
x = argtypes[i]
if has_struct_const_info(x)
if has_nontrivial_const_info(x)
anyinfo = true
else
if !isvarargtype(x)
Expand Down
1 change: 1 addition & 0 deletions base/compiler/typeutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ end
function has_nontrivial_const_info(@nospecialize t)
isa(t, PartialStruct) && return true
isa(t, PartialOpaque) && return true
isa(t, PartialTypeVar) && return true
isa(t, Const) || return false
val = t.val
return !isdefined(typeof(val), :instance) && !(isa(val, Type) && hasuniquerep(val))
Expand Down