[llvm-dev] Can I write LLVM pass using add_llvm_library, not add_llvm_loadable_module?

Andrey Bokhanko via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 30 12:00:25 PDT 2016


You probably don't want to add a new directory? In this case, the easiest
would be to take an existing file and implement by analogy.

/lib/Transforms/Scalar/ConstantProp.cpp is a good example. The relevant
lines are 53-62. Note that createConstantPropagation function is called
outside -- grep it and add a call to your own pass creator. Also, you
should add your file to relevant CMakeLists.txt.

Yours,
Andrey


On Sun, Aug 28, 2016 at 12:11 AM, Donghyeon Lee via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I'd write new transform pass related to some function optimization, and
> contribute it into LLVM. But Writing an LLVM Pass
> <http://llvm.org/docs/WritingAnLLVMPass.html> was described only using as
> dynamic LLVM loadable modules (.so extensions).
>
> I want to write LLVM pass using add_llvm_library, not
> add_llvm_loadable_module in CMakeLists.txt. Can I do it? If yes, how?
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160830/cba017f6/attachment.html>


More information about the llvm-dev mailing list