我是 LLVM 的初学者。
我正在尝试将元数据添加到说明中。我尝试使用LLVM-Source Level Debugging中的以下代码:
if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM instruction
DILocation Loc(N); // DILocation is in DebugInfo.h
unsigned Line = Loc.getLineNumber();
StringRef File = Loc.getFilename();
StringRef Dir = Loc.getDirectory();
}
I
in的数据类型是I->getMetadata("dbg")
什么?我应该如何定义I
?
谢谢 :)