Open5

Explicit load/store type does not match pointee type of pointer operand

yharayhara

yhara/shiika で builtin.bc と examples/a.sk.bc をclangでリンクしようとしたところ

error: Explicit load/store type does not match pointee type of pointer operand (Producer: 'LLVM9.0.1' Reader: 'LLVM 9.0.1')
1 error generated.

というエラーになった。clang --verboseでも情報量は変わらず

yharayhara
def check(line)
  case line
  when /load (\S+)\*, (\S+)\*\*/
    puts line if $1 != $2
  when /store (\S+)\* \S+, (\S+)\*\*/
    puts line if $1 != $2
  end
end

File.open("builtin/builtin.ll").each_line do |line|
  if line =~ /load|store/
    check(line)
  end
end

とりあえずrubyでざっと調査

$ ruby ,/load_store_type.rb
  store %"Meta:Void"* %class_Void, %Void** @"::Void"

これか。

yharayhara

optコマンドの方が詳しいエラーを出すっぽい。

% opt builtin/builtin.ll > /dev/null
opt: builtin/builtin.ll:383:7: error: value doesn't match function result type '%Void*'
  ret %"Meta:Void"* %"::Void1"
      ^