Skip to content

Commit 81d4546

Browse files
S-D-Rmaleadt
authored andcommitted
Do not use for compatibility with julia 1.0
1 parent 9a08ccb commit 81d4546

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

COVERAGE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ Core
432432
- [ ] LLVMConstString
433433
- [ ] LLVMIsConstantString
434434
- [ ] LLVMGetAsString
435-
- [ ] LLVMConstStructInContext
436-
- [ ] LLVMConstStruct
437-
- [ ] LLVMConstArray
438-
- [ ] LLVMConstNamedStruct
435+
- [x] LLVMConstStructInContext
436+
- [x] LLVMConstStruct
437+
- [x] LLVMConstArray
438+
- [x] LLVMConstNamedStruct
439439
- [ ] LLVMGetElementAsConstant
440440
- [ ] LLVMConstVector
441441

src/core/value/constant.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ function ConstantArray(typ::LLVMType, data::AbstractArray{T,N}) where {T<:Consta
128128
return ConstantArray(API.LLVMConstArray(typ, Array(data), length(data)))
129129
end
130130

131-
ca_vec = map(x->ConstantArray(typ, x), eachslice(data, dims=1))
131+
# FIXME: once we drop support for julia 1.0, we can use `eachslice(data, dims=1)` instead of this monstrosity
132+
ca_vec = map(x->ConstantArray(typ, x), (view(data, i, ntuple(d->(:), N-1)...) for i in axes(data, 1)))
132133
ca_typ = llvmtype(first(ca_vec))
133134

134135
return ConstantArray(API.LLVMConstArray(ca_typ, ca_vec, length(ca_vec)))

0 commit comments

Comments
 (0)