Skip to content

Commit

Permalink
Merge branch 'master' into sk/nbsp
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Mar 12, 2022
2 parents 8154f95 + d291c8b commit c1a65ec
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ endif
ifeq ($(USEGCC),1)
CC := $(CROSS_COMPILE)gcc
CXX := $(CROSS_COMPILE)g++
JCFLAGS := -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCFLAGS := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
# AArch64 needs this flag to generate the .eh_frame used by libunwind
JCPPFLAGS := -fasynchronous-unwind-tables
JCXXFLAGS := -pipe $(fPIC) -fno-rtti -std=c++14
Expand All @@ -500,7 +500,7 @@ endif
ifeq ($(USECLANG),1)
CC := $(CROSS_COMPILE)clang
CXX := $(CROSS_COMPILE)clang++
JCFLAGS := -std=gnu99 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
JCFLAGS := -std=gnu11 -pipe $(fPIC) -fno-strict-aliasing -D_FILE_OFFSET_BITS=64
# AArch64 needs this flag to generate the .eh_frame used by libunwind
JCPPFLAGS := -fasynchronous-unwind-tables
JCXXFLAGS := -pipe $(fPIC) -fno-rtti -pedantic -std=c++14
Expand Down
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ Build system changes
New library functions
---------------------

Library changes
---------------

