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

deprecate intset to bitset #24282

Merged
merged 2 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Deprecate IntSet to BitSet.
  • Loading branch information
Sacha0 committed Oct 23, 2017
commit f8a44d52f80a120f7595995f8d6d8c31b84cf7dd
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ CORE_SRCS := $(addprefix $(JULIAHOME)/, \
base/hashing.jl \
base/inference.jl \
base/int.jl \
base/intset.jl \
base/bitset.jl \
base/number.jl \
base/operators.jl \
base/options.jl \
Expand Down
6 changes: 3 additions & 3 deletions base/codevalidation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ InvalidCodeError(kind::AbstractString) = InvalidCodeError(kind, nothing)
Validate `c`, logging any violation by pushing an `InvalidCodeError` into `errors`.
"""
function validate_code!(errors::Vector{>:InvalidCodeError}, c::CodeInfo, is_top_level::Bool = false)
ssavals = IntSet()
lhs_slotnums = IntSet()
ssavals = BitSet()
lhs_slotnums = BitSet()
walkast(c.code) do x
if isa(x, Expr)
!is_top_level && x.head == :method && push!(errors, InvalidCodeError(NON_TOP_LEVEL_METHOD))
Expand Down Expand Up @@ -86,7 +86,7 @@ function validate_code!(errors::Vector{>:InvalidCodeError}, c::CodeInfo, is_top_
end
end
elseif isa(x, SSAValue)
id = x.id + 1 # ensures that id > 0 for use with IntSet
id = x.id + 1 # ensures that id > 0 for use with BitSet
!in(id, ssavals) && push!(ssavals, id)
end
end
Expand Down
2 changes: 1 addition & 1 deletion base/coreimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ include("reduce.jl")

## core structures
include("bitarray.jl")
include("intset.jl")
include("bitset.jl")
include("associative.jl")

# core docsystem
Expand Down
6 changes: 3 additions & 3 deletions base/dates/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ end

# Total number of a day of week in the month
# e.g. are there 4 or 5 Mondays in this month?
const TWENTYNINE = IntSet([1, 8, 15, 22, 29])
const THIRTY = IntSet([1, 2, 8, 9, 15, 16, 22, 23, 29, 30])
const THIRTYONE = IntSet([1, 2, 3, 8, 9, 10, 15, 16, 17, 22, 23, 24, 29, 30, 31])
const TWENTYNINE = BitSet([1, 8, 15, 22, 29])
const THIRTY = BitSet([1, 2, 8, 9, 15, 16, 22, 23, 29, 30])
const THIRTYONE = BitSet([1, 2, 3, 8, 9, 10, 15, 16, 17, 22, 23, 24, 29, 30, 31])

"""
daysofweekinmonth(dt::TimeType) -> Int
Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,9 @@ end
# issue #24006
@deprecate linearindices(s::AbstractString) eachindex(s)

# deprecate IntSet to BitSet
@deprecate_binding IntSet BitSet

# Issue 24219
@deprecate float(x::AbstractString) parse(Float64, x)
@deprecate float(a::AbstractArray{<:AbstractString}) parse.(Float64, a)
Expand Down
4 changes: 2 additions & 2 deletions base/distributed/process_messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
def_rv_channel() = Channel(1)
mutable struct RemoteValue
c::AbstractChannel
clientset::IntSet # Set of workerids that have a reference to this channel.
clientset::BitSet # Set of workerids that have a reference to this channel.
# Keeping ids instead of a count aids in cleaning up upon
# a worker exit.

waitingfor::Int # processor we need to hear from to fill this, or 0

RemoteValue(c) = new(c, IntSet(), 0)
RemoteValue(c) = new(c, BitSet(), 0)
end

wait(rv::RemoteValue) = wait(rv.c)
Expand Down
2 changes: 1 addition & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export
IndexLinear,
IndexStyle,
InsertionSort,
IntSet,
BitSet,
IOBuffer,
IOStream,
LinSpace,
Expand Down
18 changes: 9 additions & 9 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ mutable struct InferenceState
# return type
bestguess #::Type
# current active instruction pointers
ip::IntSet
ip::BitSet
pc´´::LineNum
nstmts::Int
# current exception handler info
cur_hand #::Tuple{LineNum, Tuple{LineNum, ...}}
handler_at::Vector{Any}
n_handlers::Int
# ssavalue sparsity and restart info
ssavalue_uses::Vector{IntSet}
ssavalue_uses::Vector{BitSet}
ssavalue_defs::Vector{LineNum}
vararg_type_container #::Type

Expand Down Expand Up @@ -254,7 +254,7 @@ mutable struct InferenceState
handler_at = Any[ () for i=1:n ]
n_handlers = 0

W = IntSet()
W = BitSet()
push!(W, 1) #initial pc to visit

if !toplevel
Expand Down Expand Up @@ -2926,15 +2926,15 @@ end


function find_ssavalue_uses(body::Vector{Any}, nvals::Int)
uses = IntSet[ IntSet() for i = 1:nvals ]
uses = BitSet[ BitSet() for i = 1:nvals ]
for line in 1:length(body)
e = body[line]
isa(e, Expr) && find_ssavalue_uses(e, uses, line)
end
return uses
end

function find_ssavalue_uses(e::Expr, uses::Vector{IntSet}, line::Int)
function find_ssavalue_uses(e::Expr, uses::Vector{BitSet}, line::Int)
head = e.head
is_meta_expr_head(head) && return
skiparg = (head === :(=))
Expand Down Expand Up @@ -5805,7 +5805,7 @@ function getfield_elim_pass!(sv::OptimizationState)
end
end

function _getfield_elim_pass!(e::Expr, ssa_defs::Vector{LineNum}, ssa_uses::Vector{IntSet}, sv::OptimizationState)
function _getfield_elim_pass!(e::Expr, ssa_defs::Vector{LineNum}, ssa_uses::Vector{BitSet}, sv::OptimizationState)
nargs = length(e.args)
for i = 1:nargs
e.args[i] = _getfield_elim_pass!(e.args[i], ssa_defs, ssa_uses, sv)
Expand Down Expand Up @@ -5870,7 +5870,7 @@ function _getfield_elim_pass!(e::Expr, ssa_defs::Vector{LineNum}, ssa_uses::Vect
return e
end

_getfield_elim_pass!(@nospecialize(e), ssa_defs::Vector{LineNum}, ssa_uses::Vector{IntSet}, sv::OptimizationState) = e
_getfield_elim_pass!(@nospecialize(e), ssa_defs::Vector{LineNum}, ssa_uses::Vector{BitSet}, sv::OptimizationState) = e

# check if e is a successful allocation of an struct
# if it is, returns (n,f) such that it is always valid to call
Expand Down Expand Up @@ -5928,8 +5928,8 @@ end
function basic_dce_pass!(sv::OptimizationState)
body = sv.src.code
labelmap = get_label_map(body)
reachable = IntSet()
W = IntSet()
reachable = BitSet()
W = BitSet()
push!(W, 1)
while !isempty(W)
pc = pop!(W)
Expand Down
Loading