Skip to content

Commit

Permalink
linetable is stored in debuginfo field now
Browse files Browse the repository at this point in the history
  • Loading branch information
jumerckx committed Jun 2, 2024
1 parent 731730b commit 0bb9cb5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/brutus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ function code_mlir(f, types)
for sidx in bb.stmts
stmt = ir.stmts[sidx]
inst = stmt[:inst]
line = ir.linetable[stmt[:line]+1]
line = @static if VERSION <= v"1.11"
ir.linetable[stmt[:line]+1]
else
ir.debuginfo.linetable[stmt[:line]+1]
end

if Meta.isexpr(inst, :call)
val_type = stmt[:type]
Expand Down Expand Up @@ -186,7 +190,11 @@ function code_mlir(f, types)
cond_br = cf.cond_br(cond, true_args, false_args; trueDest=other_dest, falseDest=dest, location)
push!(current_block, cond_br)
elseif inst isa ReturnNode
line = ir.linetable[stmt[:line]+1]
line = @static if VERSION < v"1.12"
ir.linetable[stmt[:line]+1]
else
ir.debuginfo.linetable[stmt[:line]+1]
end
location = Location(string(line.file), line.line, 0)
push!(current_block, func.return_([get_value(inst.val)]; location))
elseif Meta.isexpr(inst, :code_coverage_effect)
Expand Down

0 comments on commit 0bb9cb5

Please sign in to comment.