Skip to content

Commit

Permalink
add ir_check_ignore metadata to check ir type check
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Sep 17, 2024
1 parent bbd6124 commit 4d99de5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ function check_ir_values(mod::LLVM.Module, T_bad::LLVMType)
errors = IRError[]

for fun in functions(mod), bb in blocks(fun), inst in instructions(bb)
if value_type(inst) == T_bad || any(param->value_type(param) == T_bad, operands(inst))
if value_type(inst) == T_bad && !haskey(metadata(inst), "ir_check_ignore") ||
any(op -> value_type(op) == T_bad && !(op isa Instruction && haskey("ir_check_ignore", metadata(op))), operands(inst))
bt = backtrace(inst)
push!(errors, ("use of $(string(T_bad)) value", bt, inst))
end
Expand Down

0 comments on commit 4d99de5

Please sign in to comment.