[cfe-dev] How to use AST Matchers without using ninja?

Eli Bendersky eliben at google.com
Thu Jul 9 13:15:28 PDT 2015


On Thu, Jul 9, 2015 at 12:57 PM, Douglas Katzman <dougk at google.com> wrote:

> Add more libraries. One thing you can do is build 'clang-tidy' and use
> what it uses, minus the ones with 'tidy' in the name.
> These worked for me:
>
> g++ -o try try.o -L lib \
>   -lclangTooling \
>   -lclangStaticAnalyzerFrontend -lclangFrontend -lclangDriver \
>   -lclangParse -lLLVMMCParser -lclangSerialization -lclangSema \
>   -lclangEdit -lLLVMBitReader -lLLVMOption -lclangStaticAnalyzerCheckers \
>   -lclangStaticAnalyzerCore -lclangAnalysis -lclangAST -lclangASTMatchers \
>   -lclangToolingCore \
>   -lclangRewrite -lclangLex -lclangBasic -lLLVMCore -lLLVMMC -lLLVMSupport
> \
>   -lpthread -ldl -lz -ltermcap
>
> You may also want to have a look at
> http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__eli.thegreenplace.net_2012_06_08_basic-2Dsource-2Dto-2Dsource-2Dtransformation-2Dwith-2Dclang&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=BbZNxaRX8U_BzMhQgBYzY1CZ0D9UR_VhA7T6jDJ415Y&s=L-enhGUaff2BKAoRfUS37fzeZy_2mqigf50Xagfqu60&e=>
> though it seems a bit out-of-date. That makefile doesn't work exactly as-is.
>

The up-to-date source is https://github.com/eliben/llvm-clang-samples --
the Makefile in this repo works (repo is kept in sync with LLVM head every
week or two, and there are branches for LLVM releases). It has both LLVM
and Clang-linking samples for out-of-tree builds.

Eli


>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150709/1e1ecf8c/attachment.html>


More information about the cfe-dev mailing list