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

Use VersionNumber for libllvm_version #21898

Merged
merged 2 commits into from
May 31, 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
2 changes: 1 addition & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ else
endif
@echo "const libfftw_name = \"$(LIBFFTWNAME)\"" >> $@
@echo "const libfftwf_name = \"$(LIBFFTWFNAME)\"" >> $@
@echo "const libllvm_version = \"$$($(LLVM_CONFIG_HOST) --version)\"" >> $@
@echo "const libllvm_version_string = \"$$($(LLVM_CONFIG_HOST) --version)\"" >> $@
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible to avoid occupying two names in base, would be better to do the VersionNumber conversion here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, but there isn't a way to do this without making unnecessary changes/shuffling of files. VERSION_STRING follows the same strategy as in this PR.

Any opinions on the uppercasing (in regards to consistency) ?

@echo "const VERSION_STRING = \"$(JULIA_VERSION)\"" >> $@
@echo "const TAGGED_RELEASE_BANNER = \"$(TAGGED_RELEASE_BANNER)\"" >> $@
@echo "const SYSCONFDIR = \"$(sysconfdir_rel)\"" >> $@
Expand Down
6 changes: 3 additions & 3 deletions base/atomics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export
# Disable 128-bit types on 32-bit Intel sytems due to LLVM problems;
# see <https://github.com/JuliaLang/julia/issues/14818> (fixed on LLVM 3.9)
# 128-bit atomics do not exist on AArch32.
if (VersionNumber(Base.libllvm_version) < v"3.9-" && ARCH === :i686) ||
if (Base.libllvm_version < v"3.9-" && ARCH === :i686) ||
startswith(string(ARCH), "arm")
const inttypes = (Int8, Int16, Int32, Int64,
UInt8, UInt16, UInt32, UInt64)
Expand Down Expand Up @@ -330,8 +330,8 @@ alignment(::Type{T}) where {T} = ccall(:jl_alignment, Cint, (Csize_t,), sizeof(T
for typ in atomictypes
lt = llvmtypes[typ]
ilt = llvmtypes[inttype(typ)]
rt = VersionNumber(Base.libllvm_version) >= v"3.6" ? "$lt, $lt*" : "$lt*"
irt = VersionNumber(Base.libllvm_version) >= v"3.6" ? "$ilt, $ilt*" : "$ilt*"
rt = Base.libllvm_version >= v"3.6" ? "$lt, $lt*" : "$lt*"
irt = Base.libllvm_version >= v"3.6" ? "$ilt, $ilt*" : "$ilt*"
if VersionNumber(Base.libllvm_version) >= v"3.8"
@eval getindex(x::Atomic{$typ}) =
llvmcall($"""
Expand Down
2 changes: 2 additions & 0 deletions base/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ catch e
VersionNumber(0)
end

libllvm_version = convert(VersionNumber, libllvm_version_string)

function banner(io::IO = STDOUT)
if GIT_VERSION_INFO.tagged_commit
commit_string = TAGGED_RELEASE_BANNER
Expand Down
2 changes: 1 addition & 1 deletion test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ let exename = `$(Base.julia_cmd()) --precompiled=yes --startup-file=no`
# issue #12671, starting from a non-directory
# rm(dir) fails on windows with Permission denied
# and was an upstream bug in llvm <= v3.3
if !is_windows() && VersionNumber(Base.libllvm_version) > v"3.3"
if !is_windows() && Base.libllvm_version > v"3.3"
testdir = mktempdir()
cd(testdir) do
rm(testdir)
Expand Down
2 changes: 1 addition & 1 deletion test/llvmcall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ module ObjLoadTest
end

# Test for proper parenting
if VersionNumber(Base.libllvm_version) >= v"3.6" # llvm 3.6 changed the syntax for a gep, so just ignore this test on older versions
if Base.libllvm_version >= v"3.6" # llvm 3.6 changed the syntax for a gep, so just ignore this test on older versions
local foo
function foo()
# this IR snippet triggers an optimization relying
Expand Down