New library features
--------------------
* A known concurrency issue of `iterate` methods on `Dict` and other derived objects such
as `keys(::Dict)`, `values(::Dict)`, and `Set` is fixed. These methods of `iterate` can
now be called on a dictionary or set shared by arbitrary tasks provided that there are no
tasks mutating the dictionary or set ([#44534]).


Standard library changes
Expand Down
2 changes: 1 addition & 1 deletion base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ end

@propagate_inbounds _iterate(t::Dict{K,V}, i) where {K,V} = i == 0 ? nothing : (Pair{K,V}(t.keys[i],t.vals[i]), i == typemax(Int) ? 0 : i+1)
@propagate_inbounds function iterate(t::Dict)
_iterate(t, skip_deleted_floor!(t))
_iterate(t, skip_deleted(t, t.idxfloor))
end
@propagate_inbounds iterate(t::Dict, i) = _iterate(t, skip_deleted(t, i))

Expand Down
18 changes: 15 additions & 3 deletions base/twiceprecision.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,14 @@ end
step(r::StepRangeLen{T,TwicePrecision{T},TwicePrecision{T}}) where {T<:AbstractFloat} = T(r.step)
step(r::StepRangeLen{T,TwicePrecision{T},TwicePrecision{T}}) where {T} = T(r.step)

range_start_step_length(a, st::IEEEFloat, len::Integer) =
range_start_step_length(oftype(st, a), st, len)
range_start_step_length(a::Real, st::IEEEFloat, len::Integer) =
range_start_step_length(promote(a, st)..., len)

range_start_step_length(a::IEEEFloat, st::Real, len::Integer) =
range_start_step_length(promote(a, st)..., len)

range_start_step_length(a::IEEEFloat, st::IEEEFloat, len::Integer) =
range_start_step_length(promote(a, st)..., len)

function range_start_step_length(a::T, st::T, len::Integer) where T<:IEEEFloat
len = len + 0 # promote with Int
Expand All @@ -474,7 +480,13 @@ function range_start_step_length(a::T, st::T, len::Integer) where T<:IEEEFloat
steprangelen_hp(T, a, st, 0, len, 1)
end

function range_step_stop_length(step::IEEEFloat, stop, len::Integer)
range_step_stop_length(step::Real, stop::IEEEFloat, len::Integer) =
range_step_stop_length(promote(step, stop)..., len)

range_step_stop_length(step::IEEEFloat, stop::Real, len::Integer) =
range_step_stop_length(promote(step, stop)..., len)

function range_step_stop_length(step::IEEEFloat, stop::IEEEFloat, len::Integer)
r = range_start_step_length(stop, negate(step), len)
reverse(r)
end
Expand Down
2 changes: 1 addition & 1 deletion contrib/julia-config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ end

function cflags(doframework)
flags = IOBuffer()
print(flags, "-std=gnu99")
print(flags, "-std=gnu11")
if doframework
include = shell_escape(frameworkDir())
print(flags, " -F", include)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ac0a70456feb4e06acb355ff0d7d1e5d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
297c3b2afc50faad364d12992daecff0c92908d01d904a8f9470d05e1d139b726ddec36ceefc876b90313e3b034e59186c96bb6c72ff90efc403aa9db00510d2

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/abi_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ bool needPassByRef(jl_datatype_t *dt, AttrBuilder &ab, LLVMContext &ctx, Type *T
else if (jl_is_structtype(dt)) {
// spill to memory even though we would ordinarily pass
// it in registers
Type* Ty = preferred_llvm_type(dt, false, ctx);
ab.addByValAttr(Ty);
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,7 @@ std::string generate_func_sig(const char *fname)
}

// Whether or not LLVM wants us to emit a pointer to the data
assert(t && "LLVM type should not be null");
bool byRef = abi->needPassByRef((jl_datatype_t*)tti, ab, LLVMCtx, t);

if (jl_is_cpointer_type(tti)) {
Expand Down
1 change: 1 addition & 0 deletions src/support/ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define JL_IOS_H

#include <stdarg.h>
#include <sys/types.h>
#include "analyzer_annotations.h"

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg.version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_BRANCH = master
PKG_SHA1 = 544bb89495649376b1a91a90fe0b3f7d0758e42b
PKG_SHA1 = 53cefb5c6ce8ee2710b581825130c477b6dd5d96
PKG_GIT_URL := https://github.com/JuliaLang/Pkg.jl.git
PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1
46 changes: 44 additions & 2 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1618,9 +1618,51 @@ end
@test x == [0.0, 0.2, 0.4, 0.6, 0.8]
end

let x = @inferred range(stop=1, step=0.2, length=5)
let x = @inferred range(0.0, step=2, length=5)
@test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}
@test x == [0.2, 0.4, 0.6, 0.8, 1.0]
@test x == [0.0, 2.0, 4.0, 6.0, 8.0]
@test x === range(0.0, step=2.0, length=5)
@test x === range(0.0f0, step=2e0, length=5)
@test x === range(0e0, step=2.0f0, length=5)
end

# start::IEEEFloat and step::Complex
let x = @inferred range(2.0, step=1im, length=3)
@test typeof(x) === StepRangeLen{ComplexF64, Float64, Complex{Int}, Int}
@test x == range(2, step=1im, length=3) # compare with integer range
@test x == 2.0 .+ [0im, 1im, 2im]
end

# start::Complex and step::IEEEFloat
let x = @inferred range(2im, step=1.0, length=3)
@test typeof(x) === StepRangeLen{ComplexF64, Complex{Int}, Float64, Int}
@test x == range(2im, step=1, length=3) # compare with integer range
end

# stop::IEEEFloat and step::Complex
let x = @inferred range(stop=2.0, step=1im, length=3)
@test typeof(x) === StepRangeLen{ComplexF64, ComplexF64, Complex{Int}, Int}
@test x == range(stop=2, step=1im, length=3) # compare with integer range
@test x == 2.0 .- [2im, 1im, 0im]
end

# stop::Complex and step::IEEEFloat
let x = @inferred range(stop=2im, step=1.0, length=3)
@test typeof(x) === StepRangeLen{ComplexF64, ComplexF64, Float64, Int}
@test x == range(stop=2im, step=1, length=3) # compare with integer range
end

let x = @inferred range(stop=10, step=2.0, length=5)
@test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}
@test x === @inferred range(stop=10.0, step=2.0, length=5)
@test x === @inferred range(stop=10f0, step=2.0, length=5)
@test x === @inferred range(stop=10e0, step=2.0f0, length=5)
@test x == [2, 4, 6, 8, 10]
end

let x = @inferred range(stop=10.0, step=2, length=4)
@test x isa StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}
@test x == [4.0, 6.0, 8.0, 10.0]
end
end

Expand Down

0 comments on commit c1a65ec

Please sign in to comment.