llvm - How do i get Module inside a LoopPass? I need it to do Module - getOrInsertFunction -
how module within looppass? need module - getorinsertfunction?
using loop 'l'
void mypass::fillprintfunctions(loop *l) { module *m = l->getpreheader()->getparent()->getparent() ; constant *printfunc; printfunc = m->getorinsertfunction("print", type::getvoidty(m->getcontext()), (type*)0); fprint= cast<function>(printfunc);//fprint function *fprint defined in mypass; } bool mypass:: runonloop(loop *l, lppassmanager &lpm) { if(!filled){ fillprintfunctions(l); } homecoming true; }
results in error: forwards declaration of 'class llvm::module' class module;
llvm llvm-ir llvm-c++-api
No comments:
Post a Comment