Skip to content

Commit e980433

Browse files
authored
Quick adaptation to new pm (#1538)
* Quick adaptation to new pm * fixup * fix passes * effects * fix versioning * more fixes * fixup * add gcloaded fb * Update utils.jl * more 1.11 * Update utils.jl * Update utils.jl * Update compiler.jl
1 parent 53f64a6 commit e980433

File tree

7 files changed

+887
-160
lines changed

7 files changed

+887
-160
lines changed

src/absint.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,20 +323,25 @@ function abs_typeof(arg::LLVM.Value, partial::Bool=false)::Union{Tuple{Bool, Typ
323323
end
324324

325325
function abs_cstring(arg::LLVM.Value)::Tuple{Bool,String}
326-
327326
if isa(arg, ConstantExpr)
328327
ce = arg
329328
while isa(ce, ConstantExpr)
330329
if opcode(ce) == LLVM.API.LLVMAddrSpaceCast || opcode(ce) == LLVM.API.LLVMBitCast || opcode(ce) == LLVM.API.LLVMIntToPtr
331330
ce = operands(ce)[1]
331+
elseif opcode(ce) == LLVM.API.LLVMGetElementPtr
332+
if all(x -> isa(x, LLVM.ConstantInt) && convert(UInt, x) == 0, operands(ce)[2:end])
333+
ce = operands(ce)[1]
334+
else
335+
break
336+
end
332337
else
333338
break
334339
end
335340
end
336341
if isa(ce, LLVM.GlobalVariable)
337342
ce = LLVM.initializer(ce)
338343
if (isa(ce, LLVM.ConstantArray) || isa(ce, LLVM.ConstantDataArray)) && eltype(value_type(ce)) == LLVM.IntType(8)
339-
return (true, String(map((x)->convert(UInt8, x), collect(flib)[1:(end-1)])))
344+
return (true, String(map((x)->convert(UInt8, x), collect(ce)[1:(end-1)])))
340345
end
341346

342347
end

src/compiler.jl

Lines changed: 166 additions & 54 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)