LLVM error accessing loopinfo in function pass

心不动则不痛 提交于 2019-12-06 19:42:35
user3908054

If you use it in a Module:

LoopInfo &li = getAnalysis<LoopInfo>(F)

If you use it in a function:

LoopInfo &li = getAnalysis<LoopInfo>()

I had this question before. After searching several answers, I found the solution. You should change the location of the two statements below:

    PM.add(new DetectLoop());
    PM.add(new LoopInfo());//*****3*****

Because LoopInfo Pass must be registed before your own pass.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!