<div dir="ltr"><div><div><div>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.<br><br></div>/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.<br><br></div>Yours,<br></div>Andrey<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 28, 2016 at 12:11 AM, Donghyeon Lee via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'd write new transform pass related to some function optimization, and contribute it into LLVM. But <a href="http://llvm.org/docs/WritingAnLLVMPass.html" target="_blank">Writing an LLVM Pass</a> was described only using as dynamic LLVM loadable modules (.so extensions).</div><div><br></div><div>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?</div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>