Skip to content

Commit

Permalink
give back to IntSet its original name
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Dec 11, 2017
1 parent 265ea56 commit b98c876
Show file tree
Hide file tree
Showing 22 changed files with 230 additions and 228 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ CORE_SRCS := $(addprefix $(JULIAHOME)/, \
base/hashing.jl \
base/inference.jl \
base/int.jl \
base/bitset.jl \
base/intset.jl \
base/number.jl \
base/operators.jl \
base/options.jl \
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ Library improvements
definition relies on `ncodeunits` however, so for optimal performance you may need to
define a custom method for that function.

* `IntSet` now lives up to its premise and can store any `Int`.

Compiler/Runtime improvements
-----------------------------

Expand Down
6 changes: 3 additions & 3 deletions base/codevalidation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ 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 BitSet
id = x.id + 1 # ensures that id > 0 for use with IntSet
!in(id, ssavals) && push!(ssavals, id)
end
end

ssavals = BitSet()
lhs_slotnums = BitSet()
ssavals = IntSet()
lhs_slotnums = IntSet()
for x in c.code
if isa(x, Expr)
head = x.head
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("bitset.jl")
include("intset.jl")
include("associative.jl")
include("namedtuple.jl")

Expand Down
4 changes: 2 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2058,8 +2058,8 @@ end
@deprecate Vector(m::Integer) Vector(uninitialized, m)
@deprecate Matrix(m::Integer, n::Integer) Matrix(uninitialized, m, n)

# deprecate IntSet to BitSet
@deprecate_binding IntSet BitSet
# deprecate BitSet to IntSet
@deprecate_binding BitSet IntSet

# Issue 24219
@deprecate float(x::AbstractString) parse(Float64, x)
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::BitSet # Set of workerids that have a reference to this channel.
clientset::IntSet # 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, BitSet(), 0)
RemoteValue(c) = new(c, IntSet(), 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 @@ -68,7 +68,7 @@ export
IndexLinear,
IndexStyle,
InsertionSort,
BitSet,
IntSet,
IOBuffer,
IOStream,
LinSpace,
Expand Down
14 changes: 7 additions & 7 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ mutable struct InferenceState
# return type
bestguess #::Type
# current active instruction pointers
ip::BitSet
ip::IntSet
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{BitSet}
ssavalue_uses::Vector{IntSet}
ssavalue_defs::Vector{LineNum}
vararg_type_container #::Type

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

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

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


function find_ssavalue_uses(body::Vector{Any}, nvals::Int)
uses = BitSet[ BitSet() for i = 1:nvals ]
uses = IntSet[ IntSet() 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{BitSet}, line::Int)
function find_ssavalue_uses(e::Expr, uses::Vector{IntSet}, line::Int)
head = e.head
is_meta_expr_head(head) && return
skiparg = (head === :(=))
Expand Down Expand Up @@ -5671,8 +5671,8 @@ end
function basic_dce_pass!(sv::OptimizationState)
body = sv.src.code
labelmap = get_label_map(body)
reachable = BitSet()
W = BitSet()
reachable = IntSet()
W = IntSet()
push!(W, 1)
while !isempty(W)
pc = pop!(W)
Expand Down
Loading

0 comments on commit b98c876

Please sign in to comment.