2017-08-08 117 views
0

讀取元數據我有一個LLVM IR指令如下:store i32 %i.0, i32* %arrayidx, align 4 !0 注意,我連接元數據!0到指令。而對於我的目的,這代表我已經聲明如下元數據字符串: !0 = !{!"hello"} 現在我嘗試閱讀本使用 if (Inst.getMetadata("hello")) 錯誤而在LLVM IR

然而,在執行這個,我得到以下錯誤: opt: <stdin>:32:43: error: expected instruction opcode store i32 %i.0, i32* %arrayidx, align 4 !0
燦有人請指出,我在這裏可能做錯了什麼?

回答

0

只是發佈,以幫助任何人堅持相同的問題。 元數據需要一個名稱。所以這個工程: store i32 %i.0, i32* %arrayidx, align 4, !my_metadata !0