How to write a custom intermodular pass in LLVM?

后端 未结 3 524
遇见更好的自我
遇见更好的自我 2020-12-31 11:33

I\'ve written a standard Analysis pass in LLVM, by extending the FunctionPass class. Everything seems to make sense.

Now what I\'d like to do is write a couple of in

3条回答
  •  旧时难觅i
    2020-12-31 12:17

    In LTO all the modules are combined and you can see the whole program IR in one module.

    You need to write a module pass like any module pass and add it to the list of LTO passes in populateLTOPassManager function in PassManagerBuilder.cpp. Here is the doc for PassManagerBuilder: http://llvm.org/docs/doxygen/html/classllvm_1_1PassManagerBuilder.html

    When you do this, your pass will be executed with other LTO passes.

提交回复
热议问题