xref: /aosp_15_r20/external/clang/docs/ExternalClangExamples.rst (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li=======================
2*67e74705SXin LiExternal Clang Examples
3*67e74705SXin Li=======================
4*67e74705SXin Li
5*67e74705SXin LiIntroduction
6*67e74705SXin Li============
7*67e74705SXin Li
8*67e74705SXin LiThis page provides some examples of the kinds of things that people have
9*67e74705SXin Lidone with Clang that might serve as useful guides (or starting points) from
10*67e74705SXin Liwhich to develop your own tools. They may be helpful even for something as
11*67e74705SXin Libanal (but necessary) as how to set up your build to integrate Clang.
12*67e74705SXin Li
13*67e74705SXin LiClang's library-based design is deliberately aimed at facilitating use by
14*67e74705SXin Liexternal projects, and we are always interested in improving Clang to
15*67e74705SXin Libetter serve our external users. Some typical categories of applications
16*67e74705SXin Liwhere Clang is used are:
17*67e74705SXin Li
18*67e74705SXin Li- Static analysis.
19*67e74705SXin Li- Documentation/cross-reference generation.
20*67e74705SXin Li
21*67e74705SXin LiIf you know of (or wrote!) a tool or project using Clang, please send an
22*67e74705SXin Liemail to Clang's `development discussion mailing list
23*67e74705SXin Li<http://lists.llvm.org/mailman/listinfo/cfe-dev>`_ to have it added.
24*67e74705SXin Li(or if you are already a Clang contributor, feel free to directly commit
25*67e74705SXin Liadditions). Since the primary purpose of this page is to provide examples
26*67e74705SXin Lithat can help developers, generally they must have code available.
27*67e74705SXin Li
28*67e74705SXin LiList of projects and tools
29*67e74705SXin Li==========================
30*67e74705SXin Li
31*67e74705SXin Li`<https://github.com/Andersbakken/rtags/>`_
32*67e74705SXin Li   "RTags is a client/server application that indexes c/c++ code and keeps
33*67e74705SXin Li   a persistent in-memory database of references, symbolnames, completions
34*67e74705SXin Li   etc."
35*67e74705SXin Li
36*67e74705SXin Li`<http://rprichard.github.com/sourceweb/>`_
37*67e74705SXin Li   "A C/C++ source code indexer and navigator"
38*67e74705SXin Li
39*67e74705SXin Li`<https://github.com/etaoins/qconnectlint>`_
40*67e74705SXin Li   "qconnectlint is a Clang tool for statically verifying the consistency
41*67e74705SXin Li   of signal and slot connections made with Qt's ``QObject::connect``."
42*67e74705SXin Li
43*67e74705SXin Li`<https://github.com/woboq/woboq_codebrowser>`_
44*67e74705SXin Li   "The Woboq Code Browser is a web-based code browser for C/C++ projects.
45*67e74705SXin Li   Check out `<http://code.woboq.org/>`_ for an example!"
46*67e74705SXin Li
47*67e74705SXin Li`<https://github.com/mozilla/dxr>`_
48*67e74705SXin Li    "DXR is a source code cross-reference tool that uses static analysis
49*67e74705SXin Li    data collected by instrumented compilers."
50*67e74705SXin Li
51*67e74705SXin Li`<https://github.com/eschulte/clang-mutate>`_
52*67e74705SXin Li    "This tool performs a number of operations on C-language source files."
53*67e74705SXin Li
54*67e74705SXin Li`<https://github.com/gmarpons/Crisp>`_
55*67e74705SXin Li    "A coding rule validation add-on for LLVM/clang. Crisp rules are written
56*67e74705SXin Li    in Prolog. A high-level declarative DSL to easily write new rules is under
57*67e74705SXin Li    development. It will be called CRISP, an acronym for *Coding Rules in
58*67e74705SXin Li    Sugared Prolog*."
59*67e74705SXin Li
60*67e74705SXin Li`<https://github.com/drothlis/clang-ctags>`_
61*67e74705SXin Li    "Generate tag file for C++ source code."
62*67e74705SXin Li
63*67e74705SXin Li`<https://github.com/exclipy/clang_indexer>`_
64*67e74705SXin Li    "This is an indexer for C and C++ based on the libclang library."
65*67e74705SXin Li
66*67e74705SXin Li`<https://github.com/holtgrewe/linty>`_
67*67e74705SXin Li    "Linty - C/C++ Style Checking with Python & libclang."
68*67e74705SXin Li
69*67e74705SXin Li`<https://github.com/axw/cmonster>`_
70*67e74705SXin Li    "cmonster is a Python wrapper for the Clang C++ parser."
71*67e74705SXin Li
72*67e74705SXin Li`<https://github.com/rizsotto/Constantine>`_
73*67e74705SXin Li    "Constantine is a toy project to learn how to write clang plugin.
74*67e74705SXin Li    Implements pseudo const analysis. Generates warnings about variables,
75*67e74705SXin Li    which were declared without const qualifier."
76*67e74705SXin Li
77*67e74705SXin Li`<https://github.com/jessevdk/cldoc>`_
78*67e74705SXin Li    "cldoc is a Clang based documentation generator for C and C++.
79*67e74705SXin Li    cldoc tries to solve the issue of writing C/C++ software documentation
80*67e74705SXin Li    with a modern, non-intrusive and robust approach."
81*67e74705SXin Li
82*67e74705SXin Li`<https://github.com/AlexDenisov/ToyClangPlugin>`_
83*67e74705SXin Li    "The simplest Clang plugin implementing a semantic check for Objective-C.
84*67e74705SXin Li    This example shows how to use the ``DiagnosticsEngine`` (emit warnings,
85*67e74705SXin Li    errors, fixit hints).  See also `<http://l.rw.rw/clang_plugin>`_ for
86*67e74705SXin Li    step-by-step instructions."
87*67e74705SXin Li
88