From 0bb9cb500a59752d15e4a4a16332dd6549d6f9b4 Mon Sep 17 00:00:00 2001 From: jumerckx Date: Mon, 3 Jun 2024 00:19:46 +0200 Subject: [PATCH] linetable is stored in debuginfo field now --- examples/brutus.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/brutus.jl b/examples/brutus.jl index f1203656..80923cbf 100644 --- a/examples/brutus.jl +++ b/examples/brutus.jl @@ -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] @@ -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)