Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Llvm 如何在循环过程中获取模块?我需要它来做模块-getOrInsertFunction_Llvm_Llvm Ir_Llvm C++ Api - Fatal编程技术网

Llvm 如何在循环过程中获取模块?我需要它来做模块-getOrInsertFunction

Llvm 如何在循环过程中获取模块?我需要它来做模块-getOrInsertFunction,llvm,llvm-ir,llvm-c++-api,Llvm,Llvm Ir,Llvm C++ Api,如何在循环过程中获取模块?我需要它来做模块-getOrInsertFunction 使用循环'L' void Mypass::fillPrintfunctions(Loop *L) { Module *M = L->getPreheader()->getParent()->getParent() ; Constant *PrintFunc; PrintFunc = M->getOrInsertFunction("Print", Type::getV

如何在循环过程中获取模块?我需要它来做模块-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;
 }
导致错误:“类llvm::模块”的转发声明
类模块

请给我们看更多的代码。对不起,我犯了错误,我已经包含了llvm/IR/Module.h,但是编译了一个旧文件。它现在可以正常工作了。