<div dir="ltr">Hi Eli,<div><br></div><div>I figure out how to build clang plugin and run it now.</div><div>Thank you.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 8:42 AM, Eli Bendersky <span dir="ltr"><<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Feb 9, 2016 at 10:00 PM, Kai Wang via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I'm a beginner to clang. I want to write clang plugin to do some static analysis. </div><div>I did "mkdir llvm-build" and built clang following these steps <a href="http://clang.llvm.org/get_started.html" target="_blank">http://clang.llvm.org/get_started.html</a><br></div><div><br></div><div>As a starting point, I'm trying clang/examples/PrintFunctionNames from clang plugins tutorial <a href="http://clang.llvm.org/docs/ClangPlugins.html" target="_blank">http://clang.llvm.org/docs/ClangPlugins.html</a></div><div>I did "cd llvm-build & make PrintFunctionNames ", but it didn't work.</div><div>I also tried "cd llvm-build/tools/clang", and "make BUILD_EXAMPLES=1".</div><div>However, in either case I can not get "PrintFunctionNames.so"</div><div><br></div><div>Is there any guidance? Thank you.</div></div></blockquote><div><br></div></span><div>Hi Kai,</div><div><br></div><div>If you want to build a plugin outside the Clang tree, see this sample: <a href="https://github.com/eliben/llvm-clang-samples/blob/master/src_clang/plugin_print_funcnames.cpp" target="_blank">https://github.com/eliben/llvm-clang-samples/blob/master/src_clang/plugin_print_funcnames.cpp</a> and the Makefile that builds it (in the same repo). It works both with close-to-trunk Clang and the latest release binaries. The C++ file has a comment at the top explaining how to run it once built</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Eli</div><div><br></div><div> </div></font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Regards,<div>Kai</div></div></div>
</div>