LLVM - Run Own Pass automatically with clang

后端 未结 2 449
一整个雨季
一整个雨季 2021-01-02 07:00

I wrote a few own passes for llvm, in order to use them with clang.

I integrated them in llvm (not dynamically loaded). They are even listed in the Optimizations

相关标签:
2条回答
  • 2021-01-02 07:42

    The proper way to do this would be to make clang add your pass to the pass manager it builds. See clang/lib/CodeGen/BackendUtil.cpp:void EmitAssemblyHelper::CreatePasses() for how it's handled for the sanitizers.

    0 讨论(0)
  • 2021-01-02 07:43

    You can run your own pass with clang directly with -Xclang.

    clang++ -Xclang -load -Xclang ./libmypass.so input.cpp
    

    Source

    0 讨论(0)
提交回复
热议问题