【发布时间】:2020-02-01 02:52:29
【问题描述】:
我是 llvm 的新手。我正在尝试添加新指令
namespace{
struct insert:public FunctionPass{
static char ID;
insert():FunctionPass(ID){
}
bool runOnFunction(Function &F) override{
errs()<<"Inserting new instruction\n";
auto *pa = new AllocaInst(Type::Int32Ty,0,"new_inst");
//auto *pa = new AllocaInst(llvm::Int32Ty, 0, "indexLoc");
return false;
}
};
}
char insert::ID =0;
static RegisterPass<insert>P("insert","inserting new instruction");
得到错误 /Users/chandanj/llvm/llvm-9.0.0.src/lib/Transforms/Hello/Hello.cpp:89:33:错误:'llvm::Type'中没有名为'Int32Ty'的成员 auto *pa = new AllocaInst(Type::Int32Ty,0,"new_inst"); ~~~~~~^
我使用的是 macbook air。 阅读 llvm 程序员手册
【问题讨论】:
标签: llvm llvm-clang