c++ - Usage of AllocaInst with example: LLVM -
i new llvm , know proper usage of allocainst examples. tried searching online , llvm webpage not have right examples it. below patch of code trying execute.
string temp =(dyn_cast<constantint>operand0))->getvalue()).tostring(10,true); type* = integertype::getint32ty(f.getcontext()); string name = "t"+to_string(++counter); allocainst* variable = new allocainst(a,null,4,name,&*inst);
when run this, error:
error:no matching function call 'llvm::allocainst::allocainst(llvm::type*&, null, int, std::string&, llvm::instruction*)' allocainst* variable = new allocainst(a,null,4,name,&*inst);
i know how provide address location in allcainst. appreciated.
you cannot initialize array way. problem of code array size. allocainst
expects llvm::value*
array size, i.e., size must live in ir. constant 4 have use constantint::get
create constant integer value in ir. constantint*
can provided allocainst constructor.
wiki
Comments
Post a Comment