LoopPass 内でモジュールを取得するにはどうすればよいですか? モジュールを実行するために必要です - getOrInsertFunction?
ループ「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 is Function *Fprint defined in Mypass;
}
bool Mypass:: runOnLoop(Loop *L, LPPassManager &LPM)
{
if(!filled){
fillPrintfunctions(L);
}
return true;
}
結果はエラーになります: 'class llvm::Module' Class Module の前方宣言。