<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">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><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">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><div><br></div><div>Eli</div><div><br></div><div> </div></div></div></div